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

# Get YouTube Channel Videos

> Return uploaded long-form videos for a channel with pagination support.

## Description

This endpoint retrieves all videos from a YouTube channel with detailed information including views, publish dates, and metadata. Supports pagination for channels with many videos.

## Endpoint

```
POST https://app.dumplingai.com/api/v1/youtube/channel-videos
```

## Headers

* **Content-Type:** `application/json`
* **Authorization:** Bearer `<API_KEY>` (required)

## Request Body

```json theme={null}
{
  "channelId": "string", // Optional. YouTube channel ID (e.g., "UCxcTeAKWJca6XyJ37_ZoKIQ")
  "handle": "string", // Optional. YouTube channel handle (e.g., "@channelname")  
  "sort": "string", // Optional. Sort order: "latest" or "popular". Default: "latest"
  "continuationToken": "string", // Optional. Token for pagination from previous response
  "includeExtras": "string" // Optional. Include like/comment counts and descriptions (slower response)
}
```

**Note:** At least one of `channelId` or `handle` is required.

### Accepted Values for `sort`

| Value   | Description                             |
| ------- | --------------------------------------- |
| latest  | Sort by most recently published         |
| popular | Sort by most popular (views/engagement) |

## Responses

### Success (200)

Returns an array of videos from the specified channel with pagination support.

```json theme={null}
{
  "videos": [
    {
      "type": "video",
      "id": "5EWaxmWgQMI",
      "url": "https://www.youtube.com/watch?v=5EWaxmWgQMI",
      "title": "Russell Wilson Hopes To Finish Career As A Steeler",
      "description": "Welcome to The Pat McAfee Show LIVE...", // Only if includeExtras is enabled
      "thumbnail": "https://i.ytimg.com/vi/5EWaxmWgQMI/hqdefault.jpg",
      "channel": {
        "title": "The Pat McAfee Show",
        "thumbnail": "https://yt3.googleusercontent.com/..."
      },
      "viewCountText": "110,447 views",
      "viewCountInt": 110447,
      "publishedTimeText": "9 days ago", 
      "publishedTime": "2025-01-23T22:48:53.914Z",
      "lengthText": "37:25",
      "lengthSeconds": 2245,
      "badges": ["4K", "CC"]
    }
  ],
  "continuationToken": "4qmFsgLlFhIYV..." // Present if more videos are available
}
```

* **Content-Type:** application/json
* **X-RateLimit-Limit:** The rate limit for the user
* **X-RateLimit-Remaining:** The remaining number of requests for the user

### Bad Request (400)

Returned if the request is invalid or missing required parameters.

```json theme={null}
{
  "error": "At least one parameter is required: 'channelId' or 'handle'"
}
```

### Bad Gateway (502)

Returned if the external service is unavailable or returns invalid data.

```json theme={null}
{
  "error": "Failed to retrieve YouTube channel videos"
}
```

### Internal Server Error (500)

Returned if there's an unexpected server error.

```json theme={null}
{
  "error": "An unexpected server error occurred while fetching YouTube channel videos"
}
```

## Example Request

```bash theme={null}
curl -X POST https://app.dumplingai.com/api/v1/youtube/channel-videos \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "handle": "@ThePatMcAfeeShow",
  "sort": "latest",
  "includeExtras": "true"
}'
```

## Example Response

```json theme={null}
{
  "videos": [
    {
      "type": "video", 
      "id": "5EWaxmWgQMI",
      "url": "https://www.youtube.com/watch?v=5EWaxmWgQMI",
      "title": "Russell Wilson Hopes To Finish Career As A Steeler, Reflects On NFL Career With Pat McAfee",
      "description": "Welcome to The Pat McAfee Show LIVE from Noon-3PM EST Mon-Fri...",
      "thumbnail": "https://i.ytimg.com/vi/5EWaxmWgQMI/hqdefault.jpg",
      "channel": {
        "title": "",
        "thumbnail": null
      },
      "viewCountText": "110,447 views",
      "viewCountInt": 110447,
      "publishedTimeText": "9 days ago",
      "publishedTime": "2025-01-23T22:48:53.914Z", 
      "lengthText": "37:25",
      "lengthSeconds": 2245,
      "badges": []
    }
  ],
  "continuationToken": "4qmFsgLlFhIYV..."
}
```

## Notes

* Either `channelId` or `handle` must be provided
* Channel handles should include the @ symbol (e.g., "@channelname")
* The `continuationToken` from the response can be used to fetch additional videos
* Setting `includeExtras` to "true" will include video descriptions and engagement metrics but may slow down the response
* This endpoint uses **10 credits** per request
* Results are paginated - use the `continuationToken` to retrieve additional pages

## Rate Limiting

Rate limit headers (`X-RateLimit-Limit` and `X-RateLimit-Remaining`) are included in the response to indicate the user's current rate limit status.


## OpenAPI

````yaml POST /api/v1/youtube/channel-videos
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/youtube/channel-videos:
    post:
      tags:
        - YouTube
      summary: List channel videos
      description: Return uploaded long-form videos for a channel with pagination support.
      operationId: listYouTubeChannelVideos
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/YouTubeChannelVideosRequest'
            examples:
              byChannelId:
                summary: First page by channel ID
                value:
                  channelId: UCxcTeAKWJca6XyJ37_ZoKIQ
      responses:
        '200':
          description: A page of channel videos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YouTubeChannelVideosResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream YouTube data provider returned an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    YouTubeChannelVideosRequest:
      type: object
      description: >-
        Fetch videos from a channel with optional pagination. Supply either
        channelId or handle.
      properties:
        channelId:
          type: string
        handle:
          type: string
        continuationToken:
          type: string
          description: Token from a previous response for pagination.
        sort:
          type: string
          description: Sort order for the result set.
          enum:
            - latest
            - popular
            - newest
        includeExtras:
          type: string
          description: >-
            Optional upstream flag forwarded to the provider to request
            additional metadata.
        requestSource:
          $ref: '#/components/schemas/RequestSource'
    YouTubeChannelVideosResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Present on some responses from the upstream provider.
        videos:
          type: array
          description: Present when returning long-form uploads.
          items:
            $ref: '#/components/schemas/YouTubeVideoSummary'
        shorts:
          type: array
          description: Present when returning Shorts.
          items:
            $ref: '#/components/schemas/YouTubeVideoSummary'
        continuationToken:
          type: string
          nullable: true
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
    YouTubeVideoSummary:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        thumbnail:
          type: string
          format: uri
        url:
          type: string
          format: uri
        type:
          type: string
          description: Video type such as `video` or `short`.
        publishDateText:
          type: string
          nullable: true
        publishDate:
          type: string
          format: date-time
          nullable: true
        viewCountText:
          type: string
          nullable: true
        viewCountInt:
          type: integer
          nullable: true
        lengthText:
          type: string
          nullable: true
        channel:
          type: object
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````