YouTube transcript API: get a video's transcript with timestamps
Full transcript of a YouTube video with timed segments, word count, keywords, key points and sentiment.
About the Video transcript endpoint
The YouTube transcript API returns a video's spoken content as text from its video ID: every caption segment with start time and duration, the transcript language and whether it was auto-generated, plus word count, extracted keywords, key points, a short conclusion and sentiment. It turns YouTube captions and subtitles into data your app can search, summarise or feed to a language model.
What you can build with it
- Summarising videos and feeding transcripts to AI models
- Making video content searchable by what is said
- Subtitle and caption extraction for accessibility and translation
- Content research across a channel's videos
Request
https://socialgraph.dev/api/v1/youtube/transcript
Send your API key as Authorization: Bearer YOUR_API_KEY.
Parameters go in the query string.
Parameters
| Name | Type | Description |
|---|---|---|
video_idrequired |
string | YouTube video ID, the part after v= in the URL, e.g. OYp5j2RihPE. |
languagesoptional |
string | Preferred transcript language code, e.g. en or hi. Defaults to en. If that language isn't available, another available transcript is returned; check language_code in the response. |
Code examples
Example response
{
"url": "https://www.youtube.com/watch?v=OYp5j2RihPE",
"keywords": [
"image",
"antigravity",
"agent",
"geometry",
"blender",
"gemini",
"argon",
"lighting",
"prompt",
"model"
],
"language": "English",
"video_id": "OYp5j2RihPE",
"sentiment": {
"label": "neutral",
"neutral": 0.9796,
"compound": 0.0059,
"negative": 0.0102,
"positive": 0.0103,
"sentence_counts": {
"neutral": 10,
"negative": 1,
"positive": 1
}
},
"conclusion": "Can an AI agent look at a 2D image that uses complex architectural geometry and build it inside Blender on its own? Next, I fed that image into my terminal connecting Antigravity directly to Blender via the MCP. An agent even automatically overlaid these comparison strips against the reference image to get the geometry closer, iteration after iteration.",
"key_points": [
"Can an AI agent look at a 2D image that uses complex architectural geometry and build it inside Blender on its own?",
"Next, I fed that image into my terminal connecting Antigravity directly to Blender via the MCP.",
"An agent even automatically overlaid these comparison strips against the reference image to get the geometry closer, iteration after iteration.",
"The model automatically dialed in volumetric fog, camera depth and audio-reactive sunlight And here's the final result: from a flat 2D prompt to a fully realized light-mapped, 3D cathedral walkthrough.",
"All driven by Gemini 4 Argon in Antigravity."
],
"transcript": {
"text": "Can an AI agent look at a 2D image that uses complex architectural geometry and build it inside Blender on its own? This is how I use Gemini 4 Argon and Antigravity to do so. I started in Flow, prompting for an empty catherdral with specific lighting and angles. I chose this particular image of the repeating arches and columns that creates this perspective effect. Next, I fed that image into my terminal connecting Antigravity directly to Blender via the MCP. I kicked off an agentic loop prompt. For 45 rounds, the model iteratively built the base mesh. An agent even automatically overlaid these comparison strips against the reference image to get the geometry closer, iteration after iteration. Once the structure was locked, I paused the CLI to trigger target targeted micro-loops for column fluting and floor textures. Then came lighting. The model automatically dialed in volumetric fog, camera depth and audio-reactive sunlight And here's the final result: from a flat 2D prompt to a fully realized light-mapped, 3D cathedral walkthrough. All driven by Gemini 4 Argon in Antigravity.",
"segments": [
{
"text": "Can an AI agent look at a 2D image",
"start": 0,
"duration": 2.96
},
{
"text": "that uses complex architectural geometry",
"start": 2.96,
"duration": 2.46
},
{
"text": " and build it inside Blender on its own?",
"start": 5.42,
"duration": 1.71
},
{
"text": "This is how I use Gemini 4 Argon\nand Antigravity to do so.",
"start": 7.13,
"duration": 3.54
},
{
"text": "I started in Flow, prompting for an empty catherdral",
"start": 10.68,
"duration": 3.17
},
{
"text": "with specific lighting and angles.",
"start": 13.85,
"duration": 2.67
},
{
"text": "I chose this particular image",
"start": 16.52,
"duration": 2.13
},
{
"text": "of the repeating arches and columns",
"start": 18.64,
"duration": 2
},
{
"text": "that creates this perspective effect.",
"start": 20.64,
"duration": 1.83
},
{
"text": "Next, I fed that image into my terminal",
"start": 22.48,
"duration": 2.67
},
{
"text": "connecting Antigravity directly to Blender via the MCP.",
"start": 25.15,
"duration": 4.09
},
{
"text": "I kicked off an agentic loop prompt.",
"start": 29.24,
"duration": 1.79
},
{
"text": "For 45 rounds, the model iteratively built the base mesh.",
"start": 31.03,
"duration": 3.71
},
{
"text": "An agent even automatically overlaid",
"start": 34.74,
"duration": 2.46
},
{
"text": "these comparison strips",
"start": 37.2,
"duration": 1.33
},
{
"text": "against the reference image",
"start": 38.54,
"duration": 1.58
},
{
"text": "to get the geometry closer,",
"start": 40.12,
"duration": 1.54
},
{
"text": "iteration after iteration.",
"start": 41.67,
"duration": 1.88
},
{
"text": "Once the structure was locked,",
"start": 43.54,
"duration": 1.42
},
{
"text": "I paused the CLI to trigger target targeted micro-loops",
"start": 44.96,
"duration": 2.5
},
{
"text": "for column fluting and floor textures.",
"start": 47.46,
"duration": 2.42
},
{
"text": "Then came lighting.",
"start": 49.88,
"duration": 1.46
},
{
"text": "The model automatically dialed in volumetric fog,",
"start": 51.34,
"duration": 3.21
},
{
"text": "camera depth and audio-reactive sunlight",
"start": 54.55,
"duration": 2.5
},
{
"text": "And here's the final result:",
"start": 57.35,
"duration": 1.5
},
{
"text": "from a flat 2D prompt",
"start": 58.85,
"duration": 1.71
},
{
"text": "to a fully realized",
"start": 60.56,
"duration": 1.29
},
{
"text": "light-mapped, 3D cathedral walkthrough.",
"start": 61.85,
"duration": 2.21
},
{
"text": "All driven by Gemini 4 Argon in Antigravity.",
"start": 64.06,
"duration": 3.59
}
]
},
"word_count": 179,
"is_generated": false,
"language_code": "en",
"segment_count": 29,
"duration_seconds": 67.65,
"requested_languages": [
"en"
]
}Errors
| Status | Meaning | Charged? |
|---|---|---|
| 401 | Missing, invalid or revoked API key | No |
| 402 | Not enough credits (insufficient_credits) | No |
| 404 | The account or post doesn't exist | No |
| 422 | Missing or invalid parameters | No |
| 502 / 503 | The data source is temporarily unavailable | No |
Video transcript API: frequently asked questions
How do I get the transcript of a YouTube video?
Call this endpoint with the video_id (the part after v= in the video URL). The response includes the full transcript as timed segments.
Can I choose the transcript language?
Yes, pass languages with a language code such as en or hi. If that language isn't available, another available transcript is returned; check language_code in the response.
Does it work for auto-generated captions?
Yes. The is_generated field tells you whether the transcript was auto-generated or uploaded by the creator.
What if a video has no captions?
An error is returned and nothing is charged. Videos with captions disabled or no speech have no transcript.
How much does the Video transcript endpoint cost?
2 credits per successful call (0.004 USD at 500 credits per dollar). Errors, "not found" responses and invalid input are never charged, and credits never expire.
Can I try the Video transcript API without signing up?
Yes. The live demo on this page runs a real request with a fixed sample input, free and without an account. Creating a free account gives you 100 credits to test every endpoint with your own inputs.
🔒 Preset demo input. Live demos use the Google for Developers channel, youtube.com/@GoogleDevelopers. Sign up free to use your own.