---
title: "Fetch a cleaned YouTube transcript"
method: POST
path: "/api/v1/youtube/get"
tags: ["YouTube"]
---

# Fetch a cleaned YouTube transcript

`POST /api/v1/youtube/get`

## Request

- Base URL: `https://glim.sh`
- URL: `https://glim.sh/api/v1/youtube/get`
- Auth: one of:
  - none
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in query parameter `apiKey`

Fetch a YouTube transcript for a video (video_id accepts a bare 11-char id or any YouTube URL) in the requested language and origin (uploader_provided | auto_generated). The transcript is cleaned server-side (deduplicated, tags/HTML stripped, coarse [m:ss] timestamps) - roughly a tenth the size of the raw captions. format='inline' (default) returns it inline in the `transcript` field when under the size cap, otherwise omits it and sets transcript_omitted_reason; format='url' returns metadata + a presigned download_url only. download_url (plain-text transcript) is always present and expires in ~1 hour; call again to refresh. Cached 7 days server-side — repeat calls on the same (video_id, language_code, origin) tuple are free after the first.

## Request body

- object: Input for POST /youtube/get
  - `video_id` string, required: YouTube video URL or 11-char video id (e.g. https://youtu.be/dQw4w9WgXcQ, https://www.youtube.com/watch?v=dQw4w9WgXcQ, or dQw4w9WgXcQ). Also accepted as `ref` or `url`.
  - `language_code` string: ISO 639-1 language code (e.g. 'en', 'de', 'fr')
  - `origin` 'uploader_provided' | 'auto_generated': 'uploader_provided' for human captions (default), 'auto_generated' for YouTube auto-captions.
  - `format` 'inline' | 'url': 'inline' (default): include the transcript in the response when it fits the inline cap; otherwise omit it and set transcript_omitted_reason. 'url': never include the transcript; caller fetches download_url. download_url is always present.

## Response `200`

Cleaned transcript (inline by default, or via presigned download_url)

- object

## Other responses

- `400`: Bad Request
- `402`: Payment Required
- `404`: Not Found
- `502`: Upstream Error

---

[API](https://skmtc.dev/glim/apis/glim-sh.md) · [All operations](https://skmtc.dev/glim/apis/glim-sh/llms.txt) · [OpenAPI document](https://skmtc.dev/glim/apis/glim-sh/revisions/0094e5226d73?raw)
