YouTube Video API
Public metadata for a YouTube video or Short, including view/like counts. Calls cost 1 credit each. A cache hit is free, and a failed or empty response is never charged.
Try it
Prefilled with the request that produced the example below. No key yet? Get a free key.
Request
GET
/v1/youtube/video| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | yes | Video URL or 11-character video id |
Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).
curl
curl "$API/v1/youtube/video?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0e3GPea1Tyg&cache_max_age=7d" \
-H "x-api-key: $KEY"JavaScript
const query = new URLSearchParams({
url: 'https://www.youtube.com/watch?v=0e3GPea1Tyg',
cache_max_age: '7d',
});
const response = await fetch(`${API}/v1/youtube/video?${query}`, {
headers: { 'x-api-key': KEY },
});
const body = await response.json();
if (!body.success) throw new Error(body.error.code);
// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);Python
import os, httpx
r = httpx.get(
f"{os.environ['API']}/v1/youtube/video",
params={
"url": "https://www.youtube.com/watch?v=0e3GPea1Tyg",
"cache_max_age": "7d",
},
headers={"x-api-key": os.environ["KEY"]},
timeout=30,
)
body = r.json()
if not body["success"]:
raise RuntimeError(body["error"]["code"])
print(body["data"], body["meta"]["creditsCharged"])Example response
Captured on , with raw removed and lists cut to two items. A live call returns current data.
response
{
"success": true,
"data": {
"platform": "youtube",
"id": "0e3GPea1Tyg",
"type": "video",
"url": "https://www.youtube.com/watch?v=0e3GPea1Tyg",
"title": "$456,000 Squid Game In Real Life!",
"text": "MAKE SURE YOU WATCH UNTIL GLASS BRIDGE IT'S INSANE!\n\nWatch Beast Games now on Prime Video!!! https://www.beastgames.com\n\nThank you GoPro for supplying us with cameras to get some of these shots. You can get them here: https://prf.hn/l/6bNbQB3\n\nShoutout to SOKRISPYMEDIA for helping with visuals!\n\nSUB TO ALL CHANNELS\nwww.youtube.com/@UCX6OQ3DkcsbYNE6H8uQQuVA\nwww.youtube.com/@UC4-79UOlP48-QNGgCko5p2g \nwww.youtube.com/@UCIPPMRA040LQr5QPyJEbmXA \nwww.youtube.com/@UCUaT_39o1x6qWjz7K2pWcgw \nwww.youtube.com/@UCAiLfjNXkNv24uhpzUgPa6A \nwww.youtube.com/@UCZzvDDvaYti8Dd8bLEiSoyQ \n\nNew Merch - https://mrbeast.store/\nCheck out Viewstats! - https://www.viewstats.com/\n\nFor any questions or inquiries regarding this video, please reach out to chucky@mrbeastbusiness.com\n\nMusic Provided by https://www.extrememusic.com/\n----------------------------------------------------------------\nfollow all of these or i will kick you\n• Facebook - https://www.facebook.com/MrBeast/\n• Twitter - https://twitter.com/MrBeast\n• Instagram - https://www.instagram.com/mrbeast\n• Im Hiring! - https://www.mrbeastjobs.com/\n--------------------------------------------------------------------",
"authorId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"authorHandle": "MrBeast",
"authorName": "MrBeast",
"thumbnailUrl": "https://i.ytimg.com/vi/0e3GPea1Tyg/maxresdefault.jpg",
"mediaUrls": [],
"durationSeconds": 1541,
"viewCount": 976275040,
"likeCount": 20194663,
"commentCount": null,
"shareCount": null,
"hashtags": [],
"mentions": [],
"isSponsored": false,
"publishedAt": "2021-11-24T13:00:01-08:00",
"fetchedAt": "2026-10-21T01:55:41.807Z"
},
"meta": {
"platform": "youtube",
"endpoint": "youtube.video",
"creditsCharged": 1,
"cached": false,
"cacheAgeSeconds": null,
"durationMs": 9624,
"requestId": "req_u21c9h01902t73pe1pk7"
}
}Returns
Returns one Post.
Cost and behaviour
| Credits | 1 per live request, 0 on a cache hit |
| Cacheable | yes: cache_max_age accepts a cached copy |
| Batchable | yes: usable as a target in POST /v1/jobs/batch |
| Subscribable | yes: as often as every 3600 seconds, firing a webhook only on a change |
Other YouTube endpoints
- /v1/youtube/channel Channel details
- /v1/youtube/channel-videos Channel videos
- /v1/youtube/channel/community-posts Channel community posts
- /v1/youtube/channel/lives Channel live streams
- /v1/youtube/channel/playlists Channel playlists
- /v1/youtube/channel/shorts Channel shorts
- /v1/youtube/community-post Community post details
- /v1/youtube/playlist Playlist contents