TikTok videos using a song API
TikTok videos using a song, as JSON, with id, url, type, author, title and more.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
You send one of id or url.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/tiktok/song/videos" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'id=7016547803243022337'import os
import requests
params = {
"id": "7016547803243022337",
}
res = requests.get(
"https://api.socialscrape.io/v1/tiktok/song/videos",
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/song/videos");
url.search = new URLSearchParams({
id: "7016547803243022337",
}).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 videos using a song",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/tiktok/song/videos",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "7016547803243022337"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | one of | Sound (music) id. Also accepted as clipId, music_id. |
url | url | one of | Sound URL (tiktok.com/music/...). |
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. |
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_2309c949e55be159981fbbe5",
"data": {
"object": "list",
"items": [
{
"object": "post",
"platform": "tiktok",
"id": "7022393040451030278",
"url": "https://www.tiktok.com/@therock/video/7022393040451030278",
"type": "video",
"author": {
"id": "6745191554350760966",
"handle": "therock",
"name": "The Rock",
"url": "https://www.tiktok.com/@therock",
"avatar_url": "https://p16-common-sign.tiktokcdn-us.com/tos-maliva-avt-0068/7310325298631802885~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=0256d6e1&x-expire...",
"verified": true
},
"title": null,
"text": "#FACEOFFCHALLENGE IS ON🔥🔥🔥Show us what someone says, does or encourages that sends you into OVERdrive👊🏾💪🏾 #faceoff #strangemusicinc",
"published_at": "2021-10-23T22:31:32Z",
"duration_seconds": 66,
"language": "en",
"hashtags": [
"faceoffchallenge",
"faceoff",
"strangemusicinc"
],
"mentions": null,
"stats": {
"views": 107700000,
"likes": 17100000,
"comments": 214300,
"shares": 275400,
"saves": 584275,
"dislikes": null
},
"media": {
"thumbnail_url": "https://p19-common-sign.tiktokcdn-us.com/tos-maliva-p-0068/35765ea83a8c40b895db7b88dad96cad_1635028296~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400...",
"video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-ve-0068c003-tx/98c9878e94444351bfa7bc91d583e63a/?a=1988&bti=ODszNWYuMDE6&&bt=1459&ft=4KJ...",
"audio_url": null,
"image_urls": null,
"width": 576,
"height": 1024
},
"song": {
"id": "7016547803243022337",
"title": "Face Off - Dwayne Johnson",
"artist": "Tech N9ne & Joey Cool & King Iso & Dwayne Johnson",
"url": "https://www.tiktok.com/music/Face-Off-Dwayne-Johnson-7016547803243022337"
},
"location": null,
"is_pinned": null,
"is_sponsored": false,
"extra": {
"ai_label_shown": false,
"author_followers": 80200000,
"category_type": 101,
"comments_disabled": false,
"duet_enabled": true,
"is_private": false
}
},
{
"object": "post",
"platform": "tiktok",
"id": "7039385772222319878",
"url": "https://www.tiktok.com/@thebadp1ace/video/7039385772222319878",
"type": "video",
"author": {
"id": "6911054760808875014",
"handle": "thebadp1ace",
"name": "ale",
"url": "https://www.tiktok.com/@thebadp1ace",
"avatar_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/7310268423383023658~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=0cd2a2c0&x-ex...",
"verified": false
},
"title": null,
"text": "it’s about drive #thebadp1ace",
"published_at": "2021-12-08T17:32:01Z",
"duration_seconds": 14,
"language": "en",
"hashtags": [
"thebadp1ace"
],
"mentions": null,
"stats": {
"views": 77200000,
"likes": 16400000,
"comments": 62300,
"shares": 172100,
"saves": 733226,
"dislikes": null
},
"media": {
"thumbnail_url": "https://p16-common-sign.tiktokcdn-us.com/tos-maliva-p-0068/501bfa17e705479b8ffc192bed4d6a31~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400&x-signatur...",
"video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-pve-0068-tx/bfb9ccd779444fc0ad5193bbc5dcf832/?a=1988&bti=ODszNWYuMDE6&&bt=2330&ft=4KJMyM...",
"audio_url": null,
"image_urls": null,
"width": 576,
"height": 1024
},
"song": {
"id": "7016547803243022337",
"title": "Face Off - Dwayne Johnson",
"artist": "Tech N9ne & Joey Cool & King Iso & Dwayne Johnson",
"url": "https://www.tiktok.com/music/Face-Off-Dwayne-Johnson-7016547803243022337"
},
"location": null,
"is_pinned": null,
"is_sponsored": false,
"extra": {
"ai_label_shown": false,
"author_followers": 320500,
"category_type": 101,
"comments_disabled": false,
"is_private": false,
"music_is_original": false
}
}
],
"cursor": null,
"has_more": false,
"parent": null
},
"cursor": null,
"has_more": false
}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), unsupported_url (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.song_videos(...) and the TypeScript client client.tiktok.songVideos(). 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.