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

# YouTube Channel Videos

> Sell youtube.channel_videos on AnyAPI: the request your endpoint receives, the response it must return, and what the real-request check judges.

List a YouTube channel's videos by handle or channel ID with cursor pagination (title, views, length, publish time).

This page is the seller-facing summary of one catalog API, `youtube.channel_videos`. The transport rules that apply to every API a seller serves - signed requests, the response envelope, timeouts, and body limits - are on [the operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md).

## The price you compete with

AnyAPI publishes this API from **\$0.80 per 1,000 requests**. That is the price a buyer sees today, so it is the price your endpoint has to come in under to win traffic.

## The request your endpoint receives

This API takes no input fields.

> [accordion] Full input JSON Schema
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/youtube.channel_videos.input.json",
>   "example": {
>     "handle": "@mkbhd"
>   },
>   "title": "YouTube channel videos input",
>   "type": "object",
>   "additionalProperties": false,
>   "x-aliases": {
>     "username": "handle"
>   },
>   "properties": {
>     "handle": {
>       "type": "string",
>       "description": "YouTube channel handle."
>     },
>     "channelId": {
>       "type": "string",
>       "description": "YouTube channel ID."
>     },
>     "sort": {
>       "type": "string",
>       "enum": [
>         "latest",
>         "popular"
>       ],
>       "description": "Sort order."
>     },
>     "cursor": {
>       "type": "string",
>       "description": "Continuation token from a previous response for pagination."
>     },
>     "requireFields": {
>       "type": "array",
>       "uniqueItems": true,
>       "items": {
>         "type": "string",
>         "enum": [
>           "createdUtc",
>           "lengthText",
>           "views"
>         ]
>       },
>       "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `views`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a video that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted. A source that returns only a rounded or shortened value for a field does not count as returning it."
>     }
>   },
>   "anyOf": [
>     {
>       "required": [
>         "handle"
>       ]
>     },
>     {
>       "required": [
>         "channelId"
>       ]
>     }
>   ]
> }
> ```

## The response your endpoint must return

| Field | Type | Always present | What it means |
| - | - | - | - |
| `data` | null or object | yes | |
| `data.nextCursor` | string or null | yes | Opaque cursor for the next page of videos, or null when this lane has no more. Pass it back as cursor to continue. |
| `data.videos` | array | yes | |
| `data.videos[].createdUtc` | number | no | UTC epoch timestamp in seconds (Unix time). Some sources only show a relative age such as "4 days ago", so the value is estimated from it and can be off by up to the label's unit (a day, a week, a month); name `createdUtc` in requireFields to be served only by a source that returns the exact time. Multiply by 1000 for a JS Date in milliseconds. |
| `data.videos[].id` | string | yes | |
| `data.videos[].image` | string | no | URL of the video thumbnail image, tracking query parameters stripped. |
| `data.videos[].lengthText` | string or null | yes | Video length as YouTube shows it, such as 11:56, or null when the serving source does not report it. |
| `data.videos[].publishedTime` | string | yes | |
| `data.videos[].title` | string | yes | |
| `data.videos[].url` | string | yes | |
| `data.videos[].views` | integer | yes | Number of views. Some sources round large counts (6.4M instead of 6,474,059); name `views` in requireFields to be served only by a source that returns the exact count. |
| `found` | boolean | yes | |

Extra fields are kept, missing declared fields fail.

> [accordion] Full output JSON Schema
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/youtube.channel_videos.output.json",
>   "title": "YouTube channel videos output",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "found",
>     "data"
>   ],
>   "properties": {
>     "found": {
>       "type": "boolean"
>     },
>     "data": {
>       "oneOf": [
>         {
>           "type": "null"
>         },
>         {
>           "type": "object",
>           "additionalProperties": false,
>           "required": [
>             "videos",
>             "nextCursor"
>           ],
>           "properties": {
>             "nextCursor": {
>               "type": [
>                 "string",
>                 "null"
>               ],
>               "description": "Opaque cursor for the next page of videos, or null when this lane has no more. Pass it back as cursor to continue."
>             },
>             "videos": {
>               "x-anyapi-must-populate": true,
>               "type": "array",
>               "items": {
>                 "type": "object",
>                 "required": [
>                   "id",
>                   "url",
>                   "title",
>                   "views",
>                   "lengthText",
>                   "publishedTime"
>                 ],
>                 "properties": {
>                   "id": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "url": {
>                     "x-anyapi-domain": [
>                       "youtube.com",
>                       "youtu.be"
>                     ],
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "title": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "views": {
>                     "type": "integer",
>                     "description": "Number of views. Some sources round large counts (6.4M instead of 6,474,059); name `views` in requireFields to be served only by a source that returns the exact count."
>                   },
>                   "lengthText": {
>                     "type": [
>                       "string",
>                       "null"
>                     ],
>                     "description": "Video length as YouTube shows it, such as 11:56, or null when the serving source does not report it."
>                   },
>                   "publishedTime": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "createdUtc": {
>                     "type": "number",
>                     "description": "UTC epoch timestamp in seconds (Unix time). Some sources only show a relative age such as \"4 days ago\", so the value is estimated from it and can be off by up to the label's unit (a day, a week, a month); name `createdUtc` in requireFields to be served only by a source that returns the exact time. Multiply by 1000 for a JS Date in milliseconds."
>                   },
>                   "image": {
>                     "x-anyapi-domain": [
>                       "ytimg.com",
>                       "youtube.com",
>                       "lh3.googleusercontent.com"
>                     ],
>                     "type": "string",
>                     "description": "URL of the video thumbnail image, tracking query parameters stripped."
>                   }
>                 }
>               }
>             }
>           }
>         }
>       ]
>     }
>   }
> }
> ```

## Fields that must never come back empty

* `id`
* `publishedTime`
* `title`
* `url`
* `videos`

The repository marks these fields as ones every source must be able to fill. An empty value is only correct when the entity itself genuinely has nothing there.

## Not found, and how it differs from empty

When the entity does not exist, answer 2xx with the not-found shape:

```json theme={"dark"}
{
  "found": false,
  "data": null
}
```

An empty list is not a not-found: when the entity exists and has nothing to return, answer 2xx with `found: true` and an empty `videos` array.

This output schema declares no `reason` field, so `found: false` is the whole not-found answer.

## Example request

```json theme={"dark"}
{
  "handle": "@mkbhd"
}
```

The registration tests send this example to your endpoint, with the API's other test inputs. After that, the real-request check sends your endpoint real past customer inputs, and an AI reviewer compares each answer with AnyAPI's own answer to the same input.

## Next

* [The operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md) for signing, budgets, and the real-request check.
* [Every API open to sellers](https://getanyapi.com/docs/sell/apis/index.md).
* Want to sell an API that is not on that list? Email [support@getanyapi.com](mailto:support@getanyapi.com).


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