YouTube API endpoint
Searches the videos of one YouTube channel for the required `q`. `id` accepts a channel id, `@handle`, `/c` or `/user` path, or a full channel URL. Items carry the video id, title, URL, duration, view count, published text and thumbnail, and the response echoes the resolved `query`. Page with `continuation_token`.
/youtube/channel/{id}/searchReturns video results scoped to a single YouTube channel.
Query parameters:
q: required search querycontinuation_token: fetch the next page from a previous response| Field | Filled in, of 28 checked | Values in the sample |
|---|---|---|
| type | 28 | |
| position | 28 | 1 to 28, median 14 |
| title | 28 | |
| url | 28 | youtube.com |
| thumbnail | 28 | i.ytimg.com |
| video_id | 28 | |
| channel_title | 28 | |
| channel_id | 28 | |
| duration | 28 | |
| duration_seconds | 28 | 16 to 3,215, median 119 |
| published_text | 28 | |
| view_count | 28 | |
| short_view_count | 28 | |
| description_snippet | 27 | median 192 characters |
| channel_thumbnail | 28 | yt3.googleusercontent.com |
| is_verified | 28 | true in 28 of 28 |
| badges | 14 | median 1 entry |
| is_short | 3 | true in 3 of 3 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id (path) | string | Yes | Channel ID, @handle, /c path, /user path, or full YouTube channel URL | UCXZCJLdBC09xxGZ6gcdrc6A | |
| q | string | Yes | Search query | gpt | |
| continuation_token | string | No | Pagination token returned by a previous request | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/youtube/channel/UCXZCJLdBC09xxGZ6gcdrc6A/search?q=gpt" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"query": "gpt",
"channel_id": "UCXZCJLdBC09xxGZ6gcdrc6A",
"channel_title": "OpenAI",
"handle": "@OpenAI",
"items": [
{
"type": "video",
"position": 1,
"title": "Search Result 1",
"video_id": "abc123xyz89",
"duration": "04:20"
}
],
"continuation_token": "NEXT_TOKEN"
}
}Request schema
No body schema
Response schema
#/definitions/youtube.channelSearchResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | youtube.channelSearchResponseDataDoc | No | ||||
| data.channel_id | string | No | UCXZCJLdBC09xxGZ6gcdrc6A | YouTube channel ID, starting with `UC`. | ||
| data.channel_title | string | No | OpenAI | Channel name as shown on YouTube. | ||
| data.channel_url | string | No | https://www.youtube.com/@OpenAI | Link to the channel on YouTube. | ||
| data.continuation_token | string | No | NEXT_TOKEN | Token to pass in the next request to get the following page. Omitted on the last page. | ||
| data.handle | string | No | @OpenAI | Channel handle, starting with `@`. | ||
| data.items | array | No | Videos from the channel that match the search text. | |||
| data.items[].badges | array | No | HD,CC | Badge labels shown on the video, such as `HD` or `CC`. | ||
| data.items[].channel_id | string | No | UCXZCJLdBC09xxGZ6gcdrc6A | YouTube channel ID, starting with `UC`. | ||
| data.items[].channel_thumbnail | string | No | https://yt3.ggpht.com/example=s68-c-k-c0x00ffffff-no-rj | URL of the publishing channel's avatar image. | ||
| data.items[].channel_title | string | No | OpenAI | Name of the channel that published the video or playlist. | ||
| data.items[].description_snippet | string | No | A concise walkthrough of GPT features. | Short excerpt of the video or channel description shown in the results. | ||
| data.items[].duration | string | No | 12:34 | Video length as YouTube displays it, such as `12:34`. | ||
| data.items[].duration_seconds | integer | No | 754 | Video length in seconds. | ||
| data.items[].handle | string | No | @OpenAI | Channel handle, starting with `@`. Set for channel results. | ||
| data.items[].is_live | boolean | No | Whether the video is a live stream. | |||
| data.items[].is_short | boolean | No | Whether the video is a YouTube Short. | |||
| data.items[].is_verified | boolean | No | Whether the channel carries a verified badge. | |||
| data.items[].playlist_id | string | No | PL1234567890abcdef | YouTube playlist ID. Set for playlist results. | ||
| data.items[].position | integer | No | 1 | Position of the item on this page of results, starting at 1. | ||
| data.items[].published_text | string | No | 2 days ago | Upload time as YouTube displays it, such as `2 days ago`. | ||
| data.items[].short_view_count | string | No | 123K views | Abbreviated view count as YouTube displays it, such as `123K views`. | ||
| data.items[].subscriber_count | string | No | 1.93M subscribers | Subscriber count as YouTube displays it, such as `1.93M subscribers`. | ||
| data.items[].thumbnail | string | No | https://i.ytimg.com/vi/abc123/hq720.jpg | URL of the item's thumbnail image. | ||
| data.items[].title | string | No | ChatGPT Explained | Video or playlist title, or channel name. | ||
| data.items[].type | string | No | video | Kind of result: `video`, `channel` or `playlist`. | ||
| data.items[].url | string | No | https://www.youtube.com/watch?v=abc123 | Link to the video, channel or playlist on YouTube. | ||
| data.items[].video_count | string | No | 9 lessons | Number of videos as YouTube displays it, such as `12 videos`. Set for channel and playlist results. | ||
| data.items[].video_id | string | No | abc123xyz89 | YouTube video ID. Set for video results. | ||
| data.items[].view_count | string | No | 123,456 views | View count as YouTube displays it, such as `123,456 views`. | ||
| data.query | string | No | gpt | Search text that was run inside the channel. | ||
| data.thumbnail | string | No | https://yt3.googleusercontent.com/example=s176-c-k-c0x00ffffff-no-rj | URL of the channel's avatar image. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Missing or invalid parameters | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/youtube/channel/UCXZCJLdBC09xxGZ6gcdrc6A/search?q=gpt" \
-H "x-api-key: $CRAWLORA_API_KEY"