- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
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, with the display text in extra. Works for Shorts and lives.
You send one of url or id.
Part of the YouTube Scraper API: 18 YouTube endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/youtube/video" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'id=QP5Fs3AYuWE'1import os2import requests34params = {5 "id": "QP5Fs3AYuWE",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/youtube/video",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11 timeout=60,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/youtube/video");2url.search = new URLSearchParams({3 id: "QP5Fs3AYuWE",4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape YouTube video or Short details",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/youtube/video",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "id",19 "value": "QP5Fs3AYuWE"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | url | one of | Video or Short URL (watch, youtu.be, shorts, live, embed). |
id | string | one of | 11-character video id. Also accepted as videoId, video_id. |
language | string | Preferred response language, 2 letters (en, es, fr). Not guaranteed: YouTube localises on its own. Also accepted as lang. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are examples, not your data.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_d4fe60a3d3a459bd87016778",8 "data": {9 "object": "post",10 "platform": "youtube",11 "id": "QP5Fs3AYuWE",12 "url": "https://www.youtube.com/shorts/QP5Fs3AYuWE",13 "type": "short",14 "author": {15 "id": "UCLA_DiR1FfKNvjuUpBHmylQ",16 "handle": "NASA",17 "name": "NASA",18 "url": "https://www.youtube.com/@NASA",19 "avatar_url": "https://yt3.ggpht.com/eIf5fNPcIcj9ig-wZBeq4stFy1lgjWTW1nLT5dYlFkHZprZ03QBiMcbpwNMB6XSBjrSFGtAGQg=s176-c-k-c0x00ffffff-no-rj",20 "verified": true21 },22 "title": "2026 Total Solar Eclipse Over Spain",23 "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 th...",24 "published_at": "2026-08-12T19:08:21Z",25 "duration_seconds": 35,26 "language": null,27 "hashtags": null,28 "mentions": null,29 "stats": {30 "views": 199507,31 "likes": 5927,32 "comments": null,33 "shares": null,34 "saves": null,35 "dislikes": null36 },37 "media": {38 "thumbnail_url": "https://i.ytimg.com/vi/QP5Fs3AYuWE/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYZSBlKGUwDw==&rs=AOn4CLAT9U1JJD_l2_VOJY3iTy0h7-Tq1w",39 "video_url": null,40 "audio_url": null,41 "image_urls": null,42 "width": null,43 "height": null44 },45 "song": null,46 "location": null,47 "is_pinned": null,48 "is_sponsored": false,49 "extra": {50 "caption_tracks": [51 {52 "auto_generated": true,53 "language": "ar",54 "name": "Arabic (auto-generated)",55 "translatable": true56 },57 {58 "auto_generated": true,59 "language": "bn",60 "name": "Bangla (auto-generated)",61 "translatable": true62 },63 {64 "auto_generated": true,65 "language": "nl-NL",66 "name": "Dutch (Netherlands) (auto-generated)",67 "translatable": true68 }69 ],70 "category": "Science & Technology",71 "channel_subscribers": 15100000,72 "channel_subscribers_approximate": true,73 "channel_subscribers_text": "15.1M subscribers",74 "is_family_safe": true75 }76 },77 "cursor": null,78 "has_more": null79}Fields
One Post in data.
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.
Is there an SDK call for it?
The Python client has client.youtube.video(...) and the TypeScript client client.youtube.video(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.