Search YouTube by keyword
justoneapi.x.youtube-search-v1Search YouTube by keyword with optional type, upload-date, duration, feature, and sort filters, or continue with a token.
- 价格
- $0.01476/success按供应商原价
- 成功率
- 99.8%近 30 天 · 1,741 次
- 延迟 p50
- 2.5 秒p95 3.9 秒
- 最后验证
- 2026年7月28日实测可用
GEThttps://toolswitch.dev/v1/tools/justoneapi.x.youtube-search-v1?keyword=coffee预览- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
type | 字符串 | 可选 | Filter results by result type. Available Values: - `video`: Video results - `channel`: Channel results - `playlist`: Playlist results - `movie`: Movie results One of: video, channel, playlist, movie. | |
sortBy | 字符串 | 可选 | Sort order for search results. Available Values: - `relevance`: Sort by relevance - `upload_date`: Sort by upload date - `view_count`: Sort by view count - `rating`: Sort by rating One of: relevance, upload_date, view_count, rating. | |
keyword | 字符串 | 可选 | Search keyword. Required on the first request; leave empty when using a continuation token. | |
duration | 字符串 | 可选 | Filter video results by duration. Supported request values: short, medium, long. Available Values: - `SHORT`: Short videos under 4 minutes - `MEDIUM`: Medium videos from 4 to 20 minutes - `LONG`: Long videos over 20 minutes One of: SHORT, MEDIUM, LONG. | |
features | 字符串 | 可选 | Feature filters separated by commas. Supported values: live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr. One of: live, FOUR_K, hd, subtitles, creative_commons, THREE_SIXTY, vr180, THREE_D, hdr. | |
uploadDate | 字符串 | 可选 | Filter results by upload date. Available Values: - `last_hour`: Uploaded within the last hour - `today`: Uploaded today - `this_week`: Uploaded this week - `this_month`: Uploaded this month - `this_year`: Uploaded this year One of: last_hour, today, this_week, this_month, this_year. | |
continuationToken | 字符串 | 可选 | Pagination token returned by the previous response. | |
- 查询参数
type字符串可选Filter results by result type. Available Values: - `video`: Video results - `channel`: Channel results - `playlist`: Playlist results - `movie`: Movie results One of: video, channel, playlist, movie.
sortBy字符串可选Sort order for search results. Available Values: - `relevance`: Sort by relevance - `upload_date`: Sort by upload date - `view_count`: Sort by view count - `rating`: Sort by rating One of: relevance, upload_date, view_count, rating.
keyword字符串可选Search keyword. Required on the first request; leave empty when using a continuation token.
duration字符串可选Filter video results by duration. Supported request values: short, medium, long. Available Values: - `SHORT`: Short videos under 4 minutes - `MEDIUM`: Medium videos from 4 to 20 minutes - `LONG`: Long videos over 20 minutes One of: SHORT, MEDIUM, LONG.
features字符串可选Feature filters separated by commas. Supported values: live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr. One of: live, FOUR_K, hd, subtitles, creative_commons, THREE_SIXTY, vr180, THREE_D, hdr.
uploadDate字符串可选Filter results by upload date. Available Values: - `last_hour`: Uploaded within the last hour - `today`: Uploaded today - `this_week`: Uploaded this week - `this_month`: Uploaded this month - `this_year`: Uploaded this year One of: last_hour, today, this_week, this_month, this_year.
continuationToken字符串可选Pagination token returned by the previous response.
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
curl -X GET 'https://toolswitch.dev/v1/tools/justoneapi.x.youtube-search-v1?keyword=coffee' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/justoneapi.x.youtube-search-v1?keyword=coffee",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/justoneapi.x.youtube-search-v1?keyword=coffee", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.01476/success 计费,已含服务费。