TikTok video search API
Video search across TikTok.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
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.
You send query.
Request
Send your key in the x-api-key header.
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,
timeout=60,
)
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": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Search terms. Also accepted as keyword, q. |
sort | string | Order of results. Changing it restarts the cursor chain. Also accepted as sort_by, sortBy, order. | |
date_posted | string | Posted within. Also accepted as datePosted. | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. | |
region | string | Two-letter country code (ISO 3166-1) for results that vary by country. Also accepted as country, geo. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"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=245f...",
"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,
"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-s...",
"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=aEeq8qT0...",
"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
}
},
{
"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=...",
"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,
"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&...",
"video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-ve-0068c002-tx/oEIgjvQl4OCEXzhUUgBiyiMKSRBaJuA4AGUDl/?a=1988&bti=ODszNWYuMDE6&&bt=1173&f...",
"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
}
}
],
"cursor": "c20",
"has_more": true,
"parent": null
},
"cursor": "c20",
"has_more": true
}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The preview Python client has client.tiktok.search_keyword(...) and the TypeScript client client.tiktok.searchKeyword(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.