TikTok Ad Library search
Beta GET /v1/tiktok/ad-library/search
GET /v1/tiktok/ad-library/search
Search TikTok's public Ads Library by keyword (query, or a quoted "exact phrase") or by advertiser (advertiser_name, resolved through TikTok's typeahead). Give one of the two. The library is TikTok's European commercial-content library: it lists ads shown in the EU, EEA, UK and Switzerland, 12 per page, newest shown first. region is one of those countries (default all).
- Cost: 1 credit
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
query | string | one of | General ad search. Also accepted as keyword, q. |
advertiser_name | string | one of | Advertiser name to resolve and search by advertiser entity. |
adv_biz_ids | string | no | TikTok advertiser business id from a See all ads link; pins the exact advertiser. Only works together with advertiser_name. |
start_date | string | no | Ads shown from this date, YYYY-MM-DD (default: a year before end_date). |
end_date | string | no | Ads shown up to this date, YYYY-MM-DD (default: today). |
Send at least one of query, advertiser_name. If you send several, the first listed is used and the rest are ignored.
Every request also accepts:
cursor: the cursor from the previous page (Pagination).region: two-letter country code for results that vary by country. Changing it restarts the cursor chain.trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
curl -G "https://api.socialscrape.io/v1/tiktok/ad-library/search" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "query="free trial"" \
--data-urlencode "start_date=2026-10-22" \
--data-urlencode "end_date=2026-10-29"import os
import requests
params = {
"query": "\"free trial\"",
"start_date": "2026-10-22",
"end_date": "2026-10-29",
}
res = requests.get(
"https://api.socialscrape.io/v1/tiktok/ad-library/search",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/tiktok/ad-library/search");
url.search = new URLSearchParams({
"query": "\"free trial\"",
"start_date": "2026-10-22",
"end_date": "2026-10-29"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape TikTok Ad Library search",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/tiktok/ad-library/search",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "query",
"value": "\"free trial\""
},
{
"name": "start_date",
"value": "2026-10-22"
},
{
"name": "end_date",
"value": "2026-10-29"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Example response#
This is a sample from a recorded response, lists and long text are shortened, dash characters in the text are replaced with hyphens. Status 200.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_95b27ec99ad76d8b442abef2",
"data": {
"object": "list",
"items": [
{
"object": "ad",
"platform": "tiktok",
"id": "1880321679899026",
"url": "https://library.tiktok.com/ads/detail/?ad_id=1880321679899026",
"advertiser": {
"object": "advertiser",
"platform": "tiktok",
"id": null,
"name": "WHOOP, INC.",
"url": null,
"page_id": null,
"country": null,
"verified": null,
"ad_count": null,
"extra": null
},
"status": "unknown",
"started_at": "2026-10-28T00:00:00Z",
"ended_at": null,
"title": "This year, sleep deeper, train smarter, and live better for longer. Start your WHOOP free trial.",
"body": null,
"cta_text": null,
"landing_url": null,
"format": "video",
"media": {
"thumbnail_url": "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/ogpYQbpZ1BuEaAFNeB7ICEFBJqDygYfC7wrDE6~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=f8002d9d&x-expires=1793347200&x-signature=5472kO5r22tpBqIYSI0MvaaNEkE%3D&t=4d5b0474&ps=1374...",
"video_url": "https://library.tiktok.com/api/v1/cdn/1793325924/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS8zMzMxNjlkYjc1OTk1NDIwZGZkNDdlZjZkODU2NGI3ZS82YWU0NGZlMS92aWRlby90b3MvYWxpc2cvdG9zLWFsaXNnLXZlLTUxYzc5OS1zZy9vZ2xGRUJBRjNRWThGTmdneXJEcWR3SWFmMFcxRGZsQ...",
"audio_url": null,
"image_urls": [
"https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/ogpYQbpZ1BuEaAFNeB7ICEFBJqDygYfC7wrDE6~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=f8002d9d&x-expires=1793347200&x-signature=5472kO5r22tpBqIYSI0MvaaNEkE%3D&t=4d5b0474&ps=1374..."
],
"width": null,
"height": null
},
"regions": null,
"publisher_platforms": null,
"impressions": {
"lower": 0.0,
"upper": 1000.0,
"currency": null
},
"spend": null,
"extra": {
"audit_status": "1",
"estimated_audience": "0-1K",
"impression": 0,
"last_shown_at": "2026-10-28T00:00:00Z",
"show_mode": 1,
"sor_audit_status": "1"
}
},
{
"object": "ad",
"platform": "tiktok",
"id": "1880003998052722",
"url": "https://library.tiktok.com/ads/detail/?ad_id=1880003998052722",
"advertiser": {
"object": "advertiser",
"platform": "tiktok",
"id": null,
"name": "Appchi LLC",
"url": null,
"page_id": null,
"country": null,
"verified": null,
"ad_count": null,
"extra": null
},
"status": "unknown",
"started_at": "2026-10-26T00:00:00Z",
"ended_at": null,
"title": "Get the Best Ringtones for iPhone - Free Trial Inside",
"body": null,
"cta_text": null,
"landing_url": null,
"format": "video",
"media": {
"thumbnail_url": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/oQaqZA1qbEyzM9IjtYKiUA6tBPrFPiibA3RAk~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=04dc32d6&x-expires=1793347200&x-signature=IA3cFIRLyGuWUxesPtWaBMP5eB8%3D&t=4d5b0474&ps=13740...",
"video_url": "https://library.tiktok.com/api/v1/cdn/1793325924/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS80Y2MzN2VlYzNiNTM3NjE2ZmUwODQ2ODBkMjYxYWQ3NC82YWU0NGZkOS92aWRlby90b3MvYWxpc2cvdG9zLWFsaXNnLXZlLTAwNTFjMDAxLXNnL29FUVJsdWVaQVFsUVl6b0RzeVZHMk1XQ3RnZVhnc...",
"audio_url": null,
"image_urls": [
"https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/oQaqZA1qbEyzM9IjtYKiUA6tBPrFPiibA3RAk~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=04dc32d6&x-expires=1793347200&x-signature=IA3cFIRLyGuWUxesPtWaBMP5eB8%3D&t=4d5b0474&ps=13740..."
],
"width": null,
"height": null
},
"regions": null,
"publisher_platforms": null,
"impressions": {
"lower": 0.0,
"upper": 1000.0,
"currency": null
},
"spend": null,
"extra": {
"audit_status": "1",
"estimated_audience": "0-1K",
"impression": 0,
"last_shown_at": "2026-10-28T00:00:00Z",
"show_mode": 1,
"sor_audit_status": "1"
}
}
],
"cursor": "eyJrIjoidHRhZHMiLCJwIjoxLCJzIjoiZXlKc1lYTjBYM052Y25RaU9sc3hOemt6TVRRMU5qQXdNREF3WFN3aWJtVjRkRjlqZFhKemIzSWlPakV5ZlE9PSJ9",
"has_more": true,
"parent": null
},
"cursor": "eyJrIjoidHRhZHMiLCJwIjoxLCJzIjoiZXlKc1lYTjBYM052Y25RaU9sc3hOemt6TVRRMU5qQXdNREF3WFN3aWJtVjRkRjlqZFhKemIzSWlPakV5ZlE9PSJ9",
"has_more": true
}Response#
A list of Ad objects in data.items, with data.cursor and data.has_more.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
upstream_blocked | 503 | yes | The platform blocked this fetch; retry (a fresh exit is used). |
Every request can also fail with the account and platform errors listed on the Errors page.
Example error:
{
"ok": false,
"error": {
"code": "upstream_blocked",
"message": "The platform blocked this fetch; retry (a fresh exit is used).",
"retryable": true
},
"credits_charged": 0,
"request_id": "req_8e32cfb6871a275d61a3f46b"
}Related endpoints#
- TikTok profile (
GET /v1/tiktok/profile) - TikTok profile videos (
GET /v1/tiktok/profile/videos) - TikTok collection videos (
GET /v1/tiktok/collection/videos) - TikTok video details (
GET /v1/tiktok/video) - TikTok video transcript (
GET /v1/tiktok/video/transcript) - TikTok video comments (
GET /v1/tiktok/video/comments) - TikTok comment replies (
GET /v1/tiktok/video/comment/replies) - TikTok user search (
GET /v1/tiktok/search/users)