Skip to main content
POST
TikTok Top Ads Search

Authorizations

Authorization
string
header
default:YOUR_ANYAPI_KEY
required

Your AnyAPI key as a Bearer token.

Headers

Idempotency-Key
string

Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.

Required string length: 1 - 255

Query Parameters

fields
string

Optional. Comma-separated keys (dotted paths like author.name descend into nested objects) to keep on each result item. Keys are matched relative to each result item after the data/items envelope is unwrapped, not against the top-level response envelope, so use jq to reshape the whole envelope. Shrinks the response without changing cost.

max_items
integer

Optional. Cap the number of result rows returned; a _truncated note reports how many were withheld so you can page via the API's own limit. Does not change cost.

Required range: x >= 0
summary
boolean

Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost.

jq
string

Optional. A jq expression applied to the result envelope; its output replaces output (multiple outputs collect into an array). Reshape freely, e.g. jq=.data | {title, description, md: .markdown[:3500]}. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a jqError. Does not change cost.

Body

application/json
query
string
required

Keyword to search in TikTok Creative Center top video ads.

Minimum string length: 1
adLanguage
enum<string>
default:en

Language code for returned ads (default en).

Available options:
en,
es,
ar,
vi,
th,
de,
id,
pt,
fr,
ms,
nl,
ja,
it,
ro,
zh-Hant,
ko
limit
integer
default:20

Maximum number of ads requested for this page, from 1 through 20 (default 20).

Required range: 1 <= x <= 20
objective
enum<string>
default:traffic

Campaign objective filter (default traffic).

Available options:
traffic,
app_installs,
conversions,
video_views,
reach,
lead_generation,
product_sales
orderBy
enum<string>
default:for_you

Result ordering: Creative Center recommendations or like count (default for_you).

Available options:
for_you,
likes
page
integer
default:1

One-based provider page number (default 1).

Required range: x >= 1
performanceRank
enum<string>
default:top_1_20

Ad performance percentile bucket, where top_1_20 is the highest-performing 20 percent (default top_1_20).

Available options:
top_1_20,
top_21_40,
top_41_60,
top_61_80
period
enum<integer>
default:180

Lookback period in days (default 180).

Available options:
7,
30,
180
region
string
default:US

Country code used to select the Creative Center market (default US).

Response

Normalized result.

costUsd
number
required

USD charged on the original run. On a replay this value is echoed for parity; the replay itself is free.

items
integer
required

Number of result rows returned. For per-result SKUs the per-item cost is charged against this count; for input-priced SKUs the charge is per submitted input, independent of this count.

output
TikTok Top Ads Search output · object | null
required

Normalized output, or null when the replay payload was not retained.

provider
string
required

Always "AnyAPI".

replayed
boolean
required

True when this response replays the durable result of an earlier run without billing or upstream execution.

hint
string

Optional one-line nudge, absent when there is nothing to say. large_result: suggests the fields/max_items/summary/jq controls for a big response. paging_unavailable: means this result came from a source that cannot return a nextCursor, so it may be INCOMPLETE and cannot be continued - re-run with requireCursor: true to be served only by a source that can page, which may cost more per request.

jqError
string

Present only when a jq expression failed; output then carries the full unshaped result and this explains why the reshape did not apply.

resultId
string

Opaque handle to the full unshaped result, cached ~15 min. Re-shape it for free (fields/max_items/summary/jq) via GET /v1/results/{id}, no re-billing. Absent when the result was too large to cache.