频道 Shorts
通过YouTube频道ID检索公开的Shorts,支持可选的continuation-token分页。用于浏览频道的短视频并继续加载更多结果页。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
channel_id |
必填 | string | YouTube频道的以UC为前缀的唯一标识符。不支持@用户名形式的标识符。 | UCX6OQ3DkcsbYNE6H8uQQuVA |
— |
continuation_token |
可选 | string | 上一次响应返回的分页令牌。 | — | — |
代码示例
curl -G "https://api.mofa-ai.com/v1/youtube/get_channel_shorts_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'channel_id=UCX6OQ3DkcsbYNE6H8uQQuVA'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/youtube/get_channel_shorts_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"channel_id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/youtube/get_channel_shorts_v1");
url.search = new URLSearchParams({
channel_id: "UCX6OQ3DkcsbYNE6H8uQQuVA",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
采集于 2026-11-08,耗时 3226 ms · 请求参数 {"channel_id": "UCX6OQ3DkcsbYNE6H8uQQuVA"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "youtube.get_channel_shorts_v1",
"cost_usd": 0.02,
"data": {
"code": 0,
"data": {
"shorts": [
{
"title": "Trap Door Roulette",
"video_id": "kPI9Mc35mOg",
"video_url": "https://www.youtube.com/shorts/kPI9Mc35mOg",
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/kPI9Mc35mOg/frame0.jpg",
"width": 1080,
"height": 1920
}
],
"view_count_text": "44 million views",
"accessibility_text": "Trap Door Roulette, 44 million views - play Short"
},
{
"title": "Can A Robot Do My Chores?",
"video_id": "41UzbuW6wJs",
"video_url": "https://www.youtube.com/shorts/41UzbuW6wJs",
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/41UzbuW6wJs/frame0.jpg",
"width": 1080,
"height": 1920
}
],
"view_count_text": "69 million views",
"accessibility_text": "Can A Robot Do My Chores?, 69 million views - play Short"
},
"… +46"
],
"has_more": true,
"channel_id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"total_count": 48,
"continuation_token": "4qmFsgLBCxIYVUNYNk9RM0RrY3NiWU5FNkg4dVFRdVZBGqQLOGdhM0NCcTBDRkt4Q0RLdUNBb2tObU0yTUdJM1lXTXRNREF3TUMweVl6aGxMV0kxTXpRdE5UZ3lOREk1WVdFNU1EWTRFb01JUVdOV09GWmtWVTVrVGpReVdYZG5YM1V3WW5selJ6TXllQzFuVERWNFox…"
},
"message": null,
"requestId": "48149f0623c74cbe80e5aab64e92a5a1",
"recordTime": "2026-11-08T08:00:11.471511768",
"requestParams": {
"body": null,
"query": {
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA"
}
}
}
}