TikTok Ad Library
Structured TikTok data: send urls. Cursor-paginated, 1 credit per successful call.
Overview
Section titled “Overview”Call GET /api/v2/tiktok-ads/ with urls. The results are in data.ads; send data.next_cursor back as cursor to get the next page. 2 optional parameters refine the call (see Parameters).
Request
Section titled “Request”curl -G "https://api.scrapier.io/api/v2/tiktok-ads/" \ -H "X-API-Key: YOUR_API_KEY" \ --data-urlencode "urls=https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc" \ --max-time 210const params = new URLSearchParams({ urls: "https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc" });
const res = await fetch(`https://api.scrapier.io/api/v2/tiktok-ads/?${params}`, { headers: { "X-API-Key": "YOUR_API_KEY" }, signal: AbortSignal.timeout(210_000),});const body = await res.json();if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`);
console.log(body.data.ads);import requests
resp = requests.get( "https://api.scrapier.io/api/v2/tiktok-ads/", headers={"X-API-Key": "YOUR_API_KEY"}, params={"urls": "https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc"}, timeout=210,)body = resp.json()if not resp.ok: raise RuntimeError(body.get("error") or body.get("detail"))
print(body["data"]["ads"])curl -X POST "https://api.scrapier.io/api/v2/tiktok-ads/" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"urls":"https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc"}' \ --max-time 210Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
X-API-Key header | string | yes | — | Your API key from the dashboard. |
urls | string | yes | e.g. https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc | TikTok Ad Library search URL (filters: region, start_time/end_time, adv_name, adv_biz_ids, query_type, sort_type, ad_type, ad_status, ages, ad_reach, gender) or a bare keyword. One page = 12 ads (TikTok's fixed page size). Required on first call; ignored when cursor is supplied (filters are locked into it). |
cursor | string | no | — | Pagination cursor returned in the previous response's next_cursor. Pass it back unchanged to fetch the next page. When next_cursor is null, you have reached the last page. |
include_details | boolean | no | true | Fetch each ad's detail record (paid-by, per-region impressions, targeting). Best-effort: if TikTok rate-limits it, ads come from search-card data (detail_fetched=false) with a warning. Locked into the cursor. |
Advanced
| Name | Type | Default | Description |
|---|---|---|---|
use_proxy | boolean | true | Route the request through Scrapier's residential proxy pool. Default: true. Leave as is unless support tells you otherwise. |
raw_data | boolean | false | When true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under raw_responses, in place of the formatted items. When false (default) you get the formatted output. Pagination (cursor / next_cursor) works the same in both modes. |
Response
Section titled “Response”{ "success": true, "data": { "urls": "https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&query_type=2", "page": 1, "page_size": 12, "total": 311, "ads": [ { "adId": "1874157948935201", "adName": "Discover the new GeForce RTX", "advertiserName": "NVIDIA GmbH", "impressions": { "lowerBound": 10000, "upperBound": 100000 }, "paidBy": "NVIDIA GmbH", "regionStats": [ { "regionCode": "DE", "impressions": 100000 } ], "startUrl": "https://library.tiktok.com/ads?region=all&start_time=1786665600000&end_time=1786665600000&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date%2Cdesc", "videos": [ { "url": "https://library.tiktok.com/api/v1/cdn/.../video/...", "coverImageUrl": "https://p16-common-sign.tiktokcdn.com/...jpeg" } ], "ad_id": "1874157948935201", "ad_title": "Discover the new GeForce RTX", "advertiser_name": "NVIDIA GmbH", "advertiser_id": "6891503886842987266", "first_shown_date": "2026-08-01", "last_shown_date": "2026-08-11", "region": "DE", "url": "https://library.tiktok.com/ads/detail/?ad_id=1874157948935201", "estimated_audience": "10K-100K", "image_urls": [ "https://p16-common-sign.tiktokcdn.com/...jpeg" ], "external_url": "https://www.nvidia.com/de-de/geforce/", "subject": "Electronics", "advertiser_registry_location": "Germany", "advertiser_tiktok_username": "nvidiageforce_de", "advertiser_tiktok_followers": "120.5K", "target_audience_size": "7.1M-8.7M", "targeting_age": [ { "region": "DE", "13-17": false, "18-24": true, "25-34": true, "35-44": true, "45-54": false, "55+": false } ], "targeting_gender": [ { "region": "DE", "female": true, "male": true, "unknown": true } ], "detail_fetched": true, "input_url": "https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&query_type=2", "scraped_at": "2026-12-01T12:00:00.000Z" } ], "has_more": true, "next_cursor": "ta1.eNqrVirLz0lVslIqzs_NTVWyUqrLLy0pVbJSMjQ3NjdQ0lEqSsxLSc3PU7JSMjE0MDBQ0lEqLE..." }}Bad input. The exact message varies by endpoint.
{ "success": false, "error": "…"}Balance below the endpoint’s price.
{ "error": "Insufficient credits. Buy more to scrape more.", "balance": 1, "required": 2}Invalid or unknown API key.
{ "detail": "Authentication service unavailable or invalid API key."}Throttled — wait for Retry-After.
{ "detail": "Request was throttled. Expected available in N seconds."}Sample from the live catalog; arrays trimmed to 3 items. Results are in data.ads.
Response fields
Section titled “Response fields”| Field | Type | Example | Description |
|---|---|---|---|
urls | string | https://library.tiktok.com/ads?region=all&adv… | — |
page | integer | 1 | — |
page_size | integer | 12 | — |
total | integer | 311 | — |
ads | array | [1 item] | The results. |
has_more | boolean | true | — |
next_cursor | string | ta1.eNqrVirLz0lVslIqzs_NTVWyUqrLLy0pVbJSMjQ3N… | Pass back as cursor for the next page. null on the last page. |
ads[].adId | string | 1874157948935201 | — |
ads[].adName | string | Discover the new GeForce RTX | — |
ads[].advertiserName | string | NVIDIA GmbH | — |
ads[].impressions | object | {…} | — |
ads[].paidBy | string | NVIDIA GmbH | — |
ads[].regionStats | array | [1 item] | — |
ads[].startUrl | string | https://library.tiktok.com/ads?region=all&sta… | — |
ads[].videos | array | [1 item] | — |
ads[].ad_id | string | 1874157948935201 | — |
ads[].ad_title | string | Discover the new GeForce RTX | — |
ads[].advertiser_name | string | NVIDIA GmbH | — |
ads[].advertiser_id | string | 6891503886842987266 | — |
ads[].first_shown_date | string | 2026-08-01 | — |
ads[].last_shown_date | string | 2026-08-11 | — |
ads[].region | string | DE | — |
ads[].url | string | https://library.tiktok.com/ads/detail/?ad_id=… | — |
ads[].estimated_audience | string | 10K-100K | — |
ads[].image_urls | array | [1 item] | — |
ads[].external_url | string | https://www.nvidia.com/de-de/geforce/ | — |
ads[].subject | string | Electronics | — |
ads[].advertiser_registry_location | string | Germany | — |
ads[].advertiser_tiktok_username | string | nvidiageforce_de | — |
ads[].advertiser_tiktok_followers | string | 120.5K | — |
ads[].target_audience_size | string | 7.1M-8.7M | — |
ads[].targeting_age | array | [1 item] | — |
ads[].targeting_gender | array | [1 item] | — |
ads[].detail_fetched | boolean | true | — |
ads[].input_url | string | https://library.tiktok.com/ads?region=all&adv… | — |
ads[].scraped_at | string | 2026-12-01T12:00:00.000Z | — |
Pagination
Section titled “Pagination”Pass data.next_cursor back as cursor until it is null. Required inputs are ignored once a cursor is sent. Each page is one billed call. More in Pagination.
const url = "https://api.scrapier.io/api/v2/tiktok-ads/";let params = { urls: "https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc" };const items = [];
for (let page = 0; page < 10; page++) { // each page is one billed call const res = await fetch(`${url}?${new URLSearchParams(params)}`, { headers: { "X-API-Key": "YOUR_API_KEY" }, signal: AbortSignal.timeout(210_000), }); const body = await res.json(); if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`); const data = body.data; items.push(...(data.ads ?? [])); if (!data.next_cursor) break; // null = last page params = { cursor: data.next_cursor };}import requests
URL = "https://api.scrapier.io/api/v2/tiktok-ads/"HEADERS = {"X-API-Key": "YOUR_API_KEY"}params = {"urls": "https://library.tiktok.com/ads?region=all&adv_name=NVIDIA%20GmbH&adv_biz_ids=6891503886842987266&query_type=2&sort_type=last_shown_date,desc"}items = []
for _ in range(10): # each page is one billed call resp = requests.get(URL, headers=HEADERS, params=params, timeout=210) resp.raise_for_status() data = resp.json()["data"] items.extend(data.get("ads") or []) if not data.get("next_cursor"): # None = last page break params = {"cursor": data["next_cursor"]}Errors
Section titled “Errors”Failed calls are free. Branch on the HTTP status and read the message from error (or detail). Full details in Errors.
| Status | Meaning | Retry? | Charged? |
|---|---|---|---|
400 | Bad or missing input. | No — fix the params | No |
401 / 403 | Missing, invalid or revoked API key. | No — fix the key | No |
402 | Out of credits (body has balance). | No — top up | No |
404 | Unknown endpoint slug. | No — check the slug | No |
429 / 503 | Busy or throttled. | Yes — after Retry-After | No |
5xx | Target site or upstream failure, or timeout. | Yes — with backoff | No |
- Nothing special: send the inputs, read the result.
Related
Section titled “Related”- TikTok Ad Library Leads — Structured TikTok data: every input is optional. Single lookup, 3 credits per successful call.
- TikTok Ads Top — Structured TikTok data: every input is optional. Cursor-paginated, 1 credit per successful call.
- TikTok Collection Videos — Structured TikTok data: send
urls. Cursor-paginated, 1 credit per successful call. - TikTok Comment Replies — Structured TikTok data: send
urls. Cursor-paginated, 1 credit per successful call.