Authentication
All requests use your FetchLayer API key as a Bearer token. No TikTok credentials, app id, or Marketing API access token is required.
Sending requests
curl -X POST https://api.fetchlayer.dev/tiktok-ad-library/search-ads \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"query":"skincare","country":"DE"}'Keep your key secret
Downloading media
The media download endpoint is a GET, and carries the same Bearer header. Because the key travels in a header rather than the URL, a media URL cannot be shared without also sharing the key.
curl -X GET "https://api.fetchlayer.dev/tiktok-ad-library/media?url=https%3A%2F%2Fv16m.tiktokcdn.com%2F...&filename=acme-beauty-ad.mp4" \
-H "Authorization: Bearer ss-your-key" \
-H "Range: bytes=0-65535" \
--output acme-beauty-ad.mp4Authentication errors
A missing or invalid key returns HTTP 401.
{
"error": "Invalid API key"
}