YouTube Transcript
glim_youtube_getFetch a YouTube video transcript from a video URL or 11-char id. The transcript is cleaned server-side: deduplicated, tags/HTML stripped, with coarse [m:ss] timestamps - roughly a tenth the size of the raw captions. Default format='text' returns it inline (when it fits ~40K chars / ~10K tokens) so a single call gives you the text directly; long-form videos fall back to a download_url note. Pass format='json' for the same transcript plus transcript metadata (video_id, canonical url, language, origin, size) and a presigned download_url - for batch/programmatic use. Default origin='uploader_provided' (human captions); falls back to 'auto_generated' automatically if missing (counts as 2 upstream calls). Cached 7 days server-side.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | YouTube video URL or 11-char video id (e.g. https://youtu.be/dQw4w9WgXcQ, https://www.youtube.com/watch?v=dQw4w9WgXcQ, or dQw4w9WgXcQ) | |
| format | No | Output format. 'text' (default): the cleaned transcript inline as plain text (omitted with a download_url note when it exceeds the ~40K-char inline cap). 'json': the same cleaned transcript plus transcript metadata (video_id, canonical url, language, origin, size) and a presigned download_url - for batch/programmatic use. Both formats return the identical cleaned, deduplicated transcript. | text |
| origin | No | 'uploader_provided' for human captions (default), 'auto_generated' for YouTube auto-captions. | uploader_provided |
| language_code | No | ISO 639-1 language code (e.g. 'en', 'de', 'fr') | en |