InsightSocial
GET /v1/tiktok/search

TikTok Search API

Returns TikTok videos matching a keyword, each with caption, view and like counts, author details, a thumbnail, and post.ext.region (the country the video is registered to).

10–470 credits, metered · cursor pagination · failed calls free

curl "https://api.insightsocial.app/v1/tiktok/search?query=cooking+recipes" \
-H "x-api-key: $INSIGHTSOCIAL_API_KEY"
200 OKJSON
{
"success": true,
"platform": "tiktok",
"endpoint": "/v1/tiktok/search",
"schema_version": "2",
"data": {
"items": [
{
"post": {
"id": "<string>",
"url": "<string | null>",
"kind": "<string | null>",
"content": {
"text": "<string | null>",
"media_urls": "<array | null>",
"thumbnail_url": "<string | null>",
"duration_seconds": "<number | null>"
},
"author": {
"id": "<string | null>",
"username": "<string | null>",
"display_name": "<string | null>",
"avatar_url": "<string | null>",
"verified": "<boolean | null>"
},
"engagement": {
"views": "<integer | null>",
"likes": "<integer | null>",
"comments": "<integer | null>",
"shares": "<integer | null>",
"saves": "<integer | null>"
},
"flags": {
"nsfw": "<boolean | null>",
"spoiler": "<boolean | null>",
"pinned": "<boolean | null>",
"deleted": "<boolean>",
"likes_hidden": "<boolean | null>",
"comments_hidden": "<boolean | null>",
"shares_hidden": "<boolean | null>",
"views_hidden": "<boolean | null>",
"saves_hidden": "<boolean | null>"
},
"published_at": "<string | null>",
"language": "<string | null>",
"ext": "<object | null>"
}
}
]
},
"pagination": {
"next_cursor": "<string | null>",
"has_more": "<boolean>"
},
"unavailable": [],
"credits_used": "<integer>"
}

When to use it

Use it for a video keyword search you can page and sort. region= localises the request but does not filter; filter on post.ext.region for one country. limit=120 returns one page of up to 120. search/top is the Top tab.

Parameters

Query parameters for GET /v1/tiktok/search. Send your key in the x-api-key header.

NameRequiredDescription
queryYesSearch keyword or phrase to find TikTok videos
date_postedNoTime frame. TikTok's search does not reliably apply it, so it is also applied as since: videos published before the window are removed from every page, and a page can hold fewer videos. To collect many videos from a window, page with expand=true and since.
sort_byNoSort by. TikTok's search does not reliably apply it, so a page can come back in relevance order. For recent videos send since (with expand=true to keep paging), and order rows by post.published_at yourself.
regionNoTwo-letter country code (ISO 3166-1 alpha-2) that localises the results. It does not filter the page to that country. Each row already carries post.ext.region, the country the video is registered to; filter on that leaf when you need only one country.
cursorNoCursor to get more videos. Get 'cursor' from previous response. Ignored when limit is above 30: that call is a single page.
limitNoA limit of 30 or less returns the first limit rows of the normal page; next_cursor still steps the whole page of about 30, so the rest of that page is skipped. A limit above 30 selects the bulk labeled page: up to 120 videos in one call, each with post.ext.region. The value rounds up to the next multiple of 30 (60, 90 or 120). date_posted and sort_by apply on the bulk page too. TikTok can repeat a video; repeats are removed, so a 120 page is often a little under 120 unique videos. Does not filter by country; drop rows yourself on post.ext.region.
expandNoSend true to keep paging past TikTok's own limit for one query, which ends a walk at about 200 to 400 videos. When your ranking runs out, the walk continues with TikTok's related searches for your query that contain every word of it (for coffee: iced coffee at home, coffee cold brew recipe) and then with the other two rankings, each to its end, keeping your date_posted and region. A video can come up again on a later step, so deduplicate on post.id. Rows after your own ranking are not in your sort_by order.
includeNoexact_counts: exact counts on the first 10 rows in one round, about 9 s however many, +1 a row made exact.
sinceNoOnly rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Rows older than it are left off each page. This list is not in date order, so the walk does not stop at the date: keep following next_cursor, and each page costs what a page costs even when every row on it is filtered out. A row with no date is kept.
untilNoOnly rows published on or before this date: YYYY-MM-DD (that whole UTC day is included) or an ISO 8601 timestamp. Newer rows are left off each page and the walk does not stop, so older pages follow. A row with no date is kept.
min_viewsNoKeep only rows with at least this many views (post.engagement.views). A row whose view count is unknown is discarded, so every returned row meets the floor.
max_age_daysNoKeep only rows published within this many days (post.published_at), 1 to 3650. A row with no date is discarded.
countryNoComma-separated two-letter ISO 3166-1 codes, for example US,GB. Keep only videos TikTok registers to one of these countries (post.ext.region); a row with no country is discarded. This filters rows; it does not change where the search runs (that is region).
exclude_countryNoComma-separated two-letter ISO 3166-1 codes, for example IN. Discard videos TikTok registers to any of these countries (post.ext.region); a row with no country is kept.
sort_rowsNoviews: orders the kept rows by view count, highest first. Rows without a view count go last. newest: orders the kept rows by publish date, newest first. Rows without a date go last. The sort covers only the rows this call collected over the pages it walked, not the whole feed. Every collected row is returned. A call that resumes from pagination.next_cursor sorts its own rows and does not merge them with the earlier ones.
max_pagesNo1 to 50 (default 1). Walk up to this many pages in one call and return the rows from all of them (after any filter).
max_age_sNoThe oldest cached copy you accept, in seconds. A copy that old or younger is served, with its age in age_s and the X-Cache-Age header. Without it a copy up to 120 seconds old is served. A lower value fetches fresh (billed) when the copy is older, and 0 always fetches live, like Cache-Control: no-cache.

Response fields

The same unified schema every typed endpoint returns, so code written for TikTok reads the other platforms too. A field the platform did not provide is null and listed in unavailable.

FieldTypeNotes
idstringAn identifier, always a string. Never parse it as a number: several platforms use ids above 2^53.
urlstring | null
kindstring | nullThe format of the post. Format words only, never a platform name. short = short-form vertical video (a reel, a TikTok, a YouTube Short).
content.textstring | null
content.media_urlsarray | null
content.thumbnail_urlstring | null
content.duration_secondsnumber | null
author.idstring | null
author.usernamestring | null
author.display_namestring | null
author.avatar_urlstring | null
author.verifiedboolean | null
engagement.viewsinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.likesinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.commentsinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.sharesinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.savesinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
flags.nsfwboolean | null
flags.spoilerboolean | null
flags.pinnedboolean | null
flags.deletedboolean
flags.likes_hiddenboolean | null
flags.comments_hiddenboolean | null
flags.shares_hiddenboolean | null
flags.views_hiddenboolean | null
flags.saves_hiddenboolean | null
published_atstring | nullISO-8601 timestamp in UTC, ending in Z.
languagestring | nullThe content's language as the platform states it, e.g. en, pt-BR. Detected languages come later (§7.1).
extobject | nullPlatform-specific fields, snake_case.

Every field, error and example is in the TikTok Search API reference.

How much does the TikTok Search API cost?

Metered: 10–470 credits a call. The ceiling is reserved when the call starts and you are charged what it actually read.

  • Failed calls are free

    A call that errors or finds nothing costs 0 credits.

  • Know the price first

    Add dry_run=1 and the response quotes the call without making it. Nothing is charged.

  • One balance

    API calls and Chrome extension exports share the same credits, on the free plan too.

TikTok Search API: frequently asked questions

Send GET /v1/tiktok/search with the query parameter and your key in the x-api-key header. Returns TikTok videos matching a keyword, each with caption, view and like counts, author details, a thumbnail, and post.ext.region (the country the video is registered to).