TikTok user search
Beta GET /v1/tiktok/search/users
GET /v1/tiktok/search/users
TikTok user search.
- 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. |
Every request also accepts:
cursor: the cursor from the previous page (Pagination).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
curl -G "https://api.socialscrape.io/v1/tiktok/search/users" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "query=nasa"Python
import os
import requests
params = {
"query": "nasa",
}
res = requests.get(
"https://api.socialscrape.io/v1/tiktok/search/users",
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"])TypeScript
const url = new URL("https://api.socialscrape.io/v1/tiktok/search/users");
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);
}n8n
{
"nodes": [
{
"name": "SocialScrape TikTok user search",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/tiktok/search/users",
"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_c83ed80b25d3cb6833c4958f",
"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://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e5143212a59c09a008bf50f487d54d1f~tplv-tiktokx-cropcenter:100:100.webp?biz_tag=tiktok_user.user_cover&dr=9640&idc=useast5&ps=13740610&refresh_token=9a678828&shcp=c1333099&shp=3...",
"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": 11436616,
"views": null
},
"extra": {
"sec_uid": "MS4wLjABAAAAU9BRVzC8oCaegVnia8IbqWhPb_-dbU7s00Y3wS1_Nx8g5RUaYvyXrpejgjdxTwd6",
"verification_reason": "institution account"
}
},
{
"object": "profile",
"platform": "tiktok",
"id": "7064838657300251654",
"handle": "𝑛𝑎𝑠𝑎",
"name": "NASA_Editor",
"headline": null,
"url": "https://www.tiktok.com/@𝑛𝑎𝑠𝑎",
"kind": "creator",
"bio": "I'm Editor space 🚀😀",
"avatar_url": "https://p19-common-sign.tiktokcdn-us.com/tos-maliva-avt-0068/8854cd9becb41a377a03e7a61f908fd8~tplv-tiktokx-cropcenter:100:100.webp?biz_tag=tiktok_user.user_cover&dr=9640&idc=useast5&ps=13740610&refresh_token=69b8a325&shcp=c1333099&shp=30310...",
"banner_url": null,
"verified": null,
"is_private": null,
"external_url": null,
"links": null,
"location": null,
"category": null,
"created_at": null,
"stats": {
"followers": 55,
"following": null,
"posts": null,
"likes": 0,
"views": null
},
"extra": {
"sec_uid": "MS4wLjABAAAAqGlRomrFFt4-_sBFjST6nDj6DP0bbhyoiS8y2cBQczhJutoWloS-FMKKv_F9hA8F"
}
}
],
"cursor": "c10",
"has_more": true,
"parent": null
},
"cursor": "c10",
"has_more": true
}Response#
A list of Profile 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 search suggestions (
GET /v1/tiktok/search/suggestions)