TikTok Ads Library API
advertiser_id alone is no longer supported.
TikTok's Ads Library API requires both the advertiser's ID and name to filter ads correctly.
Pass advertiser_token (recommended) or advertiser_id together with the advertiser's name via q.
The TikTok Ads Library API returns detailed information about TikTok advertisements, including the ad position, unique ID, advertiser name, date range when the ad was shown, video and cover image links, and estimated audience reach.
API Parameters
Search Params
-
- Name
-
q - Required
- Optional
- Description
-
Defines the keyword for your search. Use this parameter to search for ads containing specific keywords or phrases.
If you want to search for exact match, use
""to enclose the keyword.
-
- Name
-
advertiser_token - Required
- Optional
- Description
-
Filters ads by an advertiser. A token that bundles an advertiser's ID and name in a single parameter.
Can be found in the response of this API, the TikTok Ads Library Advertiser Search API and the TikTok Ads Library Ad Details API. Recommended overadvertiser_id, since the TikTok Ads Library needs both the ID and the name to filter ads correctly.
-
- Name
-
advertiser_id - Required
- Optional
- Description
-
Filters ads by an advertiser. Must be passed alongside the advertiser's name via the
qparameter, otherwise the TikTok Ads Library returns unrelated ads. Preferadvertiser_token, which bundles both into one parameter.
Can be found in the response of this API, the TikTok Ads Library Advertiser Search API and the TikTok Ads Library Ad Details API.
Localization
-
- Name
-
country - Required
- Optional
- Description
-
Specifies the country for your search. The default value is
ALL. Check the full list of supported TikTok Ads Library countries.
Filters
-
- Name
-
time_period - Required
- Optional
- Description
-
Specifies the date range for ads. Use the format
YYYY-MM-DD..YYYY-MM-DDto define a custom date range.
If not specified, defaults to the last year from the current date.
-
- Name
-
sort_by - Required
- Optional
- Description
-
Specifies the sorting order for ads. Supported values:
last_shown_date_newest_to_oldestlast_shown_date_oldest_to_newestpublished_date_newest_to_oldestpublished_date_oldest_to_newestunique_users_seen_low_to_highunique_users_seen_high_to_low
last_shown_date_newest_to_oldest.
Pagination
-
- Name
-
next_page_token - Required
- Optional
- Description
-
A token for fetching the next set of results. You can obtain this token from the
next_page_tokenfield in the previous response
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
tiktok_ads_library.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Full Response using q parameter
https://www.searchapi.io/api/v1/search?engine=tiktok_ads_library&q=apple
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "tiktok_ads_library",
"q": "apple"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_BxR6dazVoAVkFwdA3Ewvbj9G",
"status": "Success",
"created_at": "2025-07-30T16:35:06Z",
"request_time_taken": 1.48,
"parsing_time_taken": 0.02,
"total_time_taken": 1.5,
"request_url": "https://library.tiktok.com/ads?region=all&start_time=1722290400000&end_time=1753826400000&sort_type=last_shown_date%2Cdesc&adv_name=apple&adv_biz_ids=&query_type=1",
"html_url": "https://www.searchapi.io/api/v1/searches/search_BxR6dazVoAVkFwdA3Ewvbj9G.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_BxR6dazVoAVkFwdA3Ewvbj9G"
},
"search_parameters": {
"engine": "tiktok_ads_library",
"q": "apple",
"country": "all",
"time_period": "2024-07-30..2025-07-30",
"page": 1
},
"search_information": {
"total_results": 1000
},
"ads": [
{
"position": 1,
"id": "1812446344339457",
"advertiser": "Raiffeisen Schweiz Genossenschaft ",
"first_shown_datetime": "2024-10-22T02:00:00+02:00",
"last_shown_datetime": "2025-07-29T02:00:00+02:00",
"video_link": "https://library.tiktok.com/api/v1/cdn/1753893314/video/aHR0cHM6Ly92MTZtLnRpa3Rva2Nkbi5jb20vYTBlM2VkODQyMmY5YzRjMWMxYzgyMjJlOTJhNzk4MzgvNjg4YTllMmMvdmlkZW8vdG9zL3VzZWFzdDJhL3Rvcy11c2Vhc3QyYS12ZS0wMDUxYzc5OS1ldXR0cC9vVWRHYk9qWERNcElHamlzREFJZmZEdWVUVERBRExRR0ZtZ0NzUi8=/b0947524-2c2a-4955-9849-9f92048cc70e?a=475769&bti=PDU2NmYwMy86&ch=0&cr=0&dr=1&cd=0%7C0%7C0%7C0&cv=1&br=284&bt=142&cs=0&ds=1&ft=.NpOcInz7Thh.RPKXq8Zmo&mime_type=video_mp4&qs=0&rc=O2U2aTpnOjU6NzhmOWY2aUBpM3c6PHE5cm08djMzODYzNEAzMjIuXy1jX2IxMTYzX2EuYSNmYW1xMmRzLjBgLS1kMC1zcw%3D%3D&vvpl=1&l=202507310035132CF6ACABA9D84F95D549&btag=e000b0000&cc=3",
"cover_image": "https://p21-ad-sg.ibyteimg.com/origin/tos-alisg-p-0051c001-sg/oAeOSmbgGAGDTNfIcGLuTIV5DsYpQACDRfAgXA",
"estimated_audience": "100K-200K",
"estimated_audience_min": 100000,
"estimated_audience_max": 200000
},
...
],
"pagination": {
"next_page_token": "eyJzZWFyY2hfaWQiOiIyMDI1MDczMTAwMzUxMzJDRjZBQ0FCQTlEODRGOTVENTQ5Iiwib2Zmc2V0IjoxfQ=="
}
}
Full Response using advertiser_token parameter
https://www.searchapi.io/api/v1/search?advertiser_token=eyJpZCI6IjY5NTI0MjM2NzE4NTE5MDk4ODkiLCJuYW1lIjoiTElETCBST01BTklBIFNSTCJ9&engine=tiktok_ads_library
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "tiktok_ads_library",
"advertiser_token": "eyJpZCI6IjY5NTI0MjM2NzE4NTE5MDk4ODkiLCJuYW1lIjoiTElETCBST01BTklBIFNSTCJ9"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_Rz4KNQmOp60YHL67oyWl8DBv",
"status": "Success",
"created_at": "2025-07-30T16:43:08Z",
"request_time_taken": 1.64,
"parsing_time_taken": 0.02,
"total_time_taken": 1.66,
"request_url": "https://library.tiktok.com/ads?region=all&start_time=1722290400000&end_time=1753826400000&sort_type=last_shown_date%2Cdesc&adv_name=LIDL+ROMANIA&adv_biz_ids=6952423671851909889&query_type=2",
"html_url": "https://www.searchapi.io/api/v1/searches/search_Rz4KNQmOp60YHL67oyWl8DBv.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_Rz4KNQmOp60YHL67oyWl8DBv"
},
"search_parameters": {
"engine": "tiktok_ads_library",
"advertiser_token": "eyJpZCI6IjY5NTI0MjM2NzE4NTE5MDk4ODkiLCJuYW1lIjoiTElETCBST01BTklBIFNSTCJ9",
"country": "all",
"time_period": "2024-07-30..2025-07-30",
"page": 1
},
"search_information": {
"total_results": 254
},
"ads": [
{
"position": 1,
"id": "1833536575637633",
"advertiser_id": "6952423671851909889",
"advertiser": "LIDL ROMANIA SRL",
"advertiser_token": "eyJpZCI6IjY5NTI0MjM2NzE4NTE5MDk4ODkiLCJuYW1lIjoiTElETCBST01BTklBIFNSTCJ9",
"first_shown_datetime": "2025-06-02T02:00:00+02:00",
"last_shown_datetime": "2025-07-29T02:00:00+02:00",
"video_link": "https://library.tiktok.com/api/v1/cdn/1753893795/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS9lY2RiYzAzOTM2NTZmYTQwNDA0ZWU2MDcyZTEwZTZjZS82ODhhYTAxMS92aWRlby90b3MvdXNlYXN0MmEvdG9zLXVzZWFzdDJhLXZlLTAwNTFjNzk5LWV1dHRwL29jMWFna1BxUUVwdGZnUUJYOG9EeURFQk9JcTJRT2JmZ0FDRlpOLw==/7ca93baa-af9f-49c3-a5b9-df8d2d1275be?a=475769&bti=PDU2NmYwMy86&ch=0&cr=0&dr=1&cd=0%7C0%7C0%7C0&cv=1&br=556&bt=278&cs=0&ds=1&ft=.NpOcInz7ThFzRPKXq8Zmo&mime_type=video_mp4&qs=0&rc=MzQ7PDZlNTU3ZDNnZWg5OUBpamt4bnU5cjVxMzMzODYzNEAyYWI2LzJfX2ExYl5jLS1iYSNrMzMtMmRrZXBhLS1kMC1zcw%3D%3D&vvpl=1&l=202507310043157D8DDBE7F2F4F59C20BB&btag=e000b0000&cc=13",
"cover_image": "https://p21-ad-sg.ibyteimg.com/origin/tos-alisg-p-0051c001-sg/oUpyaCgES2NtBQDIWBFoAeZDgqQt8BsCfXODOk",
"estimated_audience": "600K-700K",
"estimated_audience_min": 600000,
"estimated_audience_max": 700000
},
...
],
"pagination": {
"next_page_token": "eyJzZWFyY2hfaWQiOiJleUpzWVhOMFgzTnZjblFpT2xzeE56VTBNalkxTmpBd0xDSXpOamM0TkRrNE56Z3pNRGMwTkRBMUlsMHNJbTVsZUhSZlkzVnljMjl5SWpveE1uMD0iLCJvZmZzZXQiOjF9"
}
}