TikTok Ads Top
Structured TikTok data: every input is optional. Cursor-paginated, 1 credit per successful call.
Overview
Section titled “Overview”Call GET /api/v2/tiktok-ads-top/. The results are in data.items; send data.next_cursor back as cursor to get the next page. 10 optional parameters refine the call (see Parameters).
Request
Section titled “Request”curl -G "https://api.scrapier.io/api/v2/tiktok-ads-top/" \ -H "X-API-Key: YOUR_API_KEY" \ --max-time 210const params = new URLSearchParams({});
const res = await fetch(`https://api.scrapier.io/api/v2/tiktok-ads-top/?${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.items);import requests
resp = requests.get( "https://api.scrapier.io/api/v2/tiktok-ads-top/", headers={"X-API-Key": "YOUR_API_KEY"}, params={}, timeout=210,)body = resp.json()if not resp.ok: raise RuntimeError(body.get("error") or body.get("detail"))
print(body["data"]["items"])curl -X POST "https://api.scrapier.io/api/v2/tiktok-ads-top/" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' \ --max-time 210Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
X-API-Key header | string | yes | — | Your API key from the dashboard. |
keyword | string | no | — | Optional search term (login-gated by TikTok: echoed, not applied). Each call returns one leaderboard partition (<=20 ads); pass next_cursor to walk deeper into the same filter combination. |
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. |
country | string | no | US | ISO-2 country code, validated live against TikTok's top_ads country list. |
period | integer | no | 180 | Leaderboard lookback window in days. 730180 |
order_by | string | no | for_you | Leaderboard ranking axis. for_youimpressionctrplay_2s_rateplay_6s_ratecvrlike |
ad_format | string | no | All ad types | Ad format filter. All ad typesSpark adsNon-Spark ads |
ad_language | string | no | en | Ad language code. |
like_tier | integer | no | — | Engagement-tier bucket (1 = top tier). |
industry | string | no | Skincare | Industry label, matched live. |
max_items | integer | no | 20 | Ads per page (values >20 clamp to 20 = one TikTok leaderboard partition). Follow next_cursor for more; the pool is a few hundred ads for broad filters. |
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": { "keyword": null, "country": "US", "period": 180, "order_by": "for_you", "ad_format": 0, "ad_language": "en", "like_tier": null, "industry": "Skincare", "success": true, "error": null, "warnings": [], "warning": null, "items": [ { "post": { "id": "7160811838573182977", "url": "https://ads.tiktok.com/business/creativecenter/topads/7160811838573182977/pc/en?countryCode=US&period=180", "content": { "text": "You take pride in your work. But let's face it - using subpar wax can ruin even the best intentions.", "media_urls": "https://v16m-default.tiktokcdn.com/.../video/tos/alisg/tos-alisg-ve-0051c001-sg/....mp4", "thumbnail_url": "https://p16-common-sign.tiktokcdn.com/....image", "duration_seconds": 51.2 }, "author": { "username": "honeycombwaxco", "display_name": "honeycombwaxco", "avatar_url": null, "verified": false }, "engagement": { "views": null, "likes": 19757, "comments": 125, "shares": 82, "saves": null }, "flags": { "nsfw": null, "spoiler": null, "pinned": null, "deleted": false }, "published_at": null, "ext": { "ad": { "ctr": 0.07, "rank": 1, "cost_score": 2, "like_tier": null, "industry": "Skincare", "objective": "campaign_objective_conversion", "is_spark_ad": null, "ad_format": null, "language": "en", "country_code": "US", "period_days": 180, "video_id": "v10033g50000cdg4vn3c77u4nq4b21ig", "video_url_540p": null, "video_url_360p": null, "landing_page_url": null, "order_by": "for_you", "detail_fetched": true } } }, "computed": { "engagement_rate": null, "language": "en", "content_category": "beauty", "estimated_reach": null } } ], "returned_count": 3, "total_count": 381, "dropped": 0, "detail_missing": 0, "has_more": true, "scraped_at": "2026-09-23T09:30:00.000Z", "next_cursor": "eyJiIjoi...base64 Bloom filter + locked filters + slot index (~1.2KB)...In0" }}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.items.
Response fields
Section titled “Response fields”| Field | Type | Example | Description |
|---|---|---|---|
keyword | null | null | — |
country | string | US | — |
period | integer | 180 | — |
order_by | string | for_you | — |
ad_format | integer | 0 | — |
ad_language | string | en | — |
like_tier | null | null | — |
industry | string | Skincare | — |
success | boolean | true | — |
error | null | null | — |
warnings | array | [] | — |
warning | null | null | — |
items | array | [1 item] | The results. |
returned_count | integer | 3 | — |
total_count | integer | 381 | — |
dropped | integer | 0 | — |
detail_missing | integer | 0 | — |
has_more | boolean | true | — |
scraped_at | string | 2026-09-23T09:30:00.000Z | — |
next_cursor | string | eyJiIjoi...base64 Bloom filter + locked filte… | Pass back as cursor for the next page. null on the last page. |
items[].post | object | {…} | — |
items[].computed | object | {…} | — |
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-top/";let params = {};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.items ?? [])); if (!data.next_cursor) break; // null = last page params = { cursor: data.next_cursor };}import requests
URL = "https://api.scrapier.io/api/v2/tiktok-ads-top/"HEADERS = {"X-API-Key": "YOUR_API_KEY"}params = {}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("items") 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 |
- The response data carries its own
successfield from the scraper. The outersuccessis what counts: an HTTP 200 with outersuccess: trueis billed, even if the inner field says otherwise.
Related
Section titled “Related”- TikTok Ad Library Leads — Structured TikTok data: every input is optional. Single lookup, 3 credits per successful call.
- TikTok Ad Library — Structured TikTok data: send
urls. 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.