Last updated
ChangelogYouTube API
HealthyRead-onlyYouTube data as JSON: search videos, shorts, channels and playlists, video details and comments, channel profiles and uploads, playlist contents, and search suggestions. Generated from youtube.com.
/search5 credits per callSearch
Search YouTube and return one page (~20) of results: videos, shorts, channels and playlists, each with its id, url, title, channel, view count, publish time, duration and thumbnail where applicable, plus `next_page_token` for the following page and `estimated_results`.
Authorization: Bearer <key> on every request.Parameters
search text
all, video, short, channel, playlist or movie
relevance or popularity
any, today, week, month or year
any, short (under 3 min), medium (3-20 min) or long (over 20 min)
`next_page_token` from a previous call to get the next page (other parameters are then ignored)
Response fields
querye.g."python tutorial"estimated_resultse.g.10051029results
typee.g."video"video_ide.g."ix9cRaBkVe0"urle.g."https://www.youtube.com/watch?v=ix9cRaBkVe0"titlee.g."Python Full Course for free 🐍"channel_namee.g."Bro Code"channel_ide.g."UC4SVo0Ue36XCfOyb5Lh1viQ"channel_handlee.g."@BroCodez"publishede.g."2 years ago"duratione.g."12:00:00"duration_secondse.g.43200views_texte.g."13,587,986 views"viewse.g.13587986is_livee.g.falsedescription_snippete.g."python #tutorial #beginners Python tutorial for beginners' full course 2024 *Learn Python in 1 HOUR* ..."thumbnaile.g."https://i.ytimg.com/vi/ix9cRaBkVe0/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLDsLPZCX5PFS2a-Wng9IwGAduPqOQ"next_page_tokene.g."Es4FEg9weXRob24gdHV0b3JpYWwaugVTQlNDQVF0cGVEbGpVbUZDYTFabE1JSUJDMHMxUzFaRlZUTmhZV1ZSZ2dFTGEzRjBSRFZrY0c0NVF6aUNBU0pRVEhONVpXOWllbGQ0YkRkd2IwdzVTbFJXZVc1a1MyVTJNbWxsYjA0dFRWb3pnZ0VMWmxkcWMyUm9Vak42TTJPQ0FTSlFUSE41Wlc5aWVsZDRiRGR2YlVSdlJWbHljbVl6YjFoMldIaGhOazFRWjJWcmdnRUxYM1ZSY2tvd1ZHdGFiR09DQVF0NlJrRTBjR04wVWxJeFo0SUJJbEJNTFc5emFVVTRNRlJsVkhReVpEbGlabFo1VkdsWVNrRXRWVlJJYmpaWGQxV0NBUXR5Wm5OalZsTXdkblJpZDRJQklsQk1XbEJhY1RCeVgxSmFUMDlyVlZGaVlYUTRUSGxSYVdrek5tTktaakpUVjFTQ0FTSlFURmRMYW1oS2RIRldRV0p1Y1VKNFkyUnFWa2RuVkROMVZsSXhNR0o2VkVWQ2dnRWlVRXhVYWxKMlJHOTZjbVJzZUdvMWQyZElOSEZyZG5kVFQyUklURTlEZURFd1pvSUJJbEJNTFc5emFVVTRNRlJsVkhOcmNtRndUbUo2V0doM2IwWlZhVXhEYWtkbldUZUNBU0pRVEhVd1YxODViRWxKT1dGbmQyZ3hXR3BTZERJME1uaEpjRWhvVUZReWJHeG5nZ0VpVUV4SGFuQnNUa1ZSTVdsME9DMHdRMjF2YkdwVE5YbGxWaTFIYkV0VFZVVjBNSUlCQzIwMk55MWlUM0JQYjFCVmdnRUxVbTlmVFZOalZFUm1WVFNDQVF0ME9IQlFaRXRaY0c5M1NZSUJJbEJNVG1OblgwWldPVzQzY1ZwSFprWnNNa0ZPU1Y5NlNWTjZUbkF5TlRkTWQyNnlBUVlLQkFnVUVBSSUzRBiB4OgYIgtzZWFyY2gtZmVlZA%3D%3D"curl "https://api.maviapi.com/v1/sites/youtube/search?query=python%20tutorial&type=all&sort=relevance&upload_date=any&duration=any" \-H "Authorization: Bearer $MAVI_KEY"
{
"query": "python tutorial",
"estimated_results": 10051029,
"results": [
{
"type": "video",
"video_id": "ix9cRaBkVe0",
"url": "https://www.youtube.com/watch?v=ix9cRaBkVe0",
"title": "Python Full Course for free 🐍",
"channel_name": "Bro Code",
"channel_id": "UC4SVo0Ue36XCfOyb5Lh1viQ",
"channel_handle": "@BroCodez",
"published": "2 years ago",
"duration": "12:00:00",
"duration_seconds": 43200,
"views_text": "13,587,986 views",
"views": 13587986,
"is_live": false,
"description_snippet": "python #tutorial #beginners Python tutorial for beginners' full course 2024 *Learn Python in 1 HOUR* ...",
"thumbnail": "https://i.ytimg.com/vi/ix9cRaBkVe0/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLDsLPZCX5PFS2a-Wng9IwGAduPqOQ"
}
],
"next_page_token": "Es4FEg9weXRob24gdHV0b3JpYWwaugVTQlNDQVF0cGVEbGpVbUZDYTFabE1JSUJDMHMxUzFaRlZUTmhZV1ZSZ2dFTGEzRjBSRFZrY0c0NVF6aUNBU0pRVEhONVpXOWllbGQ0YkRkd2IwdzVTbFJXZVc1a1MyVTJNbWxsYjA0dFRWb3pnZ0VMWmxkcWMyUm9Vak42TTJPQ0FTSlFUSE41Wlc5aWVsZDRiRGR2YlVSdlJWbHljbVl6YjFoMldIaGhOazFRWjJWcmdnRUxYM1ZSY2tvd1ZHdGFiR09DQVF0NlJrRTBjR04wVWxJeFo0SUJJbEJNTFc5emFVVTRNRlJsVkhReVpEbGlabFo1VkdsWVNrRXRWVlJJYmpaWGQxV0NBUXR5Wm5OalZsTXdkblJpZDRJQklsQk1XbEJhY1RCeVgxSmFUMDlyVlZGaVlYUTRUSGxSYVdrek5tTktaakpUVjFTQ0FTSlFURmRMYW1oS2RIRldRV0p1Y1VKNFkyUnFWa2RuVkROMVZsSXhNR0o2VkVWQ2dnRWlVRXhVYWxKMlJHOTZjbVJzZUdvMWQyZElOSEZyZG5kVFQyUklURTlEZURFd1pvSUJJbEJNTFc5emFVVTRNRlJsVkhOcmNtRndUbUo2V0doM2IwWlZhVXhEYWtkbldUZUNBU0pRVEhVd1YxODViRWxKT1dGbmQyZ3hXR3BTZERJME1uaEpjRWhvVUZReWJHeG5nZ0VpVUV4SGFuQnNUa1ZSTVdsME9DMHdRMjF2YkdwVE5YbGxWaTFIYkV0VFZVVjBNSUlCQzIwMk55MWlUM0JQYjFCVmdnRUxVbTlmVFZOalZFUm1WVFNDQVF0ME9IQlFaRXRaY0c5M1NZSUJJbEJNVG1OblgwWldPVzQzY1ZwSFprWnNNa0ZPU1Y5NlNWTjZUbkF5TlRkTWQyNnlBUVlLQkFnVUVBSSUzRBiB4OgYIgtzZWFyY2gtZmVlZA%3D%3D"
}Get all the data, no code
Collect every page of GET /search into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.
Use YouTube API from Claude, ChatGPT and your coding tools
Add this URL as a custom connector and sign in to maviapi. Nothing to install.
https://mcp.maviapi.com/mcpOr run it locally, with each endpoint of YouTube API as its own tool:
claude mcp add maviapi -e MAVIAPI_TOOLS=youtube -- npx -y '@maviapi/mcp'Import YouTube API into Postman and other tools
How to importPaste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.
- OpenAPI 3.1
https://api.maviapi.com/v1/apis/youtube/openapi.json - Postman
https://api.maviapi.com/v1/apis/youtube/postman.json
The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.
Build with the YouTube API
Choose a starting endpoint
- Search
GET /searchSearch YouTube and return one page (~20) of results: videos, shorts, channels and playlists, each with its id, url, title, channel, view count, publish time, duration and thumbnail where applicable, plus `next_page_token` for the following page and `estimated_results`.
Parameters and response fields for GET /search
Request parameters Name Type / location Required Description query string / query No search text type string / query No all, video, short, channel, playlist or movie sort string / query No relevance or popularity upload_date string / query No any, today, week, month or year duration string / query No any, short (under 3 min), medium (3-20 min) or long (over 20 min) page_token string / query No `next_page_token` from a previous call to get the next page (other parameters are then ignored) Response fields Field Type Description query string estimated_results integer results object[] results[].type string results[].video_id string results[].url string results[].title string results[].channel_name string results[].channel_id string results[].channel_handle string results[].published string results[].duration string results[].duration_seconds integer results[].views_text string results[].views integer results[].is_live boolean results[].description_snippet string results[].thumbnail string next_page_token string - Transcript
GET /transcriptThe transcript (captions) of a video in one language, as `rows` of `start` and `duration` (seconds) and `text`, plus every caption language the video has (`languages`, each with code, name and whether it is auto-generated). Human-made captions are preferred over auto-generated ones in the same language. A video without captions returns empty `languages` and `rows`.
Parameters and response fields for GET /transcript
Request parameters Name Type / location Required Description video_id string / query No 11-character video id, or any youtube.com / youtu.be video URL lang string / query No caption language code such as en, de or pt-BR (a bare code like pt also matches pt-BR); one of the video's `languages`. Omit for the video's own default caption language. Response fields Field Type Description video_id string title string language string language_name string is_auto_generated boolean languages object[] languages[].code string languages[].name string languages[].is_auto_generated boolean rows object[] rows[].start number rows[].duration number rows[].text string - Search V2
GET /search_v2Search YouTube and return one page of results (videos, shorts, channels, playlists) in YouTube's own ranking, like /search, with cleaner fields: every video and short row carries `published_at` (ISO 8601 upload date-time with its UTC offset), `duration_seconds` (integer, the real video length; null for a live stream) and `views` (exact integer). Also returns `next_page_token` and `estimated_results`. Invalid parameter values answer 400 naming the parameter.
Parameters and response fields for GET /search_v2
Request parameters Name Type / location Required Description query string / query No search text type string / query No all, video (regular videos only: no shorts, channels or playlists), short, channel, playlist or movie Allowed values: all, video, short, channel, playlist, movie. sort string / query No relevance or popularity Allowed values: relevance, popularity. upload_date string / query No any, today, week, month or year Allowed values: any, today, week, month, year. duration string / query No any, short (under 4 min), medium (4-20 min) or long (over 20 min), YouTube's own length buckets Allowed values: any, short, medium, long. min_duration integer / query No keep only videos/shorts at least this many seconds long (drops channels, playlists and live streams) max_duration integer / query No keep only videos/shorts at most this many seconds long (drops channels, playlists and live streams) lang string / query No ISO 639-1 language code (e.g. en, de, ja); results in that language are ranked first region string / query No ISO 3166-1 alpha-2 country code (e.g. US, DE, JP) the search is run for page_token string / query No `next_page_token` from a previous call; it carries that call's filters, so other parameters are ignored Response fields Field Type Description query string estimated_results integer results object[] results[].type string results[].video_id string results[].url string results[].title string results[].channel_name string results[].channel_id string results[].channel_handle string results[].published string results[].published_at string results[].duration string results[].duration_seconds integer results[].views_text string results[].views integer results[].is_live boolean results[].description_snippet string results[].thumbnail string next_page_token string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor string fetched_at string age integer - Comments
GET /commentsOne page (~20) of comments on a video, each with comment id, text, author (name, channel id, verified/creator flags), published time, like count, reply count, and a `replies_token` that, passed back as `page_token`, lists that comment's replies. Also returns the total comment count (first page) and `next_page_token`.
Parameters and response fields for GET /comments
Request parameters Name Type / location Required Description video_id string / query No 11-character video id or video URL sort string / query No top or newest page_token string / query No `next_page_token` or a comment's `replies_token` from a previous call (video_id/sort then ignored) Response fields Field Type Description video_id string total_comments integer comments object[] comments[].comment_id string comments[].text string comments[].published string comments[].is_reply boolean comments[].author_name string comments[].author_channel_id string comments[].author_avatar string comments[].author_is_verified boolean comments[].author_is_creator boolean comments[].likes_text string comments[].likes integer comments[].replies integer comments[].replies_token string next_page_token string - Search Suggestions
GET /search_suggestionsYouTube search autocomplete suggestions for a partial query, as a list of strings (up to ~10).
Parameters and response fields for GET /search_suggestions
Request parameters Name Type / location Required Description query string / query No partial search text Response fields Field Type Description query string suggestions string[] - Transcripts
GET /transcriptsTranscripts of up to 20 videos in one call, in the order given. Each row in `videos` has `id`, `title`, `language` (caption language code used), `language_name`, `is_auto_generated`, `segments` (each `start` and `duration` in seconds, and `text`) and `chapters` from the video description (each `start` in seconds and `title`; empty when the description lists none). A video without captions, or that cannot be fetched, gives a row with `id` and `error` (`code`, `message`) instead of failing the call; `code` is `invalid_id`, `unavailable`, `no_transcript` or `fetch_failed`.
Parameters and response fields for GET /transcripts
Request parameters Name Type / location Required Description ids string / query No comma-separated video ids or video URLs, at most 20 (duplicates are dropped) lang string / query No comma-separated caption language codes in order of preference, such as `de,en` (a bare code like pt also matches pt-BR); when none of them exists the video's original caption language is used. Empty for always the original. Response fields Field Type Description count integer videos object[] videos[].id string videos[].title string videos[].language string videos[].language_name string videos[].is_auto_generated boolean videos[].segments object[] videos[].segments[].start number videos[].segments[].duration number videos[].segments[].text string videos[].chapters string[] pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - Video
GET /videoFull details of one video: title, description, channel (id, name, handle, subscribers), publish date, duration, view/like/comment counts, category, keywords, live/short flags, thumbnail and related videos.
Parameters and response fields for GET /video
Request parameters Name Type / location Required Description video_id string / query No 11-character video id, or any youtube.com / youtu.be video URL Response fields Field Type Description video_id string url string title string description string channel_id string channel_name string channel_handle string channel_subscribers_text string channel_subscribers integer published string upload_date string duration_seconds integer views integer likes integer comments integer category string keywords string[] is_live_content boolean is_live_now boolean is_short boolean is_family_safe boolean is_unlisted boolean available_countries_count integer thumbnail string related object[] related[].type string related[].video_id string related[].url string related[].title string related[].channel_name string related[].channel_id string related[].published string related[].views_text string related[].views integer related[].duration string related[].duration_seconds integer related[].thumbnail string - Channel
GET /channelProfile of a YouTube channel: id, title, handle, description, subscriber/video/view counts, join date, country, external links, avatar, banner and keywords.
Parameters and response fields for GET /channel
Request parameters Name Type / location Required Description channel string / query No channel id (UC...), @handle, or channel URL Response fields Field Type Description channel_id string url string title string handle string description string subscribers_text string subscribers integer video_count integer view_count integer joined string country string links object[] links[].title string links[].url string keywords string is_family_safe boolean avatar string banner string rss_url string - Playlist
GET /playlistA playlist's details (title, description, owner channel, video count, total views) and one page (up to ~100) of its videos in order, each with id, url, title, channel, views, published time, duration and thumbnail, plus `next_page_token`.
Parameters and response fields for GET /playlist
Request parameters Name Type / location Required Description playlist_id string / query No playlist id (PL..., UU..., OLAK...) or a playlist URL page_token string / query No `next_page_token` from a previous call to get the next page of videos (playlist_id then ignored) Response fields Field Type Description playlist_id string url string title string description string channel_name string channel_id string video_count integer views integer thumbnail string videos object[] videos[].type string videos[].video_id string videos[].url string videos[].title string videos[].channel_name string videos[].channel_id string videos[].published string videos[].views_text string videos[].views integer videos[].duration string videos[].duration_seconds integer videos[].thumbnail string next_page_token string - Channel Videos
GET /channel_videosOne page (~30) of a channel's uploads: videos, shorts, live streams or playlists, each with id, url, title, views, published time, duration and thumbnail, plus `next_page_token`.
Parameters and response fields for GET /channel_videos
Request parameters Name Type / location Required Description channel string / query No channel id (UC...), @handle, or channel URL tab string / query No videos, shorts, live or playlists sort string / query No latest, popular or oldest (videos, shorts and live tabs) page_token string / query No `next_page_token` from a previous call (other parameters are then ignored) Response fields Field Type Description channel_id string channel_title string tab string sort string items object[] items[].type string items[].video_id string items[].url string items[].title string items[].channel_name string items[].channel_id string items[].published string items[].views_text string items[].views integer items[].duration string items[].duration_seconds integer items[].thumbnail string next_page_token string
Export YouTube data to CSV
Each list below downloads as a CSV file with one row per record. Collect it into a dataset with "Get all the data, no code" under the console above. The dataset reads the list page by page, and you download it as CSV, JSON or JSONL.
| List | CSV columns |
|---|---|
SearchGET /search | type, video_id, url, title, channel_name, channel_id, channel_handle, published, duration, duration_seconds, views_text, views, is_live, description_snippet, thumbnail |
Search V2GET /search_v2 | type, video_id, url, title, channel_name, channel_id, channel_handle, published, published_at, duration, duration_seconds, views_text, views, is_live, description_snippet, thumbnail |
CommentsGET /comments | comment_id, text, published, is_reply, author_name, author_channel_id, author_avatar, author_is_verified, author_is_creator, likes_text, likes, replies, replies_token |
TranscriptsGET /transcripts | id, title, language, language_name, is_auto_generated, segments, chapters |
VideoGET /video | type, video_id, url, title, channel_name, channel_id, published, views_text, views, duration, duration_seconds, thumbnail |
PlaylistGET /playlist | type, video_id, url, title, channel_name, channel_id, published, views_text, views, duration, duration_seconds, thumbnail |
Channel VideosGET /channel_videos | type, video_id, url, title, channel_name, channel_id, published, views_text, views, duration, duration_seconds, thumbnail |
A nested value (a list or an object) is written as JSON in one cell. How datasets and exports work
YouTube API questions
What you get, what it costs and how to call it.
Is there an official YouTube API?
Yes. Google offers the YouTube Data API, covering videos, channels, playlists and search results; it needs a Google Account and an API key, and usage has a quota. Source: YouTube Data API (checked 2026-11-25). This YouTube API is a separate, unofficial one: an independent, hosted API from maviapi for the public data on youtube.com. It is not made, endorsed or supported by YouTube.
What data can I get from the YouTube API?
The YouTube API has 10 endpoints. Each returns JSON with the parameters and fields documented above:
- GET
/search: Search YouTube and return one page (~20) of results: videos, shorts, channels and playlists, each with its id, url, title, channel, view count, publish time… - GET
/transcript: The transcript (captions) of a video in one language, as `rows` of `start` and `duration` (seconds) and `text`, plus every caption language the video has… - GET
/search_v2: Search YouTube and return one page of results (videos, shorts, channels, playlists) in YouTube's own ranking, like /search, with cleaner fields: every video… - GET
/comments: One page (~20) of comments on a video, each with comment id, text, author (name, channel id, verified/creator flags), published time, like count, reply count… - GET
/search_suggestions: YouTube search autocomplete suggestions for a partial query, as a list of strings (up to ~10). - GET
/transcripts: Transcripts of up to 20 videos in one call, in the order given. - GET
/video: Full details of one video: title, description, channel (id, name, handle, subscribers), publish date, duration, view/like/comment counts, category, keywords… - GET
/channel: Profile of a YouTube channel: id, title, handle, description, subscriber/video/view counts, join date, country, external links, avatar, banner and keywords. - GET
/playlist: A playlist's details (title, description, owner channel, video count, total views) and one page (up to ~100) of its videos in order, each with id, url, title… - GET
/channel_videos: One page (~30) of a channel's uploads: videos, shorts, live streams or playlists, each with id, url, title, views, published time, duration and thumbnail…
How much does the YouTube API cost?
Calls are paid in credits from your maviapi plan, and only successful calls are charged. Every endpoint of this API costs 5 credits per call. On the Hobby plan ($49 a month for 250,000 credits), 1,000 calls cost about $0.98. Failed calls are free. The Free plan gives you 1,000 credits a month, with no credit card required. See plans and credit prices for everything after that.
How do I call the YouTube API?
Send an HTTPS request to the endpoint with your API key in the Authorization header. For example, GET /search:
curl 'https://api.maviapi.com/v1/sites/youtube/search' \
-H "Authorization: Bearer $MAVI_KEY"Create a key on your API keys page, or try any endpoint first in the console above with the free test key.
What are the ways to get YouTube data as JSON?
Each way to get YouTube data as JSON fits a different need:
- YouTube Data API: Google offers the YouTube Data API, covering videos, channels, playlists and search results; it needs a Google Account and an API key, and usage has a quota. Better when you need write access, account data or an agreement with YouTube.
- Your own scraper: Full control and no vendor, but the parsing, the blocked requests and the repairs after every change on youtube.com are yours. Better for a one-off pull from a page that rarely changes.
- Apify: A marketplace of Actors you run, where input, output and price are set by each Actor. Better when an Actor already returns what you need, or you want to host your own code. See maviapi vs Apify.
- RapidAPI: A hub of APIs added by many providers, called with one RapidAPI key and priced per API. Better when you already use the hub and one of its APIs covers what you need. Source: RapidAPI docs.
- maviapi: The YouTube API on this page: 10 documented endpoints, a published response schema and one key for the whole catalog. Better when this data is part of your product and you do not want to maintain a scraper.
What happens when youtube.com changes its layout?
Your code does not change. maviapi keeps the YouTube API working when youtube.com changes its pages, so you keep calling the same endpoints and get JSON in the shape documented here. See its current health on the status page and what changed in its changelog.
Will an update break my YouTube API integration?
No. An endpoint you use never changes shape: new fields, optional parameters and endpoints are added beside it, and a change that would break a call ships as a new endpoint. Ignore response fields you do not know, and follow the changelog for what is new.
Related APIs
- Instagram API
Public Instagram profiles and posts as JSON: follower and post counts, latest posts with captions, hashtags, likes…
- Tripadvisor API
Trip-planning data from Tripadvisor: geo search plus attractions, restaurants and hotels by location (geo_id), with…
- Google Maps API
Structured data from maps.google.com.