cURL
curl --request GET \
--url 'https://api.keyapi.ai/v1/youtube/get_search_suggestions?keyword=Rick+Astley&language=en®ion=US' \
--header 'Authorization: Bearer <YOUR_API_KEY>'import requests
response = requests.get(
'https://api.keyapi.ai/v1/youtube/get_search_suggestions',
params={"keyword": "Rick Astley", "language": "en", "region": "US"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())const params = new URLSearchParams({"keyword": "Rick Astley", "language": "en", "region": "US"});
const response = await fetch(`https://api.keyapi.ai/v1/youtube/get_search_suggestions?${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",
"suggestions": [
"rick astley never gonna give you up",
"rick astley",
"rick astley together forever",
"rick astley pink pony club",
"rick astley foo fighters",
"rick astley never gonna give you up lyrics",
"rick astley interview",
"rick astley cry for help",
"rick astley songs",
"rick astley never gonna give you up live",
"rick astley take me to your heart",
"rick astley she wants to dance with me",
"rick astley it would take a strong strong man",
"rick astley whenever you need somebody"
],
"total_count": 14
},
"requestId": "aca97c0b-6216-4ba0-b502-df42fb0da1d7"
}{
"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搜索推荐词(自动补全) 类似于在YouTube搜索框输入时显示的推荐词
注意事项: 推荐词会根据语言和地区有所不同 通常返回 10-20 个推荐词 响应速度非常快(< 1秒)
GET
/
v1
/
youtube
/
get_search_suggestions
cURL
curl --request GET \
--url 'https://api.keyapi.ai/v1/youtube/get_search_suggestions?keyword=Rick+Astley&language=en®ion=US' \
--header 'Authorization: Bearer <YOUR_API_KEY>'import requests
response = requests.get(
'https://api.keyapi.ai/v1/youtube/get_search_suggestions',
params={"keyword": "Rick Astley", "language": "en", "region": "US"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())const params = new URLSearchParams({"keyword": "Rick Astley", "language": "en", "region": "US"});
const response = await fetch(`https://api.keyapi.ai/v1/youtube/get_search_suggestions?${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",
"suggestions": [
"rick astley never gonna give you up",
"rick astley",
"rick astley together forever",
"rick astley pink pony club",
"rick astley foo fighters",
"rick astley never gonna give you up lyrics",
"rick astley interview",
"rick astley cry for help",
"rick astley songs",
"rick astley never gonna give you up live",
"rick astley take me to your heart",
"rick astley she wants to dance with me",
"rick astley it would take a strong strong man",
"rick astley whenever you need somebody"
],
"total_count": 14
},
"requestId": "aca97c0b-6216-4ba0-b502-df42fb0da1d7"
}{
"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"
语言代码(可选,默认 en) 可选值 en: 英语 zh-cn: 简体中文 ja: 日语 ko: 韩语
地区代码(可选,默认 US) US: 美国 SG: 新加坡 CN: 中国 JP: 日本 KR: 韩国
响应
请求成功
The response is of type object.
⌘I

