Search YouTube by keyword — videos, channels, playlists
scrapecreators.x.v1-youtube-searchSearches YouTube by keyword query and returns matching videos, channels, playlists, shorts, shelves, and live streams.
- 价格
- $0.00188/call按供应商原价
- 成功率
- 100%近 30 天 · 50,454 次
- 延迟 p50
- 1.2 秒p95 3.7 秒
- 最后验证
- —尚未验证
GEThttps://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-search?sortBy=relevance预览- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
type | 字符串 | 可选 | Type of content to search for. Plural forms: videos | shorts | channels | playlists (not video/channel). | videos |
query | 字符串 | 必填 | Search query | |
region | 字符串 | 可选 | 2 letter country code of the country to put the proxy in. | US |
sortBy | 字符串 | 可选 | Only relevance|popular work. view_count, upload_date, and rating are NOT accepted (HTTP 400). | relevance |
duration | 字符串 | 可选 | Duration of the video. Only applies to videos (not shorts). One of: under_3_min | between_3_and_20_min | over_20_min. | under_3_min |
uploadDate | 字符串 | 可选 | Filter by upload date. One of: today | this_week | this_month | this_year. | |
includeExtras | 字符串 | 可选 | This will get you the like + comment count and the description. To get the full details of the video, use the /v1/youtube/video endpoint. *This will slow down the response slightly.* | false |
continuationToken | 字符串 | 可选 | Continuation token to get more videos. Get 'continuationToken' from previous response. | 4qmFsgKrCBIYVUNkRkpXVWE0M3NtUm00SXBIQnB |
- 查询参数
type字符串可选Type of content to search for. Plural forms: videos | shorts | channels | playlists (not video/channel).
示例:
videosquery字符串必填Search query
region字符串可选2 letter country code of the country to put the proxy in.
示例:
USsortBy字符串可选Only relevance|popular work. view_count, upload_date, and rating are NOT accepted (HTTP 400).
示例:
relevanceduration字符串可选Duration of the video. Only applies to videos (not shorts). One of: under_3_min | between_3_and_20_min | over_20_min.
示例:
under_3_minuploadDate字符串可选Filter by upload date. One of: today | this_week | this_month | this_year.
includeExtras字符串可选This will get you the like + comment count and the description. To get the full details of the video, use the /v1/youtube/video endpoint. *This will slow down the response slightly.*
示例:
falsecontinuationToken字符串可选Continuation token to get more videos. Get 'continuationToken' from previous response.
示例:
4qmFsgKrCBIYVUNkRkpXVWE0M3NtUm00SXBIQnB
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
curl -X GET 'https://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-search?sortBy=relevance' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-search?sortBy=relevance",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-search?sortBy=relevance", {
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.00188/call 计费,已含服务费。