TikTok Ad Library API — Download Ad Video & Images
Documentation menu
FetchLayer FetchLayer API

Get an ad's videos and images

Resolve an ad's creative into downloadable files — the video, its cover frame, and any images. The library's own URLs are signed and expire within hours, so each asset also carries a downloadUrl served through FetchLayer that does not. Optionally probe each asset to confirm it is still retrievable and report its size and content type, or inline it as base64 for assets under the inline size limit.

POST /ad-media Media
https://api.fetchlayer.dev/tiktok-ad-library/ad-media
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

ad string required

Ad id, or an ad library URL containing one.

kinds string[] optional

video, image, and/or thumbnail. (default: all three)

probe boolean optional

Confirm each asset is still downloadable and report its size and content type.

inline boolean optional

Return the bytes base64-encoded. Refused for assets over the inline size limit.

Response Fields

ad-media

Get an ad's videos and images

adId string

The resolved ad id.

assets object[]

The ad's media assets.

assets[].kind string

video, image, or thumbnail.

assets[].url string

The file's own URL on TikTok. Signed, and expires within hours.

assets[].downloadUrl string

Serves the same file through GET /media, without the expiry.

assets[].quality string

original or cover.

assets[].contentType string

MIME type. Populated only when probe or inline was set.

assets[].contentLength number

Size in bytes. Populated only when probe or inline was set.

assets[].base64 string

The bytes themselves. Populated only when inline was set.

assetCount number

Number of assets in this response.

notes string[]

Caveats about this result, such as an asset that could not be probed.

Request

curl -X POST "https://api.fetchlayer.dev/tiktok-ad-library/ad-media" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"ad":"1794523310028321","kinds":["video","thumbnail"],"probe":true}'

Response

{
  "assetCount": 2,
  "assets": [
    {
      "kind": "video",
      "quality": "original",
      "contentType": "video/mp4",
      "contentLength": 4182773,
      "url": "https://v16m.tiktokcdn.com/..."
    }
  ]
}