TikTok video search API
  1. Docs
  2. TikTok
  3. TikTok video search API

TikTok video search API

Video search across TikTok.

GET /v1/tiktok/search/keyword

GET /v1/tiktok/search/keyword

Video search across TikTok. TikTok ignores sort and date filters: sort other than relevance is refused, and date_posted drops videos older than the window from each page (pages can be short or empty; follow has_more). region is TikTok's region hint, not a proxy country. TikTok now asks for a login on keyword search: when it does, the list is the public videos under the hashtag of your query instead, which are not keyword matches, and parent is that hashtag with the explanation as its description and extra.fallback set to hashtag.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
querystringyesSearch terms. Also accepted as keyword, q.
sortstringnoOrder of results. Changing it restarts the cursor chain. One of relevance, likes, latest. Default relevance. Also accepted as sort_by, sortBy, order. Also accepted values: most-liked for likes, date-posted for latest.
date_postedstringnoPosted within. One of any, day, week, month, three_months, six_months. Also accepted as datePosted. Also accepted values: yesterday for day, this-week for week, this-month for month, last-3-months for three_months, last-6-months for six_months, all-time for any.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • region: two-letter country code for results that vary by country. Changing it restarts the cursor chain.
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/tiktok/search/keyword" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "query=nasa" \4  --data-urlencode "date_posted=week"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_aa89e5c529d004ce97548d55",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "tiktok",14        "id": "7701783685640604950",15        "url": "https://www.tiktok.com/@whatifshow/video/7701783685640604950",16        "type": "video",17        "author": {18          "id": "6812191996213429253",19          "handle": "whatifshow",20          "name": "WHAT IF",21          "url": "https://www.tiktok.com/@whatifshow",22          "avatar_url": "https://p19-common-sign.tiktokcdn-us.com/tos-maliva-avt-0068/677cdf3a43f86f3d59f6fefc497731f0~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=245fb3be&x-expires=1793498400&x-signature=Zu2A9uvOVp0mAqcfZI8v47IY880%3D&t=4d5b0474&ps=...",23          "verified": true24        },25        "title": null,26        "text": "What Did Scientists Discover on Jupiter #whatif #spacethings #fyp #projecthailmary #planet",27        "published_at": "2026-10-28T18:14:20Z",28        "duration_seconds": 561.0,29        "language": "en",30        "hashtags": [31          "whatif",32          "spacethings",33          "fyp"34        ],35        "mentions": null,36        "stats": {37          "views": 496600,38          "likes": 29900,39          "comments": 358,40          "shares": 1315,41          "saves": 3953,42          "dislikes": null43        },44        "media": {45          "thumbnail_url": "https://p16-common-sign.tiktokcdn-us.com/tos-no1a-p-0037-no/oUqAkGEPvC7IjAFVpFzQIlfAA4CQgofHVMZDEM~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400&x-signature=RZ1DfrpLkSN97v934SOqHdf1hfw%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43...",46          "video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/no1a/tos-no1a-ve-0068-no/oIuI5wAx8AAcPYuJFMrVW4DZeQLIXEnulGfifO/?a=1988&bti=ODszNWYuMDE6&&bt=698&ft=aEeq8qT0mIoPD12DAAiI3wUbCLAbMeF~O5&mime_type=video_mp4&rc=M2Q4ZDNoNDM0Njk5MzVkNUBpanBxZHM5c...",47          "audio_url": null,48          "image_urls": null,49          "width": 576,50          "height": 102451        },52        "song": {53          "id": "7701783943456099094",54          "title": "original sound - WHAT IF",55          "artist": "WHAT IF",56          "url": "https://www.tiktok.com/music/original-sound-WHAT-IF-7701783943456099094"57        },58        "location": null,59        "is_pinned": null,60        "is_sponsored": false,61        "extra": {62          "author_followers": 2600000,63          "caption_languages": [64            "eng-US"65          ],66          "category_type": 116,67          "comments_disabled": false,68          "is_private": false,69          "music_is_original": true,70          "reposts": 0,71          "video_definition": "540p"72        }73      },74      {75        "object": "post",76        "platform": "tiktok",77        "id": "7702163104536300814",78        "url": "https://www.tiktok.com/@nbcnews/video/7702163104536300814",79        "type": "video",80        "author": {81          "id": "6652774777768427525",82          "handle": "nbcnews",83          "name": "nbcnews",84          "url": "https://www.tiktok.com/@nbcnews",85          "avatar_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/25eb446f0c8924ffab98c35960b0491e~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=7433a489&x-expires=1793498400&x-signature=X8iA6OmgUQRFkORPe5bE%2FyC1z%2BQ%3D&t=4d5b...",86          "verified": true87        },88        "title": null,89        "text": "NASA astronauts mark the 100th spacewalk at the International Space Station.",90        "published_at": "2026-10-29T18:46:45Z",91        "duration_seconds": 21.0,92        "language": "en",93        "hashtags": null,94        "mentions": null,95        "stats": {96          "views": 8419,97          "likes": 323,98          "comments": 21,99          "shares": 16,100          "saves": 20,101          "dislikes": null102        },103        "media": {104          "thumbnail_url": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/o0CqCAHEVSufCSHUKgA5WQA4IAtqqsDxfSSDFC~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400&x-signature=olPiW1tmDj0FmxWjSinBRdFwPHA%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp...",105          "video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-ve-0068c002-tx/oEIgjvQl4OCEXzhUUgBiyiMKSRBaJuA4AGUDl/?a=1988&bti=ODszNWYuMDE6&&bt=1173&ft=aEeq8qT0mIoPD12DAAiI3wUbCLAbMeF~O5&mime_type=video_mp4&rc=ZDg8aWc2ZmVpM2g7aWk0ZUB...",106          "audio_url": null,107          "image_urls": null,108          "width": 720,109          "height": 1280110        },111        "song": {112          "id": "7702163131555990286",113          "title": "original sound - nbcnews",114          "artist": "nbcnews",115          "url": "https://www.tiktok.com/music/original-sound-nbcnews-7702163131555990286"116        },117        "location": null,118        "is_pinned": null,119        "is_sponsored": false,120        "extra": {121          "author_followers": 12600000,122          "caption_languages": [123            "eng-US"124          ],125          "category_type": 114,126          "comments_disabled": false,127          "duet_enabled": true,128          "is_private": false,129          "music_is_original": true,130          "reposts": 0,131          "stitch_enabled": true,132          "video_definition": "720p"133        }134      }135    ],136    "cursor": "c20",137    "has_more": true,138    "parent": null139  },140  "cursor": "c20",141  "has_more": true142}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

1{2  "ok": false,3  "error": {4    "code": "invalid_params",5    "message": "A parameter is missing, unknown or has the wrong type.",6    "retryable": false7  },8  "credits_charged": 0,9  "request_id": "req_6d27a627d837a9dd02d7f15f"10}