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

# YouTube Data API

> Public YouTube data: videos, channels, playlists, comments and search, read with a Google API key.

![](https://mintcdn.com/webrouter/8QP9EZc8V07Kl-0I/logo/data-apis/youtube.webp?fit=max\&auto=format\&n=8QP9EZc8V07Kl-0I\&q=85\&s=ce0deb87a28f2c1dc71eaa90046f1660)

[Web Catalog · Social](https://docs.webrouter.net/data-apis.md?category=social)

Needs&#x20;

`YOUTUBE_API_KEY`

Endpoints

6

Auth

Key in query

[Vendor docs](https://developers.google.com/youtube/v3/docs) · [Pricing](https://developers.google.com/youtube/v3/determine_quota_cost) · Serves `youtube.com`, `youtu.be`

## Setup

| Variable | | What it is |
| - | - | - |
| `YOUTUBE_API_KEY` | required | A Google Cloud API key with the YouTube Data API v3 enabled (Google Cloud console > APIs & Services > Credentials) |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Only public data, read with an API key. Data private to a user, and every upload, comment, rating or other change, needs OAuth 2.0 and is not covered here.
* Quota is in units, default 10,000 a day per project: most reads cost 1, and search is also capped at 100 calls a day by default.
* Lists page with nextPageToken and pageToken; maxResults tops out at 50 (100 for comment threads).
* part is required on every list call and decides which fields come back.

## Endpoints

GET

Get videos by id or most-popular chart

Details and statistics of videos by id, or the most popular videos of a region.

[Open](#youtube-videos-get)

GET

Search videos, channels and playlists

Keyword search across YouTube, with filters for channel, date, duration, region and more.

[Open](#youtube-search)

GET

Get channels by id, handle or username

Channel details, statistics and the uploads playlist id.

[Open](#youtube-channels-get)

GET

List the videos of a playlist

The items of a playlist, including a channel's uploads playlist.

[Open](#youtube-playlist-items-list)

GET

List playlists

A channel's playlists, or playlists by id.

[Open](#youtube-playlists-list)

GET

List comment threads of a video or channel

Top-level comments with optional replies.

[Open](#youtube-comments-threads)

### Get videos by id or most-popular chart

GET

`/videos`

`youtube.videos.get`

Details and statistics of videos by id, or the most popular videos of a region.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`part` required</td><td>string</td><td>query</td><td>Comma-separated: snippet, contentDetails, statistics, status, player, topicDetails, liveStreamingDetails, localizations, recordingDetails, paidProductPlacementDetails. Example `snippet,statistics`</td></tr>
    <tr><td>`id`</td><td>string</td><td>query</td><td>Comma-separated video ids. Give exactly one of id or chart. Example `dQw4w9WgXcQ`</td></tr>
    <tr><td>`chart`</td><td>string</td><td>query</td><td>mostPopular. Give exactly one of id or chart. One of `mostPopular`</td></tr>

    <tr>
      <td>
        `regionCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ISO 3166-1 alpha-2 country code; only with chart.
      </td>
    </tr>

    <tr>
      <td>
        `videoCategoryId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only with chart; default 0.
      </td>
    </tr>

    <tr>
      <td>
        `hl`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Language code for snippet.localized.
      </td>
    </tr>

    <tr>
      <td>
        `maxResults`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to 50, default 5.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        nextPageToken from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/youtube/v3/docs/videos/list) · Same job: [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-social-posts), [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-posts), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-list), [Edges](https://docs.webrouter.net/data-apis/edges.md#edges-post-extract), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-feed), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-videos-search)

```python Python theme={null}
router.call_data_api("youtube.videos.get", {'part': 'snippet,statistics', 'id': 'dQw4w9WgXcQ'})
```

```text MCP theme={null}
call_data_api(endpoint="youtube.videos.get", params={"part": "snippet,statistics", "id": "dQw4w9WgXcQ"})
```

> [!NOTE]
>
> * maxResults and pageToken work with chart, not with id (up to 50 ids per call).
> * Each call costs 1 quota unit; the default quota is 10,000 units a day.

### Search videos, channels and playlists

GET

`/search`

`youtube.search`

Keyword search across YouTube, with filters for channel, date, duration, region and more.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`part` required</td><td>string</td><td>query</td><td>Always snippet. One of `snippet` Example `snippet`</td></tr>
    <tr><td>`q`</td><td>string</td><td>query</td><td>Search query. Supports - (NOT) and | (OR, URL-encode as %7C). Example `web scraping`</td></tr>
    <tr><td>`type`</td><td>string</td><td>query</td><td>Comma-separated: video, channel, playlist. Default all three. Example `video`</td></tr>

    <tr>
      <td>
        `channelId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only results from this channel.
      </td>
    </tr>

    <tr><td>`order`</td><td>string</td><td>query</td><td>Sort order. Default relevance. One of `date`, `rating`, `relevance`, `title`, `videoCount`, `viewCount`</td></tr>
    <tr><td>`publishedAfter`</td><td>string</td><td>query</td><td>RFC 3339 time. Example `2026-01-01T00:00:00Z`</td></tr>

    <tr>
      <td>
        `publishedBefore`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        RFC 3339 time.
      </td>
    </tr>

    <tr>
      <td>
        `regionCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ISO 3166-1 alpha-2 country code.
      </td>
    </tr>

    <tr>
      <td>
        `relevanceLanguage`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ISO 639-1 language code.
      </td>
    </tr>

    <tr><td>`videoDuration`</td><td>string</td><td>query</td><td>Needs type=video. One of `any`, `short`, `medium`, `long`</td></tr>
    <tr><td>`eventType`</td><td>string</td><td>query</td><td>Needs type=video. One of `completed`, `live`, `upcoming`</td></tr>

    <tr>
      <td>
        `safeSearch`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `moderate`

        ,&#x20;

        `none`

        ,&#x20;

        `strict`
      </td>
    </tr>

    <tr>
      <td>
        `maxResults`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        0 to 50, default 5.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        nextPageToken from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/youtube/v3/docs/search/list) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-search), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-search), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-creators-search), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-posts-search), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-search), [Hacker News Search (Algolia)](https://docs.webrouter.net/data-apis/hn-algolia.md#hn-algolia-search)

```python Python theme={null}
router.call_data_api("youtube.search", {'part': 'snippet', 'q': 'web scraping', 'type': 'video', 'publishedAfter': '2026-01-01T00:00:00Z'})
```

```text MCP theme={null}
call_data_api(endpoint="youtube.search", params={"part": "snippet", "q": "web scraping", "type": "video", "publishedAfter": "2026-01-01T00:00:00Z"})
```

> [!NOTE]
>
> * Quota: the default 10,000 units a day applies, but search calls are also capped at 100 per day under default quota. Use videos.get or channels.get when you already have ids.
> * Returns ids and snippets only, no statistics: follow up with videos.get.

### Get channels by id, handle or username

GET

`/channels`

`youtube.channels.get`

Channel details, statistics and the uploads playlist id.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`part` required</td><td>string</td><td>query</td><td>Comma-separated: snippet, contentDetails, statistics, brandingSettings, status, topicDetails, localizations. Example `snippet,statistics,contentDetails`</td></tr>

    <tr>
      <td>
        `id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated channel ids. Give exactly one of id, forHandle, forUsername.
      </td>
    </tr>

    <tr><td>`forHandle`</td><td>string</td><td>query</td><td>A handle, with or without the leading @. Example `@YouTube`</td></tr>

    <tr>
      <td>
        `forUsername`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        A legacy YouTube username.
      </td>
    </tr>

    <tr>
      <td>
        `hl`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `maxResults`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to 50, default 5.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        nextPageToken from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/youtube/v3/docs/channels/list) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-profile), [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-company-social-metrics), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-users-get), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-get), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-reactions), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-reactions)

```python Python theme={null}
router.call_data_api("youtube.channels.get", {'part': 'snippet,statistics,contentDetails', 'forHandle': '@YouTube'})
```

```text MCP theme={null}
call_data_api(endpoint="youtube.channels.get", params={"part": "snippet,statistics,contentDetails", "forHandle": "@YouTube"})
```

> [!NOTE]
>
> * contentDetails.relatedPlaylists.uploads is the playlist of a channel's uploads: list it with playlist\_items.list.

### List the videos of a playlist

GET

`/playlistItems`

`youtube.playlist_items.list`

The items of a playlist, including a channel's uploads playlist.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`part` required</td><td>string</td><td>query</td><td>Comma-separated: snippet, contentDetails, id, status. Example `snippet,contentDetails`</td></tr>

    <tr>
      <td>
        `playlistId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Playlist id. Give exactly one of playlistId or id.
      </td>
    </tr>

    <tr>
      <td>
        `id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated playlist item ids.
      </td>
    </tr>

    <tr>
      <td>
        `videoId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only items containing this video.
      </td>
    </tr>

    <tr>
      <td>
        `maxResults`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to 50, default 5.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        nextPageToken from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/youtube/v3/docs/playlistItems/list) · Same job: [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-social-posts), [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-posts), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-list), [Edges](https://docs.webrouter.net/data-apis/edges.md#edges-post-extract), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-feed), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-videos-search)

```python Python theme={null}
router.call_data_api("youtube.playlist_items.list", {'part': 'snippet,contentDetails'})
```

```text MCP theme={null}
call_data_api(endpoint="youtube.playlist_items.list", params={"part": "snippet,contentDetails"})
```

### List playlists

GET

`/playlists`

`youtube.playlists.list`

A channel's playlists, or playlists by id.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`part` required</td><td>string</td><td>query</td><td>Comma-separated: snippet, contentDetails, id, status, player, localizations. Example `snippet,contentDetails`</td></tr>

    <tr>
      <td>
        `channelId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Give exactly one of channelId or id.
      </td>
    </tr>

    <tr>
      <td>
        `id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated playlist ids.
      </td>
    </tr>

    <tr>
      <td>
        `hl`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `maxResults`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to 50, default 5.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        nextPageToken from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/youtube/v3/docs/playlists/list) · Same job: [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-social-posts), [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-posts), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-list), [Edges](https://docs.webrouter.net/data-apis/edges.md#edges-post-extract), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-feed), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-videos-search)

```python Python theme={null}
router.call_data_api("youtube.playlists.list", {'part': 'snippet,contentDetails'})
```

```text MCP theme={null}
call_data_api(endpoint="youtube.playlists.list", params={"part": "snippet,contentDetails"})
```

### List comment threads of a video or channel

GET

`/commentThreads`

`youtube.comments.threads`

Top-level comments with optional replies.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`part` required</td><td>string</td><td>query</td><td>Comma-separated: snippet, replies, id. Example `snippet,replies`</td></tr>

    <tr>
      <td>
        `videoId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Give exactly one of videoId, allThreadsRelatedToChannelId, id.
      </td>
    </tr>

    <tr>
      <td>
        `allThreadsRelatedToChannelId`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated thread ids.
      </td>
    </tr>

    <tr>
      <td>
        `searchTerms`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only comments matching these terms. Not with id.
      </td>
    </tr>

    <tr><td>`order`</td><td>string</td><td>query</td><td>Default time. One of `time`, `relevance`</td></tr>
    <tr><td>`textFormat`</td><td>string</td><td>query</td><td>Default html. One of `html`, `plainText`</td></tr>

    <tr>
      <td>
        `maxResults`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to 100, default 20. Not with id.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        nextPageToken from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/youtube/v3/docs/commentThreads/list) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-comments), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-comments-list), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-comments), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-profile-comments), [Hacker News Search (Algolia)](https://docs.webrouter.net/data-apis/hn-algolia.md#hn-algolia-item-get), [Influencers Club](https://docs.webrouter.net/data-apis/influencersclub.md#influencersclub-posts-details)

```python Python theme={null}
router.call_data_api("youtube.comments.threads", {'part': 'snippet,replies'})
```

```text MCP theme={null}
call_data_api(endpoint="youtube.comments.threads", params={"part": "snippet,replies"})
```

> [!NOTE]
>
> * Videos with comments disabled answer 403 commentsDisabled.
> * replies in the answer holds only some replies; fetch the rest with the comments list endpoint by parentId.


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