从频道ID获取频道URL
curl --request GET \
--url https://api.keyapi.ai/v1/youtube/get_channel_url \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keyapi.ai/v1/youtube/get_channel_url"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keyapi.ai/v1/youtube/get_channel_url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.keyapi.ai/v1/youtube/get_channel_url")
.header("Authorization", "Bearer <token>")
.asString();{
"code": 0,
"message": "success",
"data": {
"channel_id": "UCeu6U67OzJhV1KwBansH3Dg",
"channel_url": "https://www.youtube.com/channel/UCeu6U67OzJhV1KwBansH3Dg",
"vanity_url": "http://www.youtube.com/@CozyCraftYT"
},
"requestId": "2e5cb962-218f-4eb1-a547-ba1be49a8a4e"
}{
"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 频道
从频道ID获取频道URL
从YouTube频道ID转换获取频道Handle (@用户名) 与 get_channel_id 接口互为反向操作
使用场景: 当你有频道ID但需要获取@用户名格式的URL时 需要展示用户友好的频道链接时
GET
/
v1
/
youtube
/
get_channel_url
从频道ID获取频道URL
curl --request GET \
--url https://api.keyapi.ai/v1/youtube/get_channel_url \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keyapi.ai/v1/youtube/get_channel_url"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keyapi.ai/v1/youtube/get_channel_url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.keyapi.ai/v1/youtube/get_channel_url")
.header("Authorization", "Bearer <token>")
.asString();{
"code": 0,
"message": "success",
"data": {
"channel_id": "UCeu6U67OzJhV1KwBansH3Dg",
"channel_url": "https://www.youtube.com/channel/UCeu6U67OzJhV1KwBansH3Dg",
"vanity_url": "http://www.youtube.com/@CozyCraftYT"
},
"requestId": "2e5cb962-218f-4eb1-a547-ba1be49a8a4e"
}{
"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每次请求
复制给 AI
🤖 为什么还要自己写代码?
让 AI 来处理重复工作。点击按钮即可复制一段整理好的提示词,用于 ChatGPT、Claude 或你常用的 AI 助手。
授权
接口鉴权凭证。请在请求 Header 中传入 Authorization: Bearer <YOUR_API_KEY>。
可在 Dashboard 获取你的 API Key。
响应
请求成功
The response is of type object.

