TikTok video search
Beta GET /v1/tiktok/search/keyword
GET /v1/tiktok/search/keyword
Video search across TikTok. TikTok ignores sort and date filters logged out: 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.
- Cost: 1 credit
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- 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).
curl -G "https://api.socialscrape.io/v1/tiktok/search/keyword" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "query=nasa" \
--data-urlencode "date_posted=week"import os
import requests
params = {
"query": "nasa",
"date_posted": "week",
}
res = requests.get(
"https://api.socialscrape.io/v1/tiktok/search/keyword",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/tiktok/search/keyword");
url.search = new URLSearchParams({
"query": "nasa",
"date_posted": "week"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape TikTok video search",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/tiktok/search/keyword",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "query",
"value": "nasa"
},
{
"name": "date_posted",
"value": "week"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_aa89e5c529d004ce97548d55",
"data": {
"object": "list",
"items": [
{
"object": "post",
"platform": "tiktok",
"id": "7701783685640604950",
"url": "https://www.tiktok.com/@whatifshow/video/7701783685640604950",
"type": "video",
"author": {
"id": "6812191996213429253",
"handle": "whatifshow",
"name": "WHAT IF",
"url": "https://www.tiktok.com/@whatifshow",
"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=...",
"verified": true
},
"title": null,
"text": "What Did Scientists Discover on Jupiter #whatif #spacethings #fyp #projecthailmary #planet",
"published_at": "2026-10-28T18:14:20Z",
"duration_seconds": 561.0,
"language": "en",
"hashtags": [
"whatif",
"spacethings",
"fyp"
],
"mentions": null,
"stats": {
"views": 496600,
"likes": 29900,
"comments": 358,
"shares": 1315,
"saves": 3953,
"dislikes": null
},
"media": {
"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...",
"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...",
"audio_url": null,
"image_urls": null,
"width": 576,
"height": 1024
},
"song": {
"id": "7701783943456099094",
"title": "original sound - WHAT IF",
"artist": "WHAT IF",
"url": "https://www.tiktok.com/music/original-sound-WHAT-IF-7701783943456099094"
},
"location": null,
"is_pinned": null,
"is_sponsored": false,
"extra": {
"author_followers": 2600000,
"caption_languages": [
"eng-US"
],
"category_type": 116,
"comments_disabled": false,
"is_private": false,
"music_is_original": true,
"reposts": 0,
"video_definition": "540p"
}
},
{
"object": "post",
"platform": "tiktok",
"id": "7702163104536300814",
"url": "https://www.tiktok.com/@nbcnews/video/7702163104536300814",
"type": "video",
"author": {
"id": "6652774777768427525",
"handle": "nbcnews",
"name": "nbcnews",
"url": "https://www.tiktok.com/@nbcnews",
"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...",
"verified": true
},
"title": null,
"text": "NASA astronauts mark the 100th spacewalk at the International Space Station.",
"published_at": "2026-10-29T18:46:45Z",
"duration_seconds": 21.0,
"language": "en",
"hashtags": null,
"mentions": null,
"stats": {
"views": 8419,
"likes": 323,
"comments": 21,
"shares": 16,
"saves": 20,
"dislikes": null
},
"media": {
"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...",
"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...",
"audio_url": null,
"image_urls": null,
"width": 720,
"height": 1280
},
"song": {
"id": "7702163131555990286",
"title": "original sound - nbcnews",
"artist": "nbcnews",
"url": "https://www.tiktok.com/music/original-sound-nbcnews-7702163131555990286"
},
"location": null,
"is_pinned": null,
"is_sponsored": false,
"extra": {
"author_followers": 12600000,
"caption_languages": [
"eng-US"
],
"category_type": 114,
"comments_disabled": false,
"duet_enabled": true,
"is_private": false,
"music_is_original": true,
"reposts": 0,
"stitch_enabled": true,
"video_definition": "720p"
}
}
],
"cursor": "c20",
"has_more": true,
"parent": null
},
"cursor": "c20",
"has_more": true
}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:
{
"ok": false,
"error": {
"code": "invalid_params",
"message": "A parameter is missing, unknown or has the wrong type.",
"retryable": false
},
"credits_charged": 0,
"request_id": "req_6d27a627d837a9dd02d7f15f"
}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)