Get YouTube video metadata (views, likes, duration) with one GET request, no Google API key
Title, channel, views, likes, length, publish date, thumbnails and keywords for any public video, from one request. And when the official Data API is better.
In short
- GET /v1/structured/youtube/video?id=… returns the watch page metadata as JSON. No Google Cloud project, no OAuth, no daily quota units.
- Counts are what the page shows at fetch time; answers are stored for one hour and shared, so repeats cost 0 credits.
- Private, deleted and age-restricted videos are not reachable. For comments, playlists or channel listings use the YouTube Data API v3.
Reading a few facts about a YouTube video should not require a Google Cloud project. The watch page already contains the title, channel, counts, dates and thumbnails in a JSON block that the player reads; this endpoint reads the same block and returns it in a stable shape.
The request
curl "https://api.webscrapingapi.dev/v1/structured/youtube/video?id=dQw4w9WgXcQ" \
-H "X-API-Key: wsa_your_key"
id is the 11-character video id. That is the only required parameter.
The response
{
"site": "youtube",
"action": "video",
"data": {
"video": {
"id": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"description": "The official video for “Never Gonna Give You Up” by Rick Astley. …",
"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", "…"],
"isLive": false,
"familySafe": true
}
},
"source": "live",
"age": 0,
"credits": 1
}
durationSeconds is an integer, so a 3:33 video is 213. publishedAt is the publish date with the channel’s offset as YouTube prints it. The first thumbnail is the largest one the page advertises; the rest are the smaller variants.
Freshness
Video counts change by the second on popular uploads, but very few applications need that resolution. Answers are stored for one hour and shared between everyone who asks for the same id, so a dashboard that refreshes every minute costs one credit an hour, not sixty. Pass max_age=0 when you genuinely need the current number, or a smaller max_age such as 600 to accept anything under ten minutes old.
What it cannot do
Private and deleted videos return 404 NOT_FOUND. Age-restricted videos require a signed-in session, which the API never uses, so they come back as not reachable. Comments, captions, playlists, channel uploads and search are not on the watch page’s metadata and are therefore out of scope; the YouTube Data API v3 covers those, at the price of a project, a key and a daily quota.
A typical use
An agent that is asked “how long is this video and who made it” needs two fields and needs them now. One GET, one JSON object, no OAuth dance. Create a key in the dashboard and the reference page has the rest.
Questions people ask
- Is the like count included?
- Yes, as likeCount, read from the page's own metadata. Videos that hide likes return null.
- What is the video id?
- The 11-character value after v= in a watch URL, for example dQw4w9WgXcQ in youtube.com/watch?v=dQw4w9WgXcQ. Short links (youtu.be/ID) use the same id.
- How current are the view counts?
- As current as the watch page at fetch time. The stored copy is reused for up to 3600 seconds; pass max_age=0 to force a fresh fetch for 1 credit.
- Can I get the transcript or comments?
- Not from this endpoint. It covers what the watch page carries in its metadata: title, channel, counts, dates, description, thumbnails and keywords.