YouTube Search in channel API
API health
- 24h health
- Normal
- Healthy / normal
- Available
Last 24 hours
Last 30 days
Search inside one YouTube channel by keyword, from the channel link or @handle. Rows are videos, Shorts and playlists (see type) with title, view count, duration, the time YouTube shows and badges. About 30 per page; pass next_page_token back as page_token for more.
Send POST https://api.everyinfra.com/api/v1/social with platform set to youtube and action set to search_in_channel. Price $0.56 per 1,000 requests ($0.000556 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.
AI prompt
#Please help me write a data collection script with the EveryInfra YouTube Search in channel endpoint (youtube/search_in_channel).
How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to youtube and action to search_in_channel, and put the parameters inside params.
- Required parameters:
- url: A YouTube channel link (https://www.youtube.com/@NASA or https://www.youtube.com/channel/UC…), an @handle, or a channel ID that starts with UC. Only this channel is searched.
- keyword: Search words, up to 200 characters. Results mix videos, Shorts and playlists; check each row's type.
- Optional parameters:
- page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. About 30 rows per page, as YouTube sends them.
- Returns a list of records. Main fields of each record: type, id, url, title, text, author_name, author_username, author_id, author_url, author_avatar_url, author_is_verified (Whether the channel has a verified badg…), view_count; 20 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=youtube.
- Example request body:
{
"platform": "youtube",
"action": "search_in_channel",
"params": {
"url": "https://www.youtube.com/@NASA",
"keyword": "moon"
}
}
- Price: $0.56 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.
Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.Request parameters
#| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | youtube | Platform identifier, fixed value. |
action | body | string | Yes | search_in_channel | Capability identifier, fixed value. |
url | body.params | string | Yes | - | A YouTube channel link (https://www.youtube.com/@NASA or https://www.youtube.com/channel/UC…), an @handle, or a channel ID that starts with UC. Only this channel is searched. |
keyword | body.params | string | Yes | - | Search words, up to 200 characters. Results mix videos, Shorts and playlists; check each row's type. |
page_token | body.params | string | No | - | Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. About 30 rows per page, as YouTube sends them; each page is one call and limit has no effect. Tokens last 24 hours, and the last page has no next_page_token. |
Code samples
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "youtube",
"action": "search_in_channel",
"params": {
"url": "https://www.youtube.com/@NASA",
"keyword": "moon"
}
}'OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
#{ "id": "req_…", "platform": "youtube", "action": "search_in_channel", "results": [ { "type": "video", "id": "IfRqrrBbT-Y", "url": "https://www.youtube.com/watch?v=IfRqrrBbT-Y", "title": "Artemis II Moon Mission Complete!", "text": "Our Artemis II Moon mission is complete!\nSpace Launch System rocket launched crew into space\nOrion spacecraft provided a safe “home away from home” for astronauts\nFlew around the Moon,...", "author_name": "NASA", "author_username": "NASA", "author_id": "•••", "author_url": "https://www.youtube.com/@NASA", "author_avatar_url": "https://yt3.googleusercontent.com/•••", "author_is_verified": true, "view_count": 987902, "duration": "00:03:33", "published_text": "7 months ago", "thumbnail_url": "https://i.ytimg.com/vi/IfRqrrBbT-Y/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLB1B1sNNE_AOGy5LPLeaDP38ZN80A", "badges": [ "CC" ], "platform": "youtube" }, { "type": "video", "id": "Vg-EQ7MOu6I", "url": "https://www.youtube.com/watch?v=Vg-EQ7MOu6I", "title": "Around the Moon for All Humanity: Artemis II (Official Launch Trailer)", "text": "Action. Wonder. Adventure. Artemis II has got it all. Don't miss the moment. Our crewed Moon mission will launch as early as April 1.\n\nUnder Artemis, NASA will send astronauts on increasingly...", "author_name": "NASA", "author_username": "NASA", "author_id": "•••", "author_url": "https://www.youtube.com/@NASA", "author_avatar_url": "https://yt3.googleusercontent.com/•••", "author_is_verified": true, "view_count": 1650126, "duration": "00:01:16", "published_text": "7 months ago", "thumbnail_url": "https://i.ytimg.com/vi/Vg-EQ7MOu6I/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAwlAQUzbi1WhsHnEROLKj3nvYryA", "badges": [ "CC" ], "platform": "youtube" } ], "next_page_token": …, "pagination": { … }, "count": 30, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Response fields
#Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.
| Field | Meaning |
|---|---|
type | Record type; values depend on the capability (for example video / image / text). |
id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
url | Link to the record on the platform. |
title | Title. null when the platform has no titles (for example text-only posts). |
text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
author_name | Author's display name. |
author_username | Author's username (@handle), usually usable in URLs. |
author_id | Author's unique ID on the platform. |
author_url | Link to the author's profile on the platform. |
author_avatar_url | Keeps the platform's own meaning |
author_is_verified | Whether the channel has a verified badge. |
view_count | Views or plays. null means not disclosed, not 0. |
duration | Keeps the platform's own meaning |
published_text | Publish time as written on the YouTube page, in relative form (e.g. 2 years ago), returned as is; null when the page shows none. |
thumbnail_url | Thumbnail link, lower resolution than image_url. |
badges | Badges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none. |
is_live | Whether the video is live now. |
is_upcoming | Whether it is a premiere or scheduled live stream that has not started yet. |
playlist_id | ID of the playlist or mix when the row is one; otherwise null. |
video_count | Keeps the platform's own meaning |
platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
Errors and billing
#- 401
- Missing or invalid key.
- 402
- Insufficient balance. Top up first.
- 422
- Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
- 429
- Per-minute request limit reached. Wait for Retry-After, then try again.
- 503
- Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
- 200 empty
- No data. No charge.