Skip to content
scrapeatlas.Dashboard

Download a TikTok video file

Try in Playground

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.

GET/v1/tiktok/video/mediax-api-key
x-api-keystringrequiredheader

Your ScrapeAtlas customer key. Create one on /account/ and set SCRAPEATLAS_API_KEY.

Query parameters
1
urlstringrequiredquery

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

Examplehttps://www.tiktok.com/@example/video/7400000000000000001
Response fields
10
requestIdstring

Request correlation UUID (also the x-request-id header of a successful download).

Upstream calls made, decoded bytes delivered to the parser and elapsed milliseconds.

accounting.upstreamRequestsinteger

Always included.

≥ 0

accounting.responseBytesinteger

Always included.

≥ 0

accounting.durationMsnumber

Always included.

≥ 0

successboolean

Present on failures only: false.

statusenum

failed or challenged on failures.

one of: failed, challenged

Failure code and content-free message.

failure.codeenum

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

failure.messagestring

Always included.

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.

Error codes
15
HTTPfailure.codeMeaning
400invalid_requestMissing, duplicate, ambiguous or unsupported parameters, unsupported URL forms, handles, cursors, regions, sorts or languages.
401unauthorizedInvalid API key.
403restricted_pageTikTok restricts the account or post (private video, private account, region block, or a redirect to its login page).
404not_foundUnknown or removed account, post, hashtag or sound, a post without captions, or a TikTok status code naming a missing resource.
422unsupported_mediaA video file was requested for a photo post, which has no video file.
429upstream_rate_limitedTikTok rate limited the request.
502upstream_challengedTikTok 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).
502unsafe_redirectTikTok redirected outside the requested resource.
502unsupported_pageLayout, identity or feed-envelope checks failed, or a non-JSON feed answer was served.
502response_too_largeThe upstream response exceeded 4 MiB (512 KiB for caption files).
502payload_too_complexThe embedded JSON exceeded parsing limits.
502request_limitThe upstream call budget was exhausted.
502upstream_errorNetwork failure, a stalled exit, an unexpected upstream status after one retry, or an unexpected TikTok status code.
503busyAll retrieval slots are occupied.
504timeoutThe 90-second deadline elapsed.