TikTok Ads Scraper API
The TikTok Ads Scraper API lets you search and extract ad listings from TikTok's Ad Library by keyword or advertiser ID. Filter by country, date range, and sort order. Each successful request costs 5 API credits.
Endpoint:
https://api.scrapingdog.com/tiktok/adsAPI Parameters
π
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard.
Type: String
π
Search
queryOptionalThe keyword you want to search for on TikTok Ads.
Type: Stringadvertiser_idOptionalThe unique advertiser ID to search for ads from a specific advertiser. Used together withquery_type=2.
Type: Stringquery_typeOptionalType of search.1for keyword search (default),2for advertiser ID search.
Type: String
π
Geographic Location and Localization
countryOptionalThe parameter specifies the country you want to search from.
Default Value -all
Type: String
β
οΈ Filters
time_periodOptionalCustom date range inYYYY-MM-DD..YYYY-MM-DDformat. Defaults to the past 12 months.
Type: Stringsort_byOptionalSort order for results. Options:last_shown_date_newest_to_oldest(default),last_shown_date_oldest_to_newest,published_date_newest_to_oldest,published_date_oldest_to_newest,unique_users_seen_low_to_high,unique_users_seen_high_to_low.
Type: String
π
Pagination
next_page_tokenOptionalToken used to fetch the next page of results. Use thenext_page_tokenvalue from the previous response.
Type: String
API Examples
Code to Integrate
curl "https://api.scrapingdog.com/tiktok/ads?api_key=APIKEY&query=Nike"
import requests params = { "api_key": "APIKEY", "query": "Nike", "country": "us", "sort_by": "last_shown_date_newest_to_oldest" } response = requests.get("https://api.scrapingdog.com/tiktok/ads", params=params) data = response.json() for ad in data["ads"]: print(ad["name"], "-", ad["type"])
const params = new URLSearchParams({ api_key: "APIKEY", query: "Nike", country: "us", sort_by: "last_shown_date_newest_to_oldest" }); const res = await fetch(`https://api.scrapingdog.com/tiktok/ads?${params}`); const data = await res.json(); console.log(`Total ads: ${data.total}`);
<?php $url = 'https://api.scrapingdog.com/tiktok/ads?' . http_build_query([ 'api_key' => 'APIKEY', 'query' => 'Nike', 'country' => 'us', ]); echo file_get_contents($url);
API Response
{
"code": 0,
"total": 1000,
"has_more": true,
"search_id": "7380123456789012345",
"next_page_token": "AQHwF2s...",
"ads": [
{
"id": "7380123456789012345",
"name": "Nike Summer Sale 2024",
"audit_status": "approved",
"type": "video",
"first_shown_date": "2024-06-01",
"last_shown_date": "2024-06-30",
"videos": [
{
"video_url": "https://p16-sign.tiktokcdn.com/...",
"cover_img": "https://p16-sign.tiktokcdn.com/..."
}
],
"image_urls": [],
"estimated_audience": "1M - 5M",
"spent": "10K - 50K",
"impression": "5M - 10M",
"show_mode": "standard",
"rejection_info": null,
"sor_audit_status": "approved"
}
]
}