Saltar para o conteúdo principal
POST
Search TikTok ads

Autorizações

Authorization
string
header
obrigatório

Your API key, sent as Authorization: Bearer <key>.

Cabeçalhos

Prefer
string

wait=<seconds> holds the request at most that long, up to 290. wait=0 answers with the task id at once and queues the task when every concurrency slot is taken.

Exemplo:

"wait=120"

Corpo

application/json
country
enum<string>
obrigatório

The country whose ads the library lists, as an ISO 3166-1 alpha-2 code. meta_ad_library: ALL for every country; US by default on search and advertisers, ALL on ad and advertiser, where it picks the reach and targeting the library shows. google_ads_transparency and linkedin_ad_library: ALL for every country, which is the default; search only. tiktok_ad_library: required, one of the 34 regions of the library on every action. tiktok_creative_center: required on search, one of 28 countries.

Opções disponíveis:
AT,
BE,
BG,
BR,
CH,
CY,
CZ,
DE,
DK,
EE,
ES,
FI,
FR,
GB,
GR,
HR,
HU,
IE,
IS,
IT,
LI,
LT,
LU,
LV,
MT,
NL,
NO,
PL,
PT,
RO,
SE,
SI,
SK,
TR
query
string
obrigatório

meta_ad_library search: the words to find in the ads, required unless pageId is set, and required with pageIds. advertisers: the advertiser's name as its Facebook page writes it (Meta), as the advertiser is named (Google, up to 100 characters) or the start of its name (TikTok). linkedin_ad_library search: a keyword in the ad's text. tiktok_ad_library search: a keyword in the ad's text, hashtags and advertisers, in the library's order of relevance. tiktok_creative_center search: a keyword.

Minimum string length: 1
advertiserName
string
obrigatório if sortBy is set

linkedin_ad_library search: the advertiser's name, matched as part of the name. tiktok_ad_library search: the advertiser's exact name, as advertisers returns it; sent instead of query.

Minimum string length: 1
limit
integer

search: how many ads to return, 30 by default, at most 500 on meta_ad_library and google_ads_transparency, 120 on linkedin_ad_library, 300 on tiktok_ad_library and 200 on tiktok_creative_center; with details at most 100 on google_ads_transparency and tiktok_creative_center, 60 on tiktok_ad_library and 50 on linkedin_ad_library. Every 30 ads cost 0.5 credits. google_ads_transparency advertisers: how many advertisers, 1 to 50, 30 by default.

Intervalo necessário: 1 <= x <= 300
cursor
string

search: the nextCursor of an earlier response, sent with the same search, to read the ads after it. A cursor sent with a different search (another query, advertiser, country or filter) is rejected with 400 VALIDATION_ERROR.

activeStatus
enum<string>

meta_ad_library search: active ads by default. The library lists running ads of every advertiser and country; ads that stopped running are kept only if they were delivered in the EU or the UK (about one year after they stop) or are about social issues, elections or politics (about seven years). To keep a competitor's history elsewhere, search its active ads on a schedule and store them. tiktok_ad_library search: all ads by default.

Opções disponíveis:
active,
inactive,
all
mediaType
enum<string>

search: every format by default. meta_ad_library: all, image, meme, image_and_meme, video or none. google_ads_transparency: all, text, image or video. tiktok_ad_library: all, video or image.

Opções disponíveis:
all,
video,
image
startDate
string<date>

search: keeps the ads shown on or after this day (YYYY-MM-DD). google_ads_transparency and linkedin_ad_library: sent with endDate; linkedin_ad_library takes the last year only. tiktok_ad_library: the last 365 days by default.

endDate
string<date>

search: keeps the ads shown on or before this day (YYYY-MM-DD).

sortBy
enum<string>

search. meta_ad_library: the library's order, most impressions first, by default (impressions_high_to_low, most_recent, or impressions_low_to_high with adType political_and_issue_ads). linkedin_ad_library: newest (default) or oldest. tiktok_ad_library: with advertiserName only; published_desc (default), published_asc, last_shown_desc, last_shown_asc, impressions_desc or impressions_asc. tiktok_creative_center: for_you (default), impression, ctr, play_2s_rate, play_6s_rate, cvr or like.

Opções disponíveis:
published_desc,
published_asc,
last_shown_desc,
last_shown_asc,
impressions_desc,
impressions_asc
details
boolean

search on google_ads_transparency, linkedin_ad_library, tiktok_ad_library and tiktok_creative_center: true reads every ad the search returns in detail, as ad does, and returns the ads with their landing link, payer, dates, impressions, targeting and full text where the library publishes them. false by default. Each ad has detailStatus and the response detailedCount. limit is at most 100 on google_ads_transparency and tiktok_creative_center, 60 on tiktok_ad_library and 50 on linkedin_ad_library. 0.5 credits for every 5 ads read, on top of 0.5 credits for every 30 ads returned. meta_ad_library does not take it.

idempotencyKey
string

Optional. A repeat of the key within at least 30 days answers with the task that holds it, so a caller that hung up can ask again.

priority
integer
padrão:1

Compatibility field; does not guarantee execution order. Values outside 1–10 are clamped, not rejected.

Intervalo necessário: 1 <= x <= 10
webhook
object

Optional. Omit to collect the result by polling instead.

Resposta

The task ended: the body GET /v1/async/task/{id} returns, with the result in response or the reason in error.

success
boolean
obrigatório
task
object
obrigatório
credits
object
obrigatório

Credits, with up to two decimals (for example 1.25). The submit response always shows 0: nothing is charged yet, and the task's price is held from your balance when it starts. Polling shows 0 until the task is terminal, then the settled charge: the task's price for COMPLETED, 0 for FAILED. A task webhook reports the same charge in creditsCharged; on a FAILED task it reports the task's price in creditsToCharge and 0 in creditsCharged. CITATION_ANALYSIS, GOOGLE_PLACES and GOOGLE_NEWS are charged by usage, up to the hold placed when the task starts.

response
object

The engine-specific result. Absent until the task is terminal. See the Engines guide for per-engine shapes. NAVER_AI_TAB preserves the original text, markdown, sources and cards when Naver returns HTTP success, a valid stream ending in done, and nonempty answer text with unknown_error. It includes upstreamError and returns immediately without retrying or rephrasing, even with retryQuery. COMPLETED means collection finished; the answer may still be incomplete. Empty, cut-off or malformed streams still fail. Policy refusals complete with a policy_declined notice. rawContent is returned only with include.rawResponse. With include.citationAnalysis, answer results also carry citationAnalysis (see Include). CITATION_ANALYSIS returns CitationAnalysisResult; see the Citation Analysis guide. PROMPT_RESEARCH returns PromptResearchResult; see the Prompt Research guide. GEO_SCORE returns GeoScoreResult; see the GEO Score guide. Answer engines with include.analysis add analysis (AnswerAnalysis).

error
string

Present when task.status is FAILED. A plain string, not the {code, message, timestamp} object used by request-level errors.