YouTube — 综合搜索
SpiderHubs OpenAPI 文档:YouTube — 综合搜索,分类 YouTube。接口 GET /openapi/v1/contentcreator/youtube/web_v2/get_general_search_v2。搜索视频、Shorts、频道和播放列表,返回已整理的结果。首次传 key...
OpId:
yt-search · 最近更新: 2026-11-19说明
搜索视频、Shorts、频道和播放列表,返回已整理的结果。首次传 keyword。下一页只传上次的 continuation_token。
基础信息
- Endpoint:
- GET /openapi/v1/contentcreator/youtube/web_v2/get_general_search_v2
- 计费:
- 1 积分 / 次
- 限流:
- 300 次 / 分钟 / 用户
请求参数说明
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| keyword | string | 否 | 关键词。首次请求必填,最长 200 字 |
| continuation_token | string | 否 | 翻页令牌 |
| upload_date | string | 否 | last_hour / today / this_week / this_month / this_year |
| type | string | 否 | video / channel / playlist / movie |
| duration | string | 否 | short 短于 4 分钟,medium 4–20 分钟,long 长于 20 分钟 |
| features | string | 否 | 逗号分隔:live、4k、hd、subtitles、creative_commons、360、vr180、3d、hdr |
| sort_by | string | 否 | relevance / upload_date / view_count / rating |
响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 业务状态码,200 表示成功 |
| request_id | string | 本次请求唯一标识,排查问题时可提供 |
| data | object | 业务数据容器,具体字段见下 |
| data.videos | array | 视频结果:标题、时长、播放量、作者、频道 ID、封面 |
| data.shorts | array | Shorts 结果 |
| data.channels | array | 频道结果 |
| data.playlists | array | 播放列表结果 |
| data.continuation_token | string | 下一页令牌 |
请求示例 · cURL
curl 'https://api.spiderhubs.com/openapi/v1/contentcreator/youtube/web_v2/get_general_search_v2?keyword=python&type=video&sort_by=relevance' \
-H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx'响应示例
{
"code": 200,
"request_id": "e10a77c2-2d44-4a90-b618-33f9c0ab7712",
"data": {
"videos": [
{
"title": "Python tutorial",
"video_id": "ZFEnfscZpAU",
"url": "https://www.youtube.com/watch?v=ZFEnfscZpAU",
"author": "Example channel"
}
],
"shorts": [],
"channels": [],
"playlists": [],
"continuation_token": ""
}
}开始调用 SpiderHubs API
使用账户中心生成的 API Key,通过 Authorization: Bearer sk_live_xxx 调用接口。