---
title: "Fetch YouTube video transcript"
method: GET
path: "/v1/youtube/transcript"
tags: ["YouTube"]
---

# Fetch YouTube video transcript

`GET /v1/youtube/transcript`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/youtube/transcript`
- Auth: HTTP bearer

Fetches captions (transcript) for a public YouTube video via the innertube player API. Returns timestamped segments with available languages. No API key required. Supports manual and auto-generated captions.

The `url` parameter accepts a full YouTube URL or a bare 11-character video ID. When passing a full URL via query string, percent-encode `&` characters (e.g. `%26`) to avoid truncation.

## Query parameters

- `url` string, required
- `lang` string

## Response `200`

Transcript with timestamped segments

- object
  - `videoId` string
  - `title` string
  - `language` string
  - `isAutoGenerated` boolean
  - `segmentCount` integer
  - `segments` object[]
    - `start` number: Start time in seconds
    - `duration` number: Duration in seconds
    - `text` string
  - `availableLanguages` object[]
    - `code` string
    - `name` string
    - `isAutoGenerated` boolean

## Other responses

- `400`: Invalid request
- `404`: Resource not found
- `429`: Too many concurrent requests
- `502`: YouTube upstream error

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
