cURL
curl --request GET \
--url 'https://api.keyapi.ai/v1/youtube/search_channels?keyword=Rick+Astley&need_format=true' \
--header 'Authorization: Bearer <YOUR_API_KEY>'import requests
response = requests.get(
'https://api.keyapi.ai/v1/youtube/search_channels',
params={"keyword": "Rick Astley", "need_format": "true"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())const params = new URLSearchParams({"keyword": "Rick Astley", "need_format": "true"});
const response = await fetch(`https://api.keyapi.ai/v1/youtube/search_channels?${params}`, {
method: 'GET',
headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
});
const data = await response.json();
console.log(data);{
"code": 0,
"message": "success",
"data": {
"keyword": "Rick Astley",
"channels": [
{
"channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"title": "Rick Astley",
"handle": "@RickAstleyYT",
"subscriber_count_text": "4.46M subscribers",
"description": "2026 UK & Ireland Reflection Tour 🎟️ Tickets are on sale now. New single 'Waiting On You' out now.",
"thumbnails": [
{
"url": "//yt3.googleusercontent.com/vewxKdtll-rntHAMDPY_Qa6hPac3-J2sCFFUwvGSSR0i7hB4g5rNfF39lCEcjGvsYI0RWx7V1A=s88-c-k-c0x00ffffff-no-rj-mo",
"width": 88,
"height": 88
},
{
"url": "//yt3.googleusercontent.com/vewxKdtll-rntHAMDPY_Qa6hPac3-J2sCFFUwvGSSR0i7hB4g5rNfF39lCEcjGvsYI0RWx7V1A=s176-c-k-c0x00ffffff-no-rj-mo",
"width": 176,
"height": 176
}
],
"is_subscribed": false,
"canonical_url": "/@RickAstleyYT",
"channel_url": "https://www.youtube.com/@RickAstleyYT"
}
],
"continuation_token": null,
"has_more": false,
"total_count": 1
},
"requestId": "10380c82-2a7b-4e53-9ef1-65eac3f48652"
}{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}{
"code": 401,
"data": null,
"message": "apiKey is null"
}{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}{
"code": 500,
"data": null,
"message": "Internal server error"
}YouTube 频道
搜索频道
搜索YouTube频道 只返回频道类型的搜索结果(过滤掉视频、播放列表等) 支持分页获取更多频道
使用流程: 1.首次请求:只传 keyword 参数 2.获取响应中的 continuation_token 3.下次请求:传入 continuation_token(keyword 可选) 4.重复步骤 2-3 直到 has_more 为 false
注意事项: 每页通常返回 10-20 个频道 搜索结果只包含频道,不包含视频、播放列表等 搜索结果的顺序和数量由 YouTube 算法决定
GET
/
v1
/
youtube
/
search_channels
cURL
curl --request GET \
--url 'https://api.keyapi.ai/v1/youtube/search_channels?keyword=Rick+Astley&need_format=true' \
--header 'Authorization: Bearer <YOUR_API_KEY>'import requests
response = requests.get(
'https://api.keyapi.ai/v1/youtube/search_channels',
params={"keyword": "Rick Astley", "need_format": "true"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())const params = new URLSearchParams({"keyword": "Rick Astley", "need_format": "true"});
const response = await fetch(`https://api.keyapi.ai/v1/youtube/search_channels?${params}`, {
method: 'GET',
headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
});
const data = await response.json();
console.log(data);{
"code": 0,
"message": "success",
"data": {
"keyword": "Rick Astley",
"channels": [
{
"channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"title": "Rick Astley",
"handle": "@RickAstleyYT",
"subscriber_count_text": "4.46M subscribers",
"description": "2026 UK & Ireland Reflection Tour 🎟️ Tickets are on sale now. New single 'Waiting On You' out now.",
"thumbnails": [
{
"url": "//yt3.googleusercontent.com/vewxKdtll-rntHAMDPY_Qa6hPac3-J2sCFFUwvGSSR0i7hB4g5rNfF39lCEcjGvsYI0RWx7V1A=s88-c-k-c0x00ffffff-no-rj-mo",
"width": 88,
"height": 88
},
{
"url": "//yt3.googleusercontent.com/vewxKdtll-rntHAMDPY_Qa6hPac3-J2sCFFUwvGSSR0i7hB4g5rNfF39lCEcjGvsYI0RWx7V1A=s176-c-k-c0x00ffffff-no-rj-mo",
"width": 176,
"height": 176
}
],
"is_subscribed": false,
"canonical_url": "/@RickAstleyYT",
"channel_url": "https://www.youtube.com/@RickAstleyYT"
}
],
"continuation_token": null,
"has_more": false,
"total_count": 1
},
"requestId": "10380c82-2a7b-4e53-9ef1-65eac3f48652"
}{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}{
"code": 401,
"data": null,
"message": "apiKey is null"
}{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}{
"code": 500,
"data": null,
"message": "Internal server error"
}🪙3 credits每次请求
Copy for AI
🤖 让 AI 帮你写调用代码
点击按钮复制一段结构化提示词,可直接交给 ChatGPT、Claude 或其他 AI 助手生成接口调用代码。
授权
查询参数
搜索关键词(首次请求必填)
示例:
"Rick Astley"
分页token(可选,用于获取下一页)
是否格式化数据(默认 true) true: 返回格式化的结构化数据(推荐) false: 返回原始的 YouTube API 结构(用于调试)
响应
请求成功
The response is of type object.
⌘I

