Download a TikTok video file
Download the video file of one post by permalink or share link. A successful response is the file itself (HTTP 200, the media host's video content type and length); failures are JSON. Photo posts have no video file and answer unsupported_media; their images download directly from the video route's imagePost addresses.
/v1/tiktok/video/mediax-api-keyHeaders
Get your API keyYour ScrapeAtlas customer key. Create one on /account/ and set SCRAPEATLAS_API_KEY.
https://www.tiktok.com/@{handle}/video/{id}, https://www.tiktok.com/t/{code}, https://vm.tiktok.com/{code} or https://vt.tiktok.com/{code}; query strings and fragments are accepted and dropped. Photo permalinks answer unsupported_media.
max 512 chars
https://www.tiktok.com/@example/video/7400000000000000001Request correlation UUID (also the x-request-id header of a successful download).
Upstream calls made, decoded bytes delivered to the parser and elapsed milliseconds.
Always included.
≥ 0
Always included.
≥ 0
Always included.
≥ 0
Present on failures only: false.
failed or challenged on failures.
one of: failed, challenged
Failure code and content-free message.
Always included.
one of: invalid_request, unauthorized, not_found, restricted_page, upstream_challenged, upstream_rate_limited, upstream_error, unsupported_page, response_too_large, unsafe_redirect, request_limit, payload_too_complex, timeout, busy, unsupported_media
Always included.
No fields match.
HTTP 200 returns the file itself (video/mp4 family) with its content-length when known, not JSON. The fields above describe the JSON body of a failure, explained in Errors & responses.
| HTTP | failure.code | Meaning |
|---|---|---|
| 400 | invalid_request | Missing, duplicate, ambiguous or unsupported parameters, unsupported URL forms, handles, cursors, regions, sorts or languages. |
| 401 | unauthorized | Invalid API key. |
| 403 | restricted_page | TikTok restricts the account or post (private video, private account, region block, or a redirect to its login page). |
| 404 | not_found | Unknown or removed account, post, hashtag or sound, a post without captions, or a TikTok status code naming a missing resource. |
| 422 | unsupported_media | A video file was requested for a photo post, which has no video file. |
| 429 | upstream_rate_limited | TikTok rate limited the request. |
| 502 | upstream_challenged | TikTok answered its verification page, an HTTP 401/403, a document without the app state, or refused a feed call with an empty body (status challenged). |
| 502 | unsafe_redirect | TikTok redirected outside the requested resource. |
| 502 | unsupported_page | Layout, identity or feed-envelope checks failed, or a non-JSON feed answer was served. |
| 502 | response_too_large | The upstream response exceeded 4 MiB (512 KiB for caption files). |
| 502 | payload_too_complex | The embedded JSON exceeded parsing limits. |
| 502 | request_limit | The upstream call budget was exhausted. |
| 502 | upstream_error | Network failure, a stalled exit, an unexpected upstream status after one retry, or an unexpected TikTok status code. |
| 503 | busy | All retrieval slots are occupied. |
| 504 | timeout | The 90-second deadline elapsed. |