querystringrequired
Search query (advertiser name or keyword)
https://api.sandbase.ai/v1/api/tiktok-ads-library/search-adsSearch the TikTok Ad Library for ads matching a query (advertiser name or keyword).
Your output will appear here
Complete the inputs, then click Run.
Search the TikTok Ad Library for ads matching a query (advertiser name or keyword).
curl -X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "tiktok-ads-library/search-ads", "limit": 12, "query": "nike", "offset": 0, "region": "all", "sort_by": "last_shown_date,desc", "search_id": ""}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query (advertiser name or keyword) |
end_time | integer | No | End of date range as Unix timestamp (seconds). Defaults to now. |
limit | integer | No | Number of results per page (max 50) |
offset | integer | No | Pagination offset (0-based). Requires search_id from a previous response for values > 0. |
region | string | No | Region/country code filter (e.g. 'FR', 'DE', 'GB') or 'all' for all regions. Use get_supported_regions for the full list of accepted codes. One of: all, FR, DE, GB. |
search_id | string | No | Search ID returned from a previous search_ads call. Required when offset > 0 to paginate through results. |
sort_by | string | No | Sort order: 'last_shown_date,desc' or 'last_shown_date,asc' One of: last_shown_date,desc, last_shown_date,asc. |
start_time | integer | No | Start of date range as Unix timestamp (seconds). Defaults to 1 year ago. |
Flat $0.06 per call. Failed calls are not charged.
Start building
Platform API endpoint with unified authentication and usage tracking.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/api/tiktok-ads-library/search-ads" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"limit": 12,
"query": "nike",
"offset": 0,
"region": "all",
"sort_by": "last_shown_date,desc",
"search_id": ""
}
SANDBASE_JSON
)
printf '%s\n' "$result"Set your SandBase API key in your server environment. Requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep your key on the server. Do not expose it in browser code.
querystringrequiredSearch query (advertiser name or keyword)
limitintegerNumber of results per page (max 50)
Default: 12
offsetintegerPagination offset (0-based). Requires search_id from a previous response for values > 0.
Default: 0
regionstringRegion/country code filter (e.g. 'FR', 'DE', 'GB') or 'all' for all regions. Use get_supported_regions for the full list of accepted codes.
Default: "all"
Possible values: all, FR, DE, GB
sort_bystringSort order: 'last_shown_date,desc' or 'last_shown_date,asc'
Default: "last_shown_date,desc"
Possible values: last_shown_date,desc, last_shown_date,asc
end_timeintegerEnd of date range as Unix timestamp (seconds). Defaults to now.
search_idstringSearch ID returned from a previous search_ads call. Required when offset > 0 to paginate through results.
start_timeintegerStart of date range as Unix timestamp (seconds). Defaults to 1 year ago.
Saved example response for this API; no live request is made when viewing it.
No saved response has been published. Run the API in Playground to inspect its response.
Explore more
| API | Price | Response |
|---|---|---|
TikTok Ads Library Search AdsThis API TikTok Ads Library | $0.06 per call | JSON |
TikTok Ads Library | $0.03 per call | JSON |
TikTok Ads Library | $0.03 per call | JSON |
Questions
Send a POST request to https://api.sandbase.ai/v1/api/tiktok-ads-library/search-ads with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.
$0.06 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.
Required: query (string). Optional: limit (integer), offset (integer), region (one of all, FR, DE, GB), sort_by (one of last_shown_date,desc, last_shown_date,asc), end_time (integer) and search_id (string) and 1 more. The Parameters table and the Playground on this page list every field.
A JSON response returned in the same HTTP request (synchronous).
No. TikTok Ads Library Search Ads runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for TikTok Ads Library API access separately.