# YouTube

Subtitle and transcript extraction from any public video — human captions when the uploader provides them, auto-generated as fallback — delivered model-ready.

## Tools & pricing

- `glim_youtube_get` / `POST /api/v1/youtube/get` — $0.01 per call. `video_id` (11 chars, or a video URL on MCP) plus optional `language_code` and `origin` (uploader_provided | auto_generated).

## Example

**request**

```
curl -X POST https://glim.sh/api/v1/youtube/get \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_id":"LCEmiRjPEtQ"}'
```

**response (real call; long transcripts ship as a download URL)**

```
{
  "video_id": "LCEmiRjPEtQ",
  "url": "https://www.youtube.com/watch?v=LCEmiRjPEtQ",
  "language_code": "en",
  "origin": "auto_generated",
  "content_type": "text/vtt",
  "download_url": "https://fsn1.your-objectstorage.com/surf-snapshots/youtube-subtitles/LCEmiRjPEtQ/auto_generated/en.vtt?X-Amz-…",
  "expires_at": "2026-06-12T10:59:14.210Z",
  "size_bytes": 405747,
  "vtt_omitted_reason": "exceeds_inline_size_limit"
}
```

## Good to know

- On MCP the transcript comes back inline as text when it fits (~20K tokens); longer videos return a presigned `download_url` (expires in ~1 hour — call again to refresh).
- If the uploader provided no captions, glim falls back to auto-generated automatically.
- Results are cached server-side for 7 days — repeat calls on the same video/language are served from cache.
- No captions in the requested language returns `404` with a suggestion to try `origin=auto_generated` or another `language_code`.

## Prompts to try

- "Get the transcript of this conference talk and give me the five key takeaways."
- "Pull subtitles for these three videos and compare what each says about pricing."

---

## All docs pages


**Get started**

- [Introduction](https://glim.sh/docs.md?page=introduction)
- [MCP quickstart](https://glim.sh/docs.md?page=quickstart)
- [REST API quickstart](https://glim.sh/docs.md?page=quickstart-rest)
- [JavaScript quickstart](https://glim.sh/docs.md?page=quickstart-js)
- [Python quickstart](https://glim.sh/docs.md?page=quickstart-python)
- [Payments & auth](https://glim.sh/docs.md?page=payments)

**Tools**

- [Twitter / X](https://glim.sh/docs.md?page=twitter)
- [Reddit](https://glim.sh/docs.md?page=reddit)
- [Web](https://glim.sh/docs.md?page=web)
- [GitHub](https://glim.sh/docs.md?page=github)
- [Amazon](https://glim.sh/docs.md?page=amazon)
- [YouTube](https://glim.sh/docs.md?page=youtube)
- [Telegram](https://glim.sh/docs.md?page=telegram)

**Reference**

- [Changelog](https://glim.sh/docs.md?page=changelog)
- [API reference](https://glim.sh/docs-openapi)
- [OpenAPI spec](https://glim.sh/openapi.json)
