Douyin Video Downloader API
One authenticated POST turns a public Douyin video URL into a saved MP4 — direct video link plus normalized metadata (title, author, engagement) as clean JSON.
- One REST Endpoint
- Every Link Format
- Normalized Metadata
- Engagement Built In
- Idempotent Billable Writes
- Predictable Error Codes
Request examples
curl -X POST "https://api.agentbody.io/v1/douyin/video/download" \
-H "Authorization: Bearer <YOUR_AGENTBODY_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"url":"YOUR_URL"}'Response examples
Documented responses from the OpenAPI specification.
Downloaded Douyin media link and normalized public video metadata.
{
"author_name": "盗月社食遇记",
"collect_count": 855021,
"comment_count": 162235,
"digg_count": 4037193,
"duration_seconds": 1082.5,
"id": "7577614489533680959",
"share_count": 5135670,
"text": "这个贵州五线小城市…",
"title": "贵州美食探店",
"url": "https://www.douyin.com/video/7577614489533680959",
"video_content_type": "video/mp4",
"video_size_bytes": 215476832,
"video_url": "https://api.apify.com/v2/key-value-stores/example/records/7577614489533680959.mp4"
}Features
Use the Douyin Video Downloader API for content archiving, cross-border research pipelines, and media workflows — URL in, MP4 link and metrics out.
One REST Endpoint
Call POST /v1/douyin/video/download with a bearer API key and the public video URL. The API saves the MP4 and returns a direct video link — no app-signature reversing, no device farm, no scraping stack to maintain.
Every Link Format
The url field accepts douyin.com video URLs, iesdouyin share links, v.douyin.com short links, and bare numeric video IDs. Integrations can accept whatever users paste without a normalization step.
Normalized Metadata
Every response pairs the video_url with id, title, text, author_name, duration, content type, and file size — stable fields your pipeline can store without per-request parsing.
Engagement Built In
The response carries digg_count, comment_count, share_count, and collect_count alongside the file link — archive the video and its performance snapshot in one request.
Idempotent Billable Writes
Video saves are metered operations. Send an Idempotency-Key header on retries so an interrupted response does not double-bill the same video — repeated identical requests with one key return the original result.
Predictable Error Codes
Handle failures with documented status codes: 400 for an invalid request, 401 for a missing or bad API key, 409 for idempotency conflicts, and 502/503/504 for temporary upstream issues — each maps to a distinct fix or retry action.
How to use
Follow these steps to call the Douyin Video Downloader API: create a key, build the POST request, and process the returned MP4 link.
Create An API Key
Create an AgentBody account and generate an API key in the console. Keep the key in your server environment or an approved secret store and send it as a bearer token — never in browser code or client bundles.
Build The Request
Send POST /v1/douyin/video/download with the required url — a douyin.com link, iesdouyin share link, v.douyin.com short link, or numeric video ID. The generated examples show the exact request in curl, JavaScript, Python, Java, and Go.
Add An Idempotency Key
Attach an Idempotency-Key header to every download you might retry — timeouts, connection drops, worker restarts. Repeated identical requests with the same key return the original response without re-billing.
Keep The Key Server-Side
Call the endpoint from your backend, a serverless function, or a scheduled job. If end users trigger downloads, proxy through your own endpoint so the key and billing stay under your control.
Parse The JSON Response
Read the returned video_url, id, title, author_name, duration, size, and engagement counts. Store the link with its metadata, or hand the URL straight to your storage layer — the fields are stable across requests.
Handle Errors Correctly
Fix 400 responses by correcting the request, 401 by configuring a valid key, and follow the documented Idempotency-Key behavior on 409. Retry 502, 503, and 504 with backoff under the same key.
Frequently asked questions
What is the Douyin Video Downloader API?
An authenticated POST endpoint, /v1/douyin/video/download, that saves one public Douyin video as an MP4 and returns a direct video link with normalized metadata — id, title, author, duration, file size, and engagement counts — as structured JSON.
How does the Douyin downloader API pricing work?
Each video save is a metered operation that runs on your account's credits. Pricing is governed by the gateway rather than fixed numbers on this page — check the console for current per-call costs, and use idempotency keys so retries never double-bill.
What URL formats does the Douyin API accept?
The url field takes douyin.com video URLs, iesdouyin share links, v.douyin.com short links, and bare numeric video IDs — whatever your users paste resolves through the same request shape.
Does the API download private Douyin videos?
No. The endpoint reads public videos only — private, friends-only, and removed videos will not resolve, and no Douyin credentials are requested to work around the limit.
What metadata comes with the video link?
id, url, title, text, author_name, duration_seconds, video_content_type, video_size_bytes, and the digg, comment, share, and collect counts — enough to archive the video and its performance snapshot together.
How do I handle API errors?
Correct the request body on 400, fix your bearer key on 401, and follow the documented Idempotency-Key behavior on 409. Treat 502, 503, and 504 as temporary upstream failures and retry with backoff under the same key.