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

# Channel Videos

> Use this API endpoint to fetch a list of video IDs from a YouTube channel.

## Quick Start

### Request

<CodeGroup>
  ```js Node theme={null}
  import {
    Supadata,
    VideoIds
  } from '@supadata/js';

  // Initialize the client
  const supadata = new Supadata({
    apiKey: 'YOUR_API_KEY',
  });

  const channelVideos: VideoIds = await supadata.youtube.channel.videos({
    id: 'https://youtube.com/@RickAstleyVEVO', // can be url, channel id, handle
    type: 'all', // 'video', 'short', 'live', 'all'
    limit: 10,
  });
  ```

  ```python Python theme={null}
  from supadata import Supadata, SupadataError

  # Initialize the client
  supadata = Supadata(api_key="YOUR_API_KEY")

  channel_videos = supadata.youtube.channel.videos(
      id="RickAstleyVEVO",  # can be url, channel id, or handle
      type="all",  # 'all', 'video', 'short', or 'live'
      limit=50
  )
  print(f"Regular videos: {channel_videos.video_ids}")
  print(f"Shorts: {channel_videos.short_ids}")
  print(f"Live: {channel_videos.live_ids}")
  ```

  ```bash cURL theme={null}
  curl -X GET 'https://api.supadata.ai/v1/youtube/channel/videos?id=RickAstleyVEVO&limit=50' \
    -H 'x-api-key: YOUR_API_KEY'
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "videoIds": ["dQw4w9WgXcQ", "xvFZjo5PgG0"],
  "shortIds": ["xvFZjo5PgG0", "dQw4w9WgXcQ"],
  "liveIds": ["dQw4w9WgXcQ", "xvFZjo5PgG0"]
}
```

## Specification

### Endpoint

`GET https://api.supadata.ai/v1/youtube/channel/videos`

Each request requires an `x-api-key` header with your API key available after signing up. Get your API key [here](https://dash.supadata.ai/organizations/api-key).

### Query Parameters

| Parameter | Type   | Required | Description                                                                                                         |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------- |
| id        | string | Yes      | YouTube channel URL, handle or ID. See [Supported YouTube URL Formats](/youtube/supported-url-formats).             |
| limit     | number | No       | Maximum number of video IDs to return. If `type` = `all`, vertical videos are prioritized. (Default: 30, Max: 5000) |
| type      | enum   | No       | `all`, `video`, `short`, `live` (Default: `all`)                                                                    |

<Info>
  When fetching `type: all`, the limit parameter applies to vertical videos
  first, then Shorts and live videos. For example, if the channel has 100
  vertical videos and 100 Shorts, and `limit` is 150, then 100 vertical videos
  and 50 Shorts will be returned.
</Info>

### Response Format

```typescript theme={null}
{
  "videoIds": string[], // List of vertical YouTube video IDs
  "shortIds": string[], // List of Shorts IDs
  "liveIds": string[] // List of live video IDs
}
```

### Error Codes

The API returns HTTP status codes and error codes. See this [page](/errors) for more details.

### Supported YouTube Identifiers

The universal `id` parameter supports various YouTube URL and ID formats. See this [page](/youtube/supported-url-formats) for more details.

## Working with Channel Videos

After retrieving the list of video IDs, you can:

1. Get metadata for each video using the [Video Metadata](/youtube/video) endpoint
2. Get transcripts for each video using the [Transcript](/get-transcript) endpoint

<Info>
  Videos are returned latest first, just like in the "Videos" tab of a YouTube
  channel.
</Info>

## Pricing

* 1 channel videos request = 1 credit
