Skip to Content

TikTok Keyword Search

Start an asynchronous TikTok keyword search task and return a task_id immediately. Poll GET /tiktok/search/{task_id} for cursor-paginated results. Results are retained for ~1 hour.

Results are returned sorted by published_at descending (newest first) across pagination, full retrieval, and the signed download_url payload, unless sort_by is set, in which case that order is kept.

The search returns TikTok's results for country (default gb); us is rejected because TikTok asks US visitors to log in.

parallel_search_slices: by default (1), the search runs a single paginated query chain and is naturally capped at roughly 115-140 items by TikTok. Setting parallel_search_slices to 2..4 runs that many concurrent chains in parallel and dedups by video id, lifting the effective ceiling. Extra slices add the most on searches without a date window; with published_within set, every slice searches the same window and can return largely the same videos. parallel_search_slices is not a time filter — use published_within, after_datetime or before_datetime for time windows.

Usage disclosure: this endpoint does not accept include_usage; pass include_usage=true on GET /tiktok/search/{task_id} once task_status=completed.

POST
/tiktok/search

Start an asynchronous TikTok keyword search and get a task_id back immediately.

Overview

This endpoint runs an actual keyword search across TikTok (not a single profile) and returns multiple matching videos. It is asynchronous: the search runs in a background worker, and you poll GET /tiktok/search/{task_id} for cursor-paginated results. Results are retained for ~1 hour.

Results are returned sorted by published_at descending (newest first) across pagination, full retrieval, and the signed download_url payload — unless you set sort_by, in which case that order is kept.

Results are localized to country (default gb): pass fr, de, jp, ... to get the TikTok results of that country. us is not supported, because TikTok asks US visitors to log in before searching.

This is different from the TikTok Profile scrape, which walks a single account's videos, and from TikTok LIVE Search, which finds LIVE rooms broadcasting now. Use this endpoint to discover videos across TikTok by keyword.

Billing

Charges happen in the background worker and are disclosed on the polling endpoint (see below), not here.

  • 1 residential_request per 30 results returned (stats.results_count), minimum 1 per search and 1 per 5 TikTok pages read (stats.pages_fetched): 3 results cost the same as 30, and 31 to 60 cost 2. The page floor applies to searches that read many pages to return few results (strict like, view or date filters). Videos your filters drop are not billed.
  • No search_request is billed for TikTok keyword search.
  • parallel_search_slices raises coverage and cost together. By default (1) the search runs a single paginated query chain, naturally capped at roughly 115–140 items by TikTok. Setting it to 2..4 runs that many concurrent chains and dedups by video id, lifting the ceiling; you pay for the extra videos it returns. Extra slices help most on searches without a date window: with published_within set, every slice searches the same window and can return largely the same videos.

Usage disclosure: this endpoint does not accept include_usage. Because billing happens after the 202 response is sent, there is nothing to disclose at submit time. Pass include_usage=true on GET /tiktok/search/{task_id} instead — it replays the final charges once task_status=completed.

Request Parameters

ParameterTypeRequiredDescription
querystringYesKeyword phrase to search on TikTok (min length 2).
max_resultsintegerNoUpper bound on results the task will try to collect. 0 (default) or omitted means unlimited — pagination stops only when TikTok has no more results or the page cap is reached (~115–140 items per slice: ~5 pages of ~30 items). No hard server-side cap is enforced; you are billed per 30 results returned, and at least 1 per 5 pages read.
parallel_search_slicesintegerNoHow many concurrent paginated query chains to run and dedup (1–4, default 1). Higher values lift the result ceiling at up to ~N× the cost of a single search. With published_within set, keep 1 unless you have measured a gain. Not a time filter — use published_within, after_datetime or before_datetime for time windows.
sort_bystringNoSort order applied by TikTok itself (same as the app's search Filters): relevance, most_liked or newest. See Sorting and date windows.
published_withinstringNoPublication window applied by TikTok itself: all, past_24_hours, this_week, this_month, last_3_months or last_6_months. Windows are rolling (this_week = the last 7 days).
after_datetimestringNoOnly include videos published on or after this boundary. Accepts YYYY-MM-DD or an ISO datetime with timezone. Unless sort_by or published_within is set, it also makes the search run newest first and stop once it passes this boundary.
before_datetimestringNoOnly include videos published on or before this boundary. Accepts YYYY-MM-DD or an ISO datetime with timezone.
countrystringNoTwo-letter country code (ISO 3166-1 alpha-2, lowercase) whose TikTok results you get. Default gb. us is not supported. The request schema above lists the accepted codes. The first search for a country other than gb can take 10–20 s longer.
min_likesintegerNoOnly include videos with at least this many likes.
max_likesintegerNoOnly include videos with at most this many likes.
min_viewsintegerNoOnly include videos with at least this many views.
max_viewsintegerNoOnly include videos with at most this many views.
webhook_urlstringNoWhere to POST a notification when the task finishes. Overrides the account default set in Studio → API; pass "" to opt this task out of the default. Must be a public https URL. The event carries stats and points you to check_status_url for the results. See Webhooks.

Diminishing returns on slices: on a representative query without a date window, 2 slices yield ~+43% unique items, 3 slices ~+22%, and 4 slices ~+13% — so 4 already saturates TikTok's natural ~480-item dedup ceiling for most queries.

Sorting and date windows

sort_by and published_within are applied by TikTok itself, before VidNavigator's own filters (after_datetime, min_likes, …). Using them well returns more matching videos per billed page.

sort_byOrder
relevanceTikTok's own ranking
most_likedBy like count
newestBy publish date, newest first

When sort_by is omitted, results are returned newest first, and the search is ordered to fit your filters:

  • after_datetime or before_datetime set → the search runs newest first and stops once it passes after_datetime
  • only min_likes or min_views set → the search runs most liked first

When published_within is omitted and after_datetime is more than 24 hours ago, the smallest window that covers after_datetime is selected automatically. The window actually used is reported in stats.published_within on the result endpoint.

{
  "query": "ai tools",
  "sort_by": "most_liked",
  "published_within": "this_week",
  "min_views": 10000
}

Example Usage

curl -X POST "https://api.vidnavigator.com/v1/tiktok/search" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "ai tools",
    "parallel_search_slices": 2,
    "after_datetime": "2024-01-01T00:00:00Z",
    "min_likes": 1000
  }'

Success Response (202 Accepted)

{
  "status": "success",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000",
    "task_status": "processing",
    "query": "ai tools",
    "country": "gb",
    "max_results": 0,
    "parallel_search_slices": 2,
    "filters": {
      "sort_by": null,
      "published_within": null,
      "after_datetime": "2024-01-01T00:00:00.000Z",
      "before_datetime": null,
      "min_likes": 1000,
      "max_likes": null,
      "min_views": null,
      "max_views": null
    },
    "expires_at": "2026-04-26T13:00:00.000Z",
    "check_status_url": "/v1/tiktok/search/550e8400-e29b-41d4-a716-446655440000",
    "webhook_url": null,
    "message": "Search started. Poll check_status_url for results."
  }
}

Get the result

GET /tiktok/search/{task_id} — poll this endpoint with the task_id (or the check_status_url) returned above, or wait for the webhook notification. Polling does not consume credits.

The playground above only covers the submit request. Call the result endpoint with cURL or your HTTP client.

Request Parameters

ParameterInRequiredDescription
task_idpathYesTask ID returned by POST /tiktok/search
cursorqueryNoOpaque pagination cursor from a previous response
limitqueryNoMaximum number of items to return, between 1 and 500. Default is 50.
include_usagequeryNoWhen true and task_status=completed, attach a usage block describing the charges the background worker recorded (1 residential_request per 30 results_count, minimum 1 and 1 per 5 pages_fetched; no search_request for TikTok keyword search).

Usage Disclosure

Because billing happens in the background worker, the submit endpoint cannot disclose usage. Instead, pass include_usage=true here:

  • Returned only when task_status=completed (processing tasks haven't finished billing; failed tasks have all charges refunded).
  • Charges are 1 residential_request per 30 stats.results_count, minimum 1 and 1 per 5 stats.pages_fetched. No search_request is billed for TikTok keyword search.

Polling Lifecycle

The task_status field will be one of:

  • processing: the search is still running
  • completed: the search finished and results are ready
  • failed: the search ended with an error (all charges refunded)

While processing, results will be empty and download_url will usually be null.

Example Requests

curl "https://api.vidnavigator.com/v1/tiktok/search/tt_search_abc123?limit=25&include_usage=true" \
  -H "X-API-Key: YOUR_API_KEY"

Example Completed Response

{
  "status": "success",
  "data": {
    "task_id": "tt_search_abc123",
    "task_status": "completed",
    "query": "ai tools",
    "country": "gb",
    "parallel_search_slices": 2,
    "filters": {
      "sort_by": null,
      "published_within": null,
      "after_datetime": "2024-01-01T00:00:00.000Z",
      "before_datetime": null,
      "min_likes": 1000,
      "max_likes": null,
      "min_views": null,
      "max_views": null
    },
    "stats": {
      "pages_fetched": 18,
      "videos_fetched": 520,
      "results_count": 172,
      "next_search_cursor": null,
      "parallel_search_slices": 2,
      "sort_by": "newest",
      "published_within": "all",
      "country": "gb",
      "items_examined": 520,
      "items_filtered_out": 301,
      "items_deduplicated": 47
    },
    "results": [
      {
        "id": "7351234567890123456",
        "item_type": 1,
        "description": "Top AI tools you should try",
        "timestamp": 1712345678,
        "published_at": "2024-04-05T19:34:38Z",
        "author": {
          "id": "6789",
          "unique_id": "creator",
          "nickname": "Creator Name",
          "sec_uid": "MS4wLjAB..."
        },
        "stats": {
          "views": 250000,
          "likes": 22000,
          "comments": 950,
          "shares": 120,
          "collects": 340
        },
        "music": {
          "id": "1122",
          "title": "Original sound",
          "author_name": "creator",
          "duration": 30
        },
        "duration": 28,
        "hashtags": ["ai", "tools", "productivity"],
        "url": "https://www.tiktok.com/@creator/video/7351234567890123456"
      }
    ],
    "pagination": {
      "limit": 25,
      "offset": 0,
      "total_items": 172,
      "has_next": true,
      "has_prev": false,
      "next_cursor": "eyJvZmZzZXQiOjI1fQ==",
      "prev_cursor": null
    },
    "download_url": "https://storage.example.com/api/tiktok_searches/user/task.json?X-Amz-Signature=...",
    "error_message": null,
    "error": null,
    "webhook": null,
    "created_at": "2026-04-26T12:00:00.000Z",
    "completed_at": "2026-04-26T12:01:40.235Z",
    "expires_at": "2026-04-26T13:00:00.000Z"
  },
  "usage": {
    "charges": [
      { "service_type": "residential_request", "quantity": 18, "credits": 0.09 }
    ],
    "total_credits": 0.09
  }
}

The usage block appears only when include_usage=true and task_status=completed.

Understanding the Response

stats

  • videos_fetched: distinct videos TikTok returned, including those your filters dropped. Reported for information: billing follows results_count (1 residential_request per 30) and pages_fetched (at least 1 per 5).
  • pages_fetched: number of TikTok pages fetched
  • results_count: total normalized items collected
  • parallel_search_slices: slice count the search ran with
  • country: same as country
  • items_examined / items_filtered_out: only when filters were set — videos checked against them, and videos they dropped
  • items_deduplicated: only with parallel_search_slices > 1 — videos several slices returned, counted once
  • next_search_cursor: internal upstream cursor, or null when exhausted
  • sort_by: sort order the search ran with (relevance when sort_by was omitted)
  • published_within: date window the search ran with — shows the window chosen from after_datetime when published_within was omitted; all means no window

results

Each item is a normalized TikTok video with id, description, timestamp, published_at (UTC ISO 8601), author, stats (views/likes/comments/shares/collects), music, duration, hashtags, and url. Items are sorted by published_at descending (items without a timestamp go last), unless sort_by was set, in which case TikTok's order is kept.

download_url

When present, a short-lived signed URL pointing to the full search result as one JSON file (same shape as the paginated results, but unsliced). null when the task hasn't finished or the full result wasn't archived — paginate through results instead.

error

Present when task_status is failed: an object with error (a code you can branch on), message and http_status. See Errors.

error_message is deprecated. It is kept for existing integrations, but new code should read error.error / error.message instead.

webhook

Delivery state of the task's webhook notification (status, attempts, response_status, last_error_code, last_error, delivered_at), or null when no webhook applies.

Error Cases

  • 400: invalid request (invalid_parameter, e.g. an unsupported country; invalid_cursor for a bad cursor)
  • 404: task does not exist, expired, or does not belong to the current user

Tips

  • poll every few seconds while task_status is processing
  • switch to download_url for large completed jobs
  • tasks expire after about 1 hour — use expires_at to avoid polling expired tasks
  • call the endpoint again later if you need a freshly minted download_url

API reference

Authorization

ApiKeyAuth
headerX-API-Key<token>

API key authentication. Include your VidNavigator API key in the X-API-Key header.

Request Body

application/json
  1. body
query*string

Keyword phrase to search on TikTok.

Length2 <= length
country?string

Country whose TikTok results you get (ISO 3166-1 alpha-2, lowercase or uppercase). Default gb. us is not supported: TikTok asks US visitors to log in before searching. The first search for a country other than gb can take 10-20 s longer.

Default"gb"
Value in"ae""af""al""am""ao""ar""at""au""az""ba""bd""be""bf""bg""bh""bj""bo""br""bw""by""ca""cd""ch""ci""cl""cm""co""cr""cy""cz""de""dk""do""dz""ec""ee""eg""es""et""fi""fj""fr""gb""ge""gh""gr""gt""hn""hr""ht""hu""id""ie""il""iq""is""it""jm""jp""ke""kg""kh""kr""kw""kz""la""lb""lk""lt""lu""lv""ly""ma""md""me""mg""mk""ml""mm""mn""mt""mu""mw""mx""my""mz""na""ne""ng""ni""nl""no""np""nz""om""pa""pe""pg""ph""pk""pl""pt""py""qa""ro""rs""rw""sa""sd""se""sg""si""sk""sn""so""sv""tg""th""tj""tn""tr""tt""tw""tz""ua""ug""uy""ve""vn""ye""za""zm""zw"
max_results?integer

Optional upper bound on results the background task will try to collect. 0 (the default) or omitted means unlimited — pagination only stops when TikTok has no more results or the page cap is reached. With parallel_search_slices=1 that naturally yields ~115-140 items (TikTok serves ~5 pages of ~30 items per chain); with parallel_search_slices=4 up to ~480 unique items. A positive integer caps the merged result count. No hard server-side cap is enforced — a caller asking for 3000 receives whatever TikTok delivers.

Range0 <= value
Default0
parallel_search_slices?integer

How many concurrent paginated query chains to run and dedup by video id. 1 (the default) is a single chain naturally capped at roughly 115-140 items. 2..4 runs that many additional chains in parallel, lifting the effective ceiling. Diminishing returns: 2 slices yield ~+43% unique items, 3 slices ~+22%, 4 slices ~+13% on a representative query without a date window, so 4 already saturates TikTok's natural ~480-item dedup ceiling for most queries. With published_within set, every slice searches the same window and extra slices can return largely the same videos, so keep 1 unless you have measured a gain. parallel_search_slices is not a time filter — use published_within, after_datetime or before_datetime for time windows.

Range1 <= value <= 4
Default1
sort_by?string

Sort order applied by TikTok itself (the same control as the app's search Filters sheet). relevance returns results in TikTok's ranking, most_liked by like count, newest by publish date, newest first. When omitted, results are returned newest first, and the search itself is ordered to fit your filters: newest first when after_datetime or before_datetime is set (stopping once it passes after_datetime), most liked first when only min_likes or min_views is set. That returns more matching videos per page.

Value in"relevance""most_liked""newest"
published_within?string

Publication window applied by TikTok itself. Windows are rolling (this_week = the last 7 days). When omitted and after_datetime is more than 24 hours ago, the smallest window that covers after_datetime is selected automatically.

Value in"all""past_24_hours""this_week""this_month""last_3_months""last_6_months"
after_datetime?string

Only include videos published on or after this boundary. Accepts YYYY-MM-DD or ISO datetime with timezone. Unless sort_by or published_within is set, it also makes the search run newest first and stop once it passes this boundary, so more results in range come back per page.

before_datetime?string

Only include videos published on or before this boundary. Accepts YYYY-MM-DD or ISO datetime with timezone.

min_likes?integer
Range0 <= value
max_likes?integer
Range0 <= value
min_views?integer
Range0 <= value
max_views?integer
Range0 <= value
webhook_url?string

Where to POST the result when the task finishes. Overrides the account-level default configured in Studio → API; pass an empty string to opt this task out of that default. Must be a publicly reachable https URL. The event is a notification, not the payload: a search can hold hundreds of videos, so it carries stats and tells you to read the result from check_status_url. See https://docs.vidnavigator.com/webhooks

Formaturi

Response Body

Task accepted and queued.

application/json
  1. response
status?"success"
Value in"success"
data?
Example Request
curl -X POST 'https://api.vidnavigator.com/v1/tiktok/search' \  -H 'Content-Type: application/json' \  -d '{  "query": "ai tools"}'
Example Response
{  "status": "success",  "data": {    "task_id": "string",    "task_status": "processing",    "query": "string",    "country": "gb",    "max_results": 0,    "parallel_search_slices": 1,    "filters": {},    "expires_at": "2019-08-24T14:15:22Z",    "check_status_url": "/v1/tiktok/search/550e8400-e29b-41d4-a716-446655440000",    "message": "string",    "webhook_url": "string"  }}

On this page