YouTube API
The YouTube API returns videos, channels, playlists, comments and transcripts as clean JSON.
🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.
The primary search endpoint returns type-tagged results (video, shorts, channel, playlist) with a continuation token for paging, and you can pull a video_detail, comments, a channel and its videos and shorts, a playlist, related videos, and a video's transcript. It is built for content research, competitor monitoring and AI pipelines that need YouTube data without OAuth quotas or a scraper. One ReefAPI key, one shared credit pool, the standard envelope.
Real request and response JSON
Captured from the indexed primary action, search, on .
{
"method": "POST",
"url": "https://api.reefapi.com/youtube/v1/search",
"headers": {
"x-api-key": "$REEF_KEY",
"content-type": "application/json"
},
"body": {
"query": "lofi hip hop",
"type": "video",
"limit": 20
}
}{
"ok": true,
"meta": {
"api": "youtube",
"endpoint": "search",
"mode": "live",
"latency_ms": 2579.7,
"record_count": 20,
"bytes": 714589,
"cache_hit": false,
"completeness_pct": 100,
"stop_reason": "limit_reached",
"type": "video",
"estimated_results": 811289
},
"data": {
"results": [
{
"type": "video",
"video_id": "n61ULEU7CO0",
"title": "Best of lofi hip hop 2021 ✨ [beats to relax/study to]",
"channel": "Lofi Girl",
"channel_id": "UCSJ4gkVC6NrvII8umztf0Ow",
"views": "55,992,199 views",
"views_int": 55992199,
"published": "4 years ago",
"length": "6:10:58",
"description": "Listen on Spotify, Apple music and more → https://fanlink.tv/BestofLofi2021 The new Lofi Girl compilation “Best of 2021” is out now ...",
"thumbnails": [
{
"url": "[trimmed-depth]",
"width": "[trimmed-depth]",
"height": "[trimmed-depth]"
},
{
"url": "[trimmed-depth]",
"width": "[trimmed-depth]",
"height": "[trimmed-depth]"
}
],
"url": "https://www.youtube.com/watch?v=n61ULEU7CO0"
},
{
"type": "video",
"video_id": "X4VbdwhkE10",
"title": "lofi hip hop radio 📚 beats to relax/study to",
"channel": "Lofi Girl",
"channel_id": "UCSJ4gkVC6NrvII8umztf0Ow",
"views": "9,409 watching",
"views_int": 9409,
"published": null,
"length": null,
"description": "Listen on Spotify, Apple music and more → https://lnk.to/lofi-hiphop-beats-to-relax-study-to02 | Lofi Girl on all social media ...",
"thumbnails": [
{
"url": "[trimmed-depth]",
"width": "[trimmed-depth]",
"height": "[trimmed-depth]"
},
{
"url": "[trimmed-depth]",
"width": "[trimmed-depth]",
"height": "[trimmed-depth]"
}
],
"url": "https://www.youtube.com/watch?v=X4VbdwhkE10"
},
{
"type": "video",
"video_id": "rPjez8z61rI",
"title": "lofi hip hop radio – beats to sleep/study/relax to ☕",
"channel": "STEEZYASFUCK",
"channel_id": "UCsIg9WMfxjZZvwROleiVsQg",
"views": "363 watching",
"views_int": 363,
"published": null,
"length": null,
"description": "Lofi Hip-Hop Beats on Spotify: → https://fanlink.to/LofiHipHop Welcome to our 24/7 lofi hip-hop live stream. Good for relaxing ...",
"thumbnails": [
{
"url": "[trimmed-depth]",
"width": "[trimmed-depth]",
"height": "[trimmed-depth]"
}
],
"url": "https://www.youtube.com/watch?v=rPjez8z61rI"
}
],
"count": 20,
"estimated_results": 811289,
"continuation": "EvAEEgxsb2ZpIGhpcCBob3Aa3ARFcnNEa2dHM0F6b3JFaWQ1YjNWMGRXSmxYMnhwZG1WZlluSnZZV1JqWVhOMFgzTjBZWFIxY3owd0lEcDBlWEJsT25KZ0JFcUhBd29jQ2d4c2IyWnBJR2hwY0NCb2IzRHlBUVVLQTBGc2JOZ0NBYmdEWVFxbEFmSUJDQW9HVTJodmNuUnp3Z0tRQVNoaElIbHZkWFIxWW1WZmMyaHZjblJ6WDJSbFptbHVhWFJwYjI0Z09uUjVjR1U2Y2lBb2JpQjViM1YwZFdKbFgyWnNZV2RmYUdGelgzQnlaVzFwWlhKbFgzWnBaR1Z2WDIxbGRHRmtZWFJoUFRFZ09uUjVjR1U2Y2lrZ0tHNGdlVzkxZEhWaVpWOW1iR0ZuWDJoaGMxOXNhWFpsWDNOMGNtVmhiVjl0WlhSaFpHRjBZVDB4SURwMGVYQmxPbklwS2ZnQ0FiZ0RHZ29XOGdFTENnbFZibmRoZEdOb1pXVEtBZ0lZQWJnREhBb1U4Z0VKQ2dkWFlYUmphR1ZreWdJQ0dBSzRBMG9LT3ZJQkNBb0dWbWxrWlc5endnSWFlVzkxZEhWaVpW",
"query": "lofi hip hop",
"type": "video"
}
}What the YouTube API does
| Action | Description | Concrete use case | Key params |
|---|---|---|---|
| search | search videos/channels/playlists/shorts with filters (upload date, duration, sort order, features) | Content platforms call search to search videos/channels/playlists/shorts with filters (upload date, duration, sort order, feat…. | query, type, limit, continuation, upload_date, ... |
| video_detail | video metadata: title/views/likes/date/channel/description (+ duration/keywords/thumbnails/caption-langs best-effort) | Research tools call video_detail to get video metadata. | video_id |
| video_details | BATCH engagement enrichment — pass up to 50 video_ids in ONE call, get likes + description (+ optional comment_count) per video. Built to enrich channel_videos/channel_shorts lists (which don't carry likes) without one call per video. | Community analysts call video_details to get bATCH engagement enrichment. | video_ids, include_comment_count |
| comments | video comments (text/author/likes/replies), paginated, sortable by top or newest | Media monitors call comments to get video comments (text/author/likes/replies), paginated, sortable by top or newest. | video_id, limit, continuation, sort |
| channel | channel detail: subs/videoCount/description/links | Content platforms call channel to get channel detail. | channel_id, handle, url |
| transcript | video transcript/captions (timed segments + full text) select any language the video has via 'lang'; format=text|segments | Research tools call transcript to get video transcript/captions (timed segments + full text) select any language the video has via…. | video_id, lang, format |
| playlist | list a playlist's videos (id/title/channel/duration/position), paginated | Community analysts call playlist to list a playlist's videos (id/title/channel/duration/position), paginated. | playlist_id, limit, continuation |
| channel_videos | a channel's uploads (Videos tab): video_id/title/views/duration, paginated | Media monitors call channel_videos to get a channel's uploads (Videos tab). | channel_id, handle, url, limit, continuation |
| channel_shorts | a channel's Shorts tab (video_id/title/views/views_int/thumbnails), paginated — the Shorts that the Videos tab (channel_videos) omits; works for shorts-only channels | Content platforms call channel_shorts to get a channel's Shorts tab (video_id/title/views/views_int/thumbnails), paginated. | channel_id, handle, url, limit, continuation |
| related | recommended/related videos for a video_id (from the watch page) | Research tools call related to get recommended/related videos for a video_id (from the watch page). | video_id, limit |
| channel_about | full channel About panel: total views, joined date, country, links, description | Community analysts call channel_about to get full channel About panel. | channel_id, handle, url |
Call search from your stack
curl -X POST https://api.reefapi.com/youtube/v1/search \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"query":"lofi hip hop","type":"video","limit":20}'import requests
r = requests.post(
"https://api.reefapi.com/youtube/v1/search",
headers={"x-api-key": REEF_KEY},
json={
"query": "lofi hip hop",
"type": "video",
"limit": 20
},
)
print(r.json()["data"])const res = await fetch("https://api.reefapi.com/youtube/v1/search", {
method: "POST",
headers: {
"x-api-key": process.env.REEF_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
"query": "lofi hip hop",
"type": "video",
"limit": 20
}),
});
const { ok, data, meta, error } = await res.json();Ask your MCP-connected assistant: call reefapi.youtube.search with {"query":"lofi hip hop","type":"video","limit":20}.Who uses this API and why
- Content teams call search and channel_videos to track a competitor's uploads and performance.
- AI and research pipelines pull transcript to summarize or search the spoken content of a video.
- Comment-analysis tools use comments to measure audience sentiment on a video at scale.
Questions developers ask before integrating
What is the YouTube API?
YouTube API is a ReefAPI endpoint group for video details, search, comments and transcripts. It returns live JSON through POST requests under /youtube/v1.
Is the YouTube API free to try?
Yes. ReefAPI starts with 1,000 free credits, no card required. YouTube calls use the same shared credit balance as every other ReefAPI engine.
Do I need a YouTube login or account?
No login to YouTube is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.
How fresh is the YouTube data?
The page example is captured from a live search call, and production requests fetch live data through ReefAPI rather than a static sample.
How many credits does the YouTube API use?
YouTube actions currently cost 1-2 credits per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.
Can I call YouTube from an AI assistant or MCP client?
Yes. Connect ReefAPI once through MCP and your assistant can call youtube actions with the same key, credit pool and JSON envelope used by normal REST requests.
Is the YouTube API a YouTube scraper?
It is the managed alternative to a DIY YouTube scraper. Instead of building and maintaining your own scraper — proxies, headless browsers, captcha and constant breakage — you call one ReefAPI endpoint and get the same video details, search, comments and transcripts back as clean JSON.
Why does my YouTube scraper keep getting blocked?
Most YouTube scrapers break on anti-bot defenses, rate limits and IP bans that need rotating residential proxies and browser fingerprinting to clear. ReefAPI handles all of that for you — no proxies, no captchas, no maintenance — and returns live JSON. Blocked or failed calls are free.