> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube transcript

> Read a YouTube video link as JSON with the youtube-transcript parser. $1 per 1,000 calls. Send the page to scrape. Examples in cURL, TypeScript and Python.

Reads a YouTube video link: watch, youtu.be, shorts or live, and returns its data as JSON.

## Make a request

Send the page's URL to [scrape](https://docs.stophy.dev/api-reference/endpoint/scrape.md) with a `json` format that names the parser. This parser works without an API key when you send no options, up to 10 calls a minute and 50 calls a day per IP address. See [Rate limits](https://docs.stophy.dev/production/rate-limits.md). To lift the limits, get an API key in the [Quickstart](https://docs.stophy.dev/quickstart).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","formats":[{"type":"json","parser":"youtube-transcript"}]}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    formats: [{ type: "json", parser: "youtube-transcript" }],
  }),
});
console.log(await response.json());
```

```python Python theme={null}
import os

import requests

response = requests.post(
    "https://api.stophy.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={
        "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "formats": [{"type": "json", "parser": "youtube-transcript"}],
    },
)
print(response.json())
```

## Read the response

The parser's data is in `data.json`. Its fields include `startSeconds`, `endSeconds` and `text`. This real response is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "videoId": "dQw4w9WgXcQ",
      "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "language": "en",
      "isAutoGenerated": false,
      "durationSeconds": 213,
      "text": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ♪ A full commitment's what I'm thinking of ♪ ♪…"
    },
    "metadata": {
      "sourceURL": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "statusCode": 200,
      "contentType": "application/json",
      "cacheState": "hit",
      "cachedAt": "2026-11-13T18:00:17.852Z",
      "scrapeId": "1f9bf570-b032-4f11-99f3-552b8c934ce1",
      "creditsUsed": 1,
      "costUsd": 0.001
    }
  },
  "id": "1f9bf570-b032-4f11-99f3-552b8c934ce1",
  "costUsd": 0.001,
  "creditsUsed": 1,
  "requestId": "1f9bf570-b032-4f11-99f3-552b8c934ce1"
}
```

## Options

Send options in the `options` object of the `json` format.

| Option | What it does |
| - | - |
| `language` | BCP 47 language tag, e.g. en or pt-BR. Any case is accepted. |

It also takes `includeTimestamps`.

## Price

\$1 per 1,000 calls. Works without an API key, within the free limits. See [Pricing](https://docs.stophy.dev/account/pricing.md).

## Limits and errors

* The URL must be a YouTube video link: watch, youtu.be, shorts or live. Any other URL fails with `invalidRequest`.
* The answer comes back in `data.json`. If the page cannot be read, the call fails with an error code from [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Related

* [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers) lists every parser.
* [Scrape](https://docs.stophy.dev/scrape/overview) has the options every scrape takes.
* [YouTube search](https://docs.stophy.dev/scrape/prebuilt-parsers/video/youtube-search.md)
* [YouTube video](https://docs.stophy.dev/scrape/prebuilt-parsers/video/youtube-video.md)
* [YouTube comments](https://docs.stophy.dev/scrape/prebuilt-parsers/video/youtube-comments.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.