Docs menu

YouTube video or Short details

Beta GET /v1/youtube/video

GET /v1/youtube/video

Title, description, stats, duration, channel, thumbnails, chapters, caption tracks and whether YouTube marks it as paid promotion (is_sponsored, null when YouTube's player could not be read for this request). Views, likes and the publish time are exact; the comment and subscriber counts are the abbreviated figures YouTube shows logged out, with the display text in extra. Works for Shorts and lives.

  • 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 or Short URL (watch, youtu.be, shorts, live, embed). Accepted hosts: youtube.com, youtu.be.
idstringone of11-character video id. Also accepted as videoId, video_id.
languagestringnoPreferred response language, 2 letters (en, es, fr). Not guaranteed: YouTube localises on its own. Also accepted as lang.

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:

  • 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/youtube/video" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "id=QP5Fs3AYuWE"
Python
import os
import requests

params = {
    "id": "QP5Fs3AYuWE",
}
res = requests.get(
    "https://api.socialscrape.io/v1/youtube/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/youtube/video");
url.search = new URLSearchParams({
  "id": "QP5Fs3AYuWE"
}).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 YouTube video or Short details",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/youtube/video",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "QP5Fs3AYuWE"
            }
          ]
        },
        "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_d4fe60a3d3a459bd87016778",
  "data": {
    "object": "post",
    "platform": "youtube",
    "id": "QP5Fs3AYuWE",
    "url": "https://www.youtube.com/shorts/QP5Fs3AYuWE",
    "type": "short",
    "author": {
      "id": "UCLA_DiR1FfKNvjuUpBHmylQ",
      "handle": "NASA",
      "name": "NASA",
      "url": "https://www.youtube.com/@NASA",
      "avatar_url": "https://yt3.ggpht.com/eIf5fNPcIcj9ig-wZBeq4stFy1lgjWTW1nLT5dYlFkHZprZ03QBiMcbpwNMB6XSBjrSFGtAGQg=s176-c-k-c0x00ffffff-no-rj",
      "verified": true
    },
    "title": "2026 Total Solar Eclipse Over Spain",
    "text": "On Aug. 12, 2026, a total solar eclipse passed over Greenland, Iceland, northern Russia, the Atlantic Ocean, Spain, and a small corner of Portugal.\n\nWatch the moment that our teams captured totality over Spain.\n\nCredit: NASA",
    "published_at": "2026-08-12T19:08:21Z",
    "duration_seconds": 35.0,
    "language": null,
    "hashtags": null,
    "mentions": null,
    "stats": {
      "views": 199507,
      "likes": 5927,
      "comments": null,
      "shares": null,
      "saves": null,
      "dislikes": null
    },
    "media": {
      "thumbnail_url": "https://i.ytimg.com/vi/QP5Fs3AYuWE/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYZSBlKGUwDw==&rs=AOn4CLAT9U1JJD_l2_VOJY3iTy0h7-Tq1w",
      "video_url": null,
      "audio_url": null,
      "image_urls": null,
      "width": null,
      "height": null
    },
    "song": null,
    "location": null,
    "is_pinned": null,
    "is_sponsored": false,
    "extra": {
      "caption_tracks": [
        {
          "auto_generated": true,
          "language": "ar",
          "name": "Arabic (auto-generated)",
          "translatable": true
        },
        {
          "auto_generated": true,
          "language": "bn",
          "name": "Bangla (auto-generated)",
          "translatable": true
        },
        {
          "auto_generated": true,
          "language": "nl-NL",
          "name": "Dutch (Netherlands) (auto-generated)",
          "translatable": true
        }
      ],
      "category": "Science & Technology",
      "channel_subscribers": 15100000,
      "channel_subscribers_approximate": true,
      "channel_subscribers_text": "15.1M subscribers",
      "is_family_safe": true,
      "is_live_content": false,
      "is_private": false,
      "is_unlisted": false,
      "is_upcoming": false,
      "published_text": "Aug 12, 2026",
      "thumbnails": [
        {
          "height": 94,
          "url": "https://i.ytimg.com/vi/QP5Fs3AYuWE/hqdefault.jpg?sqp=-oaymwE1CKgBEF5IVfKriqkDKAgBFQAAiEIYAHABwAEG8AEB-AG2CIACgA-KAgwIABABGGUgZShlMA8=&rs=AOn4CLDrAev0707eUtWVw7tcFDGzllOgjA",
          "width": 168
        },
        {
          "height": 110,
          "url": "https://i.ytimg.com/vi/QP5Fs3AYuWE/hqdefault.jpg?sqp=-oaymwE1CMQBEG5IVfKriqkDKAgBFQAAiEIYAHABwAEG8AEB-AG2CIACgA-KAgwIABABGGUgZShlMA8=&rs=AOn4CLD2sD3W8Tl_PUrOx667wESrow53lQ",
          "width": 196
        },
        {
          "height": 138,
          "url": "https://i.ytimg.com/vi/QP5Fs3AYuWE/hqdefault.jpg?sqp=-oaymwE2CPYBEIoBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIGUoZTAP&rs=AOn4CLBybH2EaBC3DPLH8TdWMpRvzKZxng",
          "width": 246
        }
      ],
      "view_count_text": "199,507 views"
    }
  },
  "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_a646a1f20eb07288bf71abf0"
}