← All site APIs · updated 2026-09-21
YouTube video API
youtube.com · 1 credit when fetched live, 0 from the shared store · needs an API key
A video by id as JSON: title, channel, views, likes, duration, publish date, description, thumbnails and keywords.
GET /v1/structured/youtube/video
Video by id. The watch page metadata as JSON.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The 11-character video id (the v= parameter). e.g. dQw4w9WgXcQ |
max_age | number | no | Accept a stored copy up to this many seconds old (credits: 0). Defaults to 3600 s (1 h); 0 forces a fresh fetch. |
curl "https://api.webscrapingapi.dev/v1/structured/youtube/video?id=dQw4w9WgXcQ" -H "X-API-Key: wsa_your_key" {
"site": "youtube",
"action": "video",
"data": {
"video": {
"id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"channel": { "id": "UCuAXFkgsw1L7xaCfnd5JJOw", "name": "Rick Astley", "url": "http://www.youtube.com/@RickAstleyYT" },
"durationSeconds": 213,
"viewCount": 1818228078,
"likeCount": 19384777,
"publishedAt": "2009-10-24T23:57:33-07:00",
"category": "Music",
"thumbnails": [ { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg", "width": 1280, "height": 720 } ],
"keywords": [ "rick astley", "Never Gonna Give You Up", … ]
}
},
"source": "live", "age": 0, "credits": 1
} Returns data shaped like: { video: { id, url, title, description, channel { id, name, url }, durationSeconds, viewCount, likeCount, publishedAt, category, thumbnails[], keywords[], isLive, familySafe } }. The envelope also carries site, action, params, source (live or cache), age in seconds, fetchedAt, elapsedMs and credits.
Caching. Results are stored and shared for 1 h by default. A response served from the store costs 0 credits and says "source": "cache"; pass max_age=0 to force a fresh fetch, or a smaller max_age when you need something newer.
Layout changes on youtube.com can break parsing; the API then returns SITE_PARSE_FAILED. If you see it, tell us on the board and it will be fixed.