TikTok top search
Beta GET /v1/tiktok/search/top
GET /v1/tiktok/search/top
TikTok's 'Top' tab: videos, photo carousels and a card of matching accounts (keyword search returns videos only). Same filter limits as keyword search: relevance order only; publish_time drops older items from each page.
- 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. |
publish_time | string | no | Posted within. One of any, day, week, month, three_months, six_months. 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. |
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. |
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/top" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "query=nasa"import os
import requests
params = {
"query": "nasa",
}
res = requests.get(
"https://api.socialscrape.io/v1/tiktok/search/top",
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/top");
url.search = new URLSearchParams({
"query": "nasa"
}).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 top search",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/tiktok/search/top",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "query",
"value": "nasa"
}
]
},
"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_2e82adf0c17efa40fa196909",
"data": {
"object": "list",
"items": [
{
"object": "profile",
"platform": "tiktok",
"id": "7664638705177150477",
"handle": "nasa",
"name": "NASA",
"headline": null,
"url": "https://www.tiktok.com/@nasa",
"kind": "creator",
"bio": "Making the seemingly impossible, possible.✨",
"avatar_url": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e5143212a59c09a008bf50f487d54d1f~tplv-tiktokx-cropcenter:100:100.webp?dr=9640&refresh_token=b012eef3&x-expires=1793412000&x-signature=2VwATs9CMRe7debIQD7k65EOglU%3D&t=4d5b0474...",
"banner_url": null,
"verified": true,
"is_private": null,
"external_url": null,
"links": null,
"location": null,
"category": null,
"created_at": null,
"stats": {
"followers": 2100000,
"following": null,
"posts": null,
"likes": 11436619,
"views": null
},
"extra": {
"sec_uid": "MS4wLjABAAAAU9BRVzC8oCaegVnia8IbqWhPb_-dbU7s00Y3wS1_Nx8g5RUaYvyXrpejgjdxTwd6",
"verification_reason": "institution account"
}
},
{
"object": "post",
"platform": "tiktok",
"id": "7702253392705441054",
"url": "https://www.tiktok.com/@iknowtaz/video/7702253392705441054",
"type": "video",
"author": {
"id": "7679888811509498894",
"handle": "iknowtaz",
"name": "Evil Susan Dell",
"url": "https://www.tiktok.com/@iknowtaz",
"avatar_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-avt-0068-tx2/4eeea2047866d1ebcaaafc1bf6a07ec3~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=194894aa&x-expires=1793498400&x-signature=gLIx6aEll2Cm9%2FAxXH4qH85OSiE%3D&t=4d5b0...",
"verified": false
},
"title": null,
"text": "EXPOSING UNSEEN ALIEN FOOTAGE AT 10K👀 #alien #whitehouse",
"published_at": "2026-10-30T00:37:09Z",
"duration_seconds": 11.0,
"language": "en",
"hashtags": [
"alien",
"whitehouse"
],
"mentions": null,
"stats": {
"views": 626,
"likes": 34,
"comments": 3,
"shares": 0,
"saves": 6,
"dislikes": null
},
"media": {
"thumbnail_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-p-0068-tx2/o8VfQjrIADEiAARMA5gCfFr8WIqVYQGnjexojF~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400&x-signature=8uvJI9H3MSHkNBmTuJcAM24szX0%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shc...",
"video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast8/tos-useast8-pve-0068-tx2/oAG54gCAVbIgErojC8FEAWDYIxAjF8fIQnfAqe/?a=1988&bti=ODszNWYuMDE6&&bt=1025&ft=4KJMyMzm8Zmo09SSla4jV2sedpWrKsd.&mime_type=video_mp4&rc=PDU5ZDdmNDZkPGk4OjpkNkBpM2...",
"audio_url": null,
"image_urls": null,
"width": 720,
"height": 1280
},
"song": {
"id": "7681390189306006303",
"title": "original sound",
"artist": "Capone",
"url": "https://www.tiktok.com/music/original-sound-7681390189306006303"
},
"location": null,
"is_pinned": null,
"is_sponsored": false,
"extra": {
"author_followers": 6667,
"caption_languages": [
"eng-US"
],
"category_type": 120,
"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 or Profile or Collection or Community 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.
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)