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_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Search terms. Also accepted as keyword, q. |
sort | string | no | Order 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_posted | string | no | Posted 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:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.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"1import os2import requests34params = {5 "query": "nasa",6 "date_posted": "week",7}8res = requests.get(9 "https://api.socialscrape.dev/v1/tiktok/search/keyword",10 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},11 params=params,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/tiktok/search/keyword");2url.search = new URLSearchParams({3 "query": "nasa",4 "date_posted": "week"5}).toString();6const res = await fetch(url, {7 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },8});9const body = await res.json();1011if (body.ok) {12 console.log(body.data);13} else {14 console.error(body.error.code, body.error.message);15}1{2 "nodes": [3 {4 "name": "SocialScrape TikTok video search",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/tiktok/search/keyword",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "query",19 "value": "nasa"20 },21 {22 "name": "date_posted",23 "value": "week"24 }25 ]26 },27 "sendHeaders": true,28 "headerParameters": {29 "parameters": [30 {31 "name": "x-api-key",32 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"33 }34 ]35 }36 }37 }38 ],39 "connections": {}40}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
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.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
not_found | 404 | no | The 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}Related endpoints#
- TikTok profile (
GET /v1/tiktok/profile) - TikTok profile videos (
GET /v1/tiktok/profile/videos) - TikTok collection videos (
GET /v1/tiktok/collection/videos) - TikTok video details (
GET /v1/tiktok/video) - TikTok video transcript (
GET /v1/tiktok/video/transcript) - TikTok video comments (
GET /v1/tiktok/video/comments) - TikTok comment replies (
GET /v1/tiktok/video/comment/replies) - TikTok user search (
GET /v1/tiktok/search/users)