Docs menu

TikTok video details

Beta GET /v1/tiktok/video

GET /v1/tiktok/video

Metadata and engagement stats of one video or photo slideshow. get_transcript=true adds the native captions in extra.transcript; for AI transcription use /v1/tiktok/video/transcript.

  • 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_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLone ofVideo URL (www.tiktok.com/@user/video/..., vm.tiktok.com/..., vt.tiktok.com/...). Accepted hosts: tiktok.com.
idstringone ofNumeric video id. Also accepted as aweme_id, video_id.
get_transcriptbooleannoInclude the video's native captions when it has them. Default false.

Send at least one of url, id. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • region: two-letter country code for results that vary by country. Changing it restarts the cursor chain.
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • 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/video" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "url=https://www.tiktok.com/@khaby.lame/video/7137423965982592302"
Python
import os
import requests

params = {
    "url": "https://www.tiktok.com/@khaby.lame/video/7137423965982592302",
}
res = requests.get(
    "https://api.socialscrape.io/v1/tiktok/video",
    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/video");
url.search = new URLSearchParams({
  "url": "https://www.tiktok.com/@khaby.lame/video/7137423965982592302"
}).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 video details",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/tiktok/video",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "https://www.tiktok.com/@khaby.lame/video/7137423965982592302"
            }
          ]
        },
        "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_3ab8d8ed45508298004ebe2e",
  "data": {
    "object": "post",
    "platform": "tiktok",
    "id": "7137423965982592302",
    "url": "https://www.tiktok.com/@charlidamelio/video/7137423965982592302",
    "type": "video",
    "author": {
      "id": "5831967",
      "handle": "charlidamelio",
      "name": "charli d’amelio",
      "url": "https://www.tiktok.com/@charlidamelio",
      "avatar_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/ee31de49ddf64b45c5b2e3c55fbd0ea4~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=276d5eb7&x-expires=1793498400&x-signature=BHW4ihhCJIG2Qlp4K4ENUsq9tAM%3D&t=4d5b0474...",
      "verified": true
    },
    "title": null,
    "text": null,
    "published_at": "2022-08-29T22:10:18Z",
    "duration_seconds": 11.0,
    "language": null,
    "hashtags": null,
    "mentions": null,
    "stats": {
      "views": 22000000,
      "likes": 2100000,
      "comments": 19500,
      "shares": 17300,
      "saves": 83186,
      "dislikes": null
    },
    "media": {
      "thumbnail_url": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/c1844bce7c5a4b07b0e4ae2301a1996a~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400&x-signature=VJp6FMqZSTXhVeS62gXUxGJ%2ByFk%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f...",
      "video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-ve-0068c001-tx/0641e3a6387a49e4a2c8c4de2c457fe8/?a=1988&bti=ODszNWYuMDE6&&bt=1991&ft=4KJMyMzm8Zmo0FASla4jV-OhQpWrKsd.&mime_type=video_mp4&rc=ZmhlZGY8NTQ0OWk8ZWQ8O0BpM2w8N2...",
      "audio_url": null,
      "image_urls": null,
      "width": 576,
      "height": 1024
    },
    "song": {
      "id": "7090403288818584347",
      "title": "Streets x Kiss it better",
      "artist": ":p",
      "url": "https://www.tiktok.com/music/Streets-x-Kiss-it-better-7090403288818584347"
    },
    "location": null,
    "is_pinned": null,
    "is_sponsored": false,
    "extra": {
      "ai_label_shown": false,
      "author_followers": 160300000,
      "category_type": 113,
      "comments_disabled": false,
      "duet_enabled": true,
      "is_private": false,
      "music_is_original": true,
      "reposts": 0,
      "stitch_enabled": true,
      "video_definition": "540p"
    }
  },
  "cursor": null,
  "has_more": null
}

Response#

A Post object in data.

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.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe 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": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_221aa10cc0f2ff95a36a8121"
}

Also served at#

These paths answer the same request, so code written for other APIs keeps working: /v2/tiktok/video. See Switching from ScrapeCreators.