YouTube Video Metadata API
The FetchTranscript YouTube Video Metadata API returns everything public about a video as one JSON object: title, full description, channel name and ID, duration, view, like and comment counts, upload date, thumbnail, tags and categories. A second endpoint returns the video’s chapters with their start and end times. Both take the 11-character video ID and an API key, with no OAuth and no ownership of the video required.
No credit card needed. One API key works on every endpoint.
Quick example
/v1/videos/{video_id}/v1/videos/{video_id}/chaptersThe example uses jNQXAC9IVRw, “Me at the zoo”, the first video ever uploaded to YouTube. Send your key in the X-API-Key header.
# Metadata
curl "https://api.fetchtranscript.com/v1/videos/jNQXAC9IVRw" \
-H "X-API-Key: yt_your_api_key"
# Chapters
curl "https://api.fetchtranscript.com/v1/videos/jNQXAC9IVRw/chapters" \
-H "X-API-Key: yt_your_api_key"Sample response
The description is shortened here. Notice the timestamps at its end: they are where this video’s chapters come from.
{
"video_id": "jNQXAC9IVRw",
"title": "Me at the zoo",
"description": "Microplastics are accumulating in human brains at an alarming rate\nhttps://www.youtube.com/watch?v=0PT5c1z3LL8\n\n...\n\n00:00 Intro\n00:05 The cool thing\n00:17 End",
"channel_id": "UC4QobU6STFB0P71PMvOGN5A",
"channel_name": "jawed",
"duration": 19,
"view_count": 449031223,
"like_count": 20144379,
"comment_count": 10000000,
"upload_date": "20050424",
"thumbnail_url": "https://i.ytimg.com/vi_webp/jNQXAC9IVRw/maxresdefault.webp",
"tags": ["me at the zoo", "jawed karim", "first youtube video"],
"categories": ["Film & Animation"]
}Illustrative values: a real response carries the live data of the video or channel you ask for.
| Field | Type | Description |
|---|---|---|
| video_id | string | The video ID you asked for. |
| title | string | The video title. |
| description | string | null | The full description, with line breaks and links as the creator wrote them. |
| channel_id | string | null | The ID (UC…) of the channel that published the video. |
| channel_name | string | null | The channel name. |
| duration | integer | null | Length in seconds. |
| view_count | integer | null | Views. |
| like_count | integer | null | Likes; null when they are hidden. |
| comment_count | integer | null | Number of comments, sometimes rounded by YouTube. |
| upload_date | string | null | Upload date as YYYYMMDD, for example 20050424. |
| thumbnail_url | string | null | URL of the largest thumbnail available. |
| tags | string[] | The tags the creator set; an empty list when there are none. |
| categories | string[] | The YouTube category of the video, such as Music or Education. |
Parameters
| Parameter | In | Type | Default | Description |
|---|---|---|---|---|
| video_id | path | string | required | The 11-character YouTube video ID, the same for both endpoints. Anything else is refused with 400 invalid_video_id; a private, removed or non-existent video gets 404 video_not_found. |
There are no query parameters: one request returns every field. Authentication errors are 401 missing_api_key or invalid_api_key, an empty balance is 402 insufficient_credits, and 503 service_unavailable means YouTube could not be reached: retry after a moment. Metadata is cached for 24 hours, chapters for seven days.
YouTube chapters API
Chapters split a video into named sections, the ones you see on the progress bar of the YouTube player. GET /v1/videos/{video_id}/chapters returns them in order with their start and end times in seconds, so you can link to a section with &t= or cut a transcript at the same points.
{
"video_id": "jNQXAC9IVRw",
"chapters": [
{ "title": "Intro", "start_time": 0.0, "end_time": 5.0 },
{ "title": "The cool thing", "start_time": 5.0, "end_time": 17.0 },
{ "title": "End", "start_time": 17.0, "end_time": 19.0 }
],
"has_chapters": true
}| Field | Type | Description |
|---|---|---|
| video_id | string | The video ID you asked for. |
| chapters | array | The chapters in playback order; an empty list when the video has none. |
| chapters[].title | string | The chapter title. |
| chapters[].start_time | number | Where the chapter starts, in seconds from the beginning of the video. |
| chapters[].end_time | number | null | Where it ends, in seconds. |
| has_chapters | boolean | False when the video has no chapters. |
Because transcript segments carry their start time too, you can group a transcript by chapter in a few lines. Two calls, two credits, and a long video becomes a set of titled sections ready for a summary or a vector store:
from fetchtranscript import FetchTranscriptClient
client = FetchTranscriptClient(api_key="yt_your_api_key")
video_id = "jNQXAC9IVRw"
transcript = client.transcripts.get(video_id) # JSON with timed segments
chapters = client.videos.get_chapters(video_id)["chapters"]
for chapter in chapters:
end = chapter["end_time"] or float("inf")
text = " ".join(
segment["text"]
for segment in transcript["segments"]
if chapter["start_time"] <= segment["start"] < end
)
print(f"## {chapter['title']}\n{text}\n")Use cases
Enriching transcripts and datasets
Store the title, channel, upload date, duration and tags next to each transcript, so you can filter a corpus by date or channel and cite every source properly.
Link previews and cards
Show a rich card when a user pastes a YouTube link: title, thumbnail, channel and duration, without embedding the player.
Performance tracking
Record views, likes and comment count once a day and chart how videos perform after publication, for your own channel or the ones you benchmark against.
Catalogues and search indexes
Index videos by tags and categories so users can browse and filter them, and use the description to add links and context to each entry.
Chapter navigation
Build a table of contents with deep links to each chapter, or let a viewer jump to the part of a long tutorial they need.
Smarter chunking for LLMs
Split long transcripts on chapter boundaries instead of arbitrary token counts, so each chunk in your vector store covers one topic and carries its chapter title.
Video metadata and the official YouTube Data API
Google’s YouTube Data API returns video details with videos.list, which costs 1 quota unit per call according to Google’s quota cost table, within a default allocation of 10,000 units per day per project. FetchTranscript has no daily quota: a credit per successful call and up to 500 requests per minute, with the same key you use for transcripts, comments and search.
Pricing
The metadata of a video costs one credit, and its chapters one more. Calls that fail, such as a request for a removed video, cost nothing.
- 25 free calls every month, no credit card
- Then $1 per 1,000 calls, pay as you go
- Only successful calls are billed: errors cost nothing
- Credits never expire; bulk packs from 10,000 calls for $9
Also in the MCP server for AI assistants
The FetchTranscript MCP server gives Claude, Cursor and other MCP clients the same data as tools: get_video_metadata, get_chapters and get_transcript. An assistant asked “summarize the third chapter of this talk” can call get_chapters to find where it starts and get_transcript to read it.
Run it with uvx fetchtranscript-mcp and your API key in FETCHTRANSCRIPT_API_KEY; the MCP server guide has the configuration for each client. Tool calls are billed like API calls.
YouTube Video Metadata API: frequently asked questions
- What does the YouTube video metadata API return?
- Title, full description, channel name and ID, duration in seconds, view, like and comment counts, upload date, thumbnail URL, tags and categories, in one JSON object per video.
- What format is the upload date in?
- A YYYYMMDD string, for example "20050424" for 24 April 2005. Parse it with datetime.strptime(value, "%Y%m%d") in Python or by slicing it in JavaScript.
- How fresh are the view and like counts?
- They are read from YouTube and cached for up to 24 hours, so a count can be a day old. That is enough for daily tracking; the comment count can also be rounded by YouTube.
- How do I get the chapters of a YouTube video?
- Call GET /v1/videos/{video_id}/chapters. You get each chapter’s title, start time and end time in seconds. If the video has no chapters, has_chapters is false and the list is empty, and the call still succeeds.
- Do I need to own the video or use OAuth?
- No. The endpoints return the public information anyone can see on the video’s page, and you authenticate with your FetchTranscript API key only.
- How much does it cost?
- One credit per successful call: metadata and chapters are separate calls. Every account gets 25 free calls per month, then it is $1 per 1,000 calls.
Related APIs
- YouTube Transcript APIThe full transcript of a video as timed JSON, plain text or SRT.
- YouTube Comments APIUp to 500 comments of a video as JSON, with author, likes, date and pinned flag.
- YouTube Search APISearch YouTube by keyword and get up to 50 videos with channel, duration and views.
- YouTube Channel APIA channel’s details by @handle or ID, and the list of its videos page by page.
- YouTube Subtitles APICaptions as SRT, plain text or timed JSON, in every language a video has.
Every parameter and error code is in the videos section of the API reference.
Get video metadata and chapters
Create an account and get 25 free calls every month. The code examples show the metadata call next to transcripts in Python and TypeScript.