---
title: "Retrieve auto-generated or human captions"
method: GET
path: "/youtube/captions/{id}"
tags: ["YouTube"]
---

# Retrieve auto-generated or human captions

`GET /youtube/captions/{id}`

## Request

- Base URL: `https://api.crawlora.net/api/v1`
- URL: `https://api.crawlora.net/api/v1/youtube/captions/{id}`
- Auth: API key in header `x-api-key`

Returns the caption cues for a YouTube video by its 11-character video id, in the language given by `lang` (ISO 639-1, default `en`). Each cue has its text, start time and duration. Works for both auto-generated and human-written captions.

## Path parameters

- `id` string, required

## Query parameters

- `lang` string

## Headers

- `x-api-key` string, required

## Response `200`

Wrapped caption payload (map[string][]Subtitle)

- YoutubeCaptionsResponseDoc
  - `code` integer
  - `data` YoutubeCaption[]
    - `duration` number: Length of the caption cue, in seconds.
    - `start` number: Time the caption cue starts, in seconds from the start of the video.
    - `text` string: Caption text shown for this cue.
  - `msg` string

## Other responses

- `400`: Missing or invalid parameters
- `429`: Rate limit exceeded
- `500`: Internal server error

---

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