TikTok
Download file
Download a TikTok video, or one photo of a slideshow, straight from the post link. TikTok’s own video URLs don’t work outside the API, so this is how you get the file.
Endpoint
GET
/s/tiktok/downloadSend your API key in the X-API-Key header. tiktok is the usual service slug; use the one shown on your subscription if it differs.
Query parameters
| Name | Description |
|---|---|
urlrequired | Link to the TikTok post (video, photo slideshow or vm.tiktok.com short link). You can pass the numeric ID as id instead.Example: https://www.tiktok.com/@scout2015/video/6718335390845095173 |
indexoptional | Which media item to download, from 0, in the order the post endpoint lists them. For a slideshow: 0 is the first photo; the last item is the background music. Default 0.Example: 0 |
filenameoptional | Name to save the file as. Default tiktok-<id>.mp4. |
Example request
# -o writes the file as it arrives; -C - resumes a broken download.
curl -C - -o video.mp4 '/s/tiktok/download?url=https%3A%2F%2Fwww.tiktok.com%2F%40scout2015%2Fvideo%2F6718335390845095173&index=0' \
-H 'X-API-Key: YOUR_API_KEY'Response
The body is the file itself, not JSON. Errors still come back as JSON with a message.
HTTP/1.1 200 OK
Content-Type: video/mp4
Content-Length: 73400320
Content-Disposition: attachment; filename=facebook-video.mp4
Accept-Ranges: bytesNotes
- You get the best quality the post endpoint lists first.
- The file is streamed as it arrives; read it in chunks rather than loading it into memory.
- Range requests work: send Range: bytes=START- to resume a broken download, or let a video player seek.
- Each download counts as one request on your plan, whatever the file size.