Download a video, image or cover
Delivers one file from a downloadUrl: a video as an MP4 without the TikTok watermark, or a photo-post frame, cover or avatar, with Range support so players can seek and downloads can resume. Pass exactly one of video or url. Each request costs 1 credit, a range request included.
/media Utilities https://api.fetchlayer.dev/tiktok/media Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
video string optional A video id, as a video asset’s downloadUrl names it. Returns the video as MP4 (H.264 and AAC) at the quality TikTok streams by default, usually 720p, with no size limit. The first request for a video takes about 1.5–3 seconds before the first byte; further requests for it within about 20 minutes start in well under a second. 403 "The creator has turned off downloads for this video." when the creator has turned off downloads (its downloadUrl is then null); 404 for a photo post, whose images are its assets, or a video that is not public; 503 means try again after a short wait.
url string optional An image or cover URL, as an image asset’s downloadUrl names it, or a coverUrl or avatarUrl. Only TikTok’s own media hosts; anything else is a 400. An expired or removed image is a 404, "that media is no longer available on TikTok; read the record again for a fresh link". A video’s own url is a 404 that says to use the video’s downloadUrl instead.
Response Fields
media
Download a video, image or cover
(binary) file The file, streamed. A video comes with content-length, content-range, accept-ranges, etag, last-modified and content-disposition: inline; filename="<id>.mp4", and answers a Range or If-Range request with 206, so players can seek and an interrupted download can resume.
Request
curl -X GET "https://api.fetchlayer.dev/tiktok/media?url=https%3A%2F%2Fp19-common-sign.tiktokcdn-us.com%2Ftos-useast5-p-0068-tx%2F..." \
-H "Authorization: Bearer ss-your-key"Response
{
"note": "The image’s bytes, streamed with its own content type."
}