> ## 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 video

> Read a YouTube video link as JSON with the youtube-video 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 one video 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-video"}]}'
```

```typescript TypeScript theme={null}
import { Stophy } from "stophy";

const stophy = new Stophy();

const result = await stophy.parsed(
  "youtube-video",
  "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
);
console.log(result);
```

```python Python theme={null}
from stophy import Stophy

stophy = Stophy()

result = stophy.parsed(
    "youtube-video",
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
)
print(result)
```

## Read the response

The parser's data is in `data.json`. Its fields include `id`, `url`, `title`, `description`, `author`, `publishedAt`, `durationSeconds`, `views`, `likes`, `comments`, `thumbnailUrl` and `hashtags`. This sample is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "id": "dQw4w9WgXcQ",
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
      "description": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Autobiography 📚 OUT NOW! \nFollow this…",
      "author": {
        "id": "UCuAXFkgsw1L7xaCfnd5JJOw",
        "name": "Rick Astley",
        "handle": "RickAstleyYT",
        "url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
        "avatarUrl": null
      },
      "publishedAt": "2009-10-25T06:57:33.000Z",
      "durationSeconds": 213,
      "views": 1833745427,
      "likes": 19491332,
      "comments": 2400000,
      "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
      "hashtags": [],
      "isShort": false,
      "isLive": false,
      "category": "Music",
      "tags": [
        "rick astley",
        "Never Gonna Give You Up",
        "nggyu"
      ],
      "channelSubscribers": 4560000,
      "chapters": [],
      "mostReplayedAtSeconds": [
        2
      ]
    }
  }
}
```

## Options

This parser takes no options.

## 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 transcript](https://docs.stophy.dev/scrape/prebuilt-parsers/video/youtube-transcript.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.