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/download

Send 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

NameDescription
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: bytes

Notes