- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
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).
You send one of query or advertiser_name.
Part of the TikTok Scraper API: 24 TikTok endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/tiktok/ad-library/search" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'query="free trial"' \4 --data-urlencode 'start_date=2026-10-22' \5 --data-urlencode 'end_date=2026-10-29'1import os2import requests34params = {5 "query": "\"free trial\"",6 "start_date": "2026-10-22",7 "end_date": "2026-10-29",8}9res = requests.get(10 "https://api.socialscrape.dev/v1/tiktok/ad-library/search",11 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},12 params=params,13 timeout=60,14)15body = res.json()1617if body["ok"]:18 print(body["data"])19else:20 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/tiktok/ad-library/search");2url.search = new URLSearchParams({3 query: "\"free trial\"",4 start_date: "2026-10-22",5 end_date: "2026-10-29",6}).toString();7const res = await fetch(url, {8 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },9});10const body = await res.json();1112if (body.ok) {13 console.log(body.data);14} else {15 console.error(body.error.code, body.error.message);16}1{2 "nodes": [3 {4 "name": "SocialScrape TikTok Ad Library search",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/tiktok/ad-library/search",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "query",19 "value": "\"free trial\""20 },21 {22 "name": "start_date",23 "value": "2026-10-22"24 },25 {26 "name": "end_date",27 "value": "2026-10-29"28 }29 ]30 },31 "sendHeaders": true,32 "headerParameters": {33 "parameters": [34 {35 "name": "x-api-key",36 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"37 }38 ]39 }40 }41 }42 ],43 "connections": {}44}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 | TikTok advertiser business id from a See all ads link; pins the exact advertiser. Only works together with `advertiser_name`. | |
start_date | string | Ads shown from this date, YYYY-MM-DD (default: a year before `end_date`). | |
end_date | string | Ads shown up to this date, YYYY-MM-DD (default: today). | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. | |
region | string | Two-letter country code (ISO 3166-1) for results that vary by country. Also accepted as country, geo. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are examples, not your data.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_95b27ec99ad76d8b442abef2",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "ad",13 "platform": "tiktok",14 "id": "1880321679899026",15 "url": "https://library.tiktok.com/ads/detail/?ad_id=1880321679899026",16 "advertiser": {17 "object": "advertiser",18 "platform": "tiktok",19 "id": null,20 "name": "WHOOP, INC.",21 "url": null,22 "page_id": null,23 "country": null,24 "verified": null,25 "ad_count": null,26 "extra": null27 },28 "status": "unknown",29 "started_at": "2026-10-28T00:00:00Z",30 "ended_at": null,31 "title": "This year, sleep deeper, train smarter, and live better for longer. Start your WHOOP free trial.",32 "body": null,33 "cta_text": null,34 "landing_url": null,35 "format": "video",36 "media": {37 "thumbnail_url": "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/ogpYQbpZ1BuEaAFNeB7ICEFBJqDygYfC7wrDE6~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=f8002d9d...",38 "video_url": "https://library.tiktok.com/api/v1/cdn/1793325924/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS8zMzMxNjlkYjc1OTk1NDIwZGZkNDdlZjZkODU2NGI3ZS82YWU0NGZlMS92aWRlby90b3...",39 "audio_url": null,40 "image_urls": [41 "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/ogpYQbpZ1BuEaAFNeB7ICEFBJqDygYfC7wrDE6~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=f8002d9d..."42 ],43 "width": null,44 "height": null45 },46 "regions": null,47 "publisher_platforms": null,48 "impressions": {49 "lower": 0,50 "upper": 1000,51 "currency": null52 },53 "spend": null,54 "extra": {55 "audit_status": "1",56 "estimated_audience": "0-1K",57 "impression": 0,58 "last_shown_at": "2026-10-28T00:00:00Z",59 "show_mode": 1,60 "sor_audit_status": "1"61 }62 },63 {64 "object": "ad",65 "platform": "tiktok",66 "id": "1880003998052722",67 "url": "https://library.tiktok.com/ads/detail/?ad_id=1880003998052722",68 "advertiser": {69 "object": "advertiser",70 "platform": "tiktok",71 "id": null,72 "name": "Appchi LLC",73 "url": null,74 "page_id": null,75 "country": null,76 "verified": null,77 "ad_count": null,78 "extra": null79 },80 "status": "unknown",81 "started_at": "2026-10-26T00:00:00Z",82 "ended_at": null,83 "title": "Get the Best Ringtones for iPhone - Free Trial Inside",84 "body": null,85 "cta_text": null,86 "landing_url": null,87 "format": "video",88 "media": {89 "thumbnail_url": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/oQaqZA1qbEyzM9IjtYKiUA6tBPrFPiibA3RAk~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=04dc32d6&...",90 "video_url": "https://library.tiktok.com/api/v1/cdn/1793325924/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS80Y2MzN2VlYzNiNTM3NjE2ZmUwODQ2ODBkMjYxYWQ3NC82YWU0NGZkOS92aWRlby90b3...",91 "audio_url": null,92 "image_urls": [93 "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/oQaqZA1qbEyzM9IjtYKiUA6tBPrFPiibA3RAk~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=04dc32d6&..."94 ],95 "width": null,96 "height": null97 },98 "regions": null,99 "publisher_platforms": null,100 "impressions": {101 "lower": 0,102 "upper": 1000,103 "currency": null104 },105 "spend": null,106 "extra": {107 "audit_status": "1",108 "estimated_audience": "0-1K",109 "impression": 0,110 "last_shown_at": "2026-10-28T00:00:00Z",111 "show_mode": 1,112 "sor_audit_status": "1"113 }114 }115 ],116 "cursor": "eyJrIjoidHRhZHMiLCJwIjoxLCJzIjoiZXlKc1lYTjBYM052Y25RaU9sc3hOemt6TVRRMU5qQXdNREF3WFN3aWJtVjRkRjlqZFhKemIzSWlPakV5ZlE9PSJ9",117 "has_more": true,118 "parent": null119 },120 "cursor": "eyJrIjoidHRhZHMiLCJwIjoxLCJzIjoiZXlKc1lYTjBYM052Y25RaU9sc3hOemt6TVRRMU5qQXdNREF3WFN3aWJtVjRkRjlqZFhKemIzSWlPakV5ZlE9PSJ9",121 "has_more": true122}Fields
A page of results. Each entry in items is a Ad. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "ad" | ||
platform | Platform | yes | the ad library's platform |
id | string | yes | |
url | string or null | ||
advertiser | Advertiser or null | ||
status | "active" or "inactive" or "unknown" | ||
started_at | string (ISO 8601 date-time) or null | ||
ended_at | string (ISO 8601 date-time) or null | ||
title | string or null | ||
body | string or null | ||
cta_text | string or null | ||
landing_url | string or null | ||
format | string or null | "image" | "video" | "carousel" | "text" | platform-specific | |
media | Media |
Show the other 5 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry), upstream_blocked (retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The Python client has client.tiktok.ad_library_search(...) and the TypeScript client client.tiktok.adLibrarySearch(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.