YouTube video comments by video id
justoneapi.x.youtube-get-video-comment-v1Retrieve first-level comments for a YouTube video with sorting, locale options, and cursor pagination.
- 价格
- $0.01476/success按目录价
- 成功率
- —暂无成功率数据暂无成功率数据
- 延迟 p50
- ——
- 最后验证
- 2026年7月28日实测可用
GEThttps://toolswitch.dev/v1/tools/justoneapi.x.youtube-get-video-comment-v1?cursor=0&sortBy=newest&videoId=dQw4w9WgXcQ&countryCode=US&languageCode=zh-CNBeta- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
cursor | 字符串 | 可选 | Pagination cursor returned by the previous response. | |
sortBy | 字符串 | 可选 | Sort order for the comment list. Available Values: - `top`: Top comments - `newest`: Newest comments One of: top, newest. | newest |
videoId | 字符串 | 必填 | The unique identifier for a YouTube video. | dQw4w9WgXcQ |
countryCode | 字符串 | 可选 | Region code for response data. | US |
languageCode | 字符串 | 可选 | Language preference for response data. | zh-CN |
- 查询参数
cursor字符串可选Pagination cursor returned by the previous response.
sortBy字符串可选Sort order for the comment list. Available Values: - `top`: Top comments - `newest`: Newest comments One of: top, newest.
示例:
newestvideoId字符串必填The unique identifier for a YouTube video.
示例:
dQw4w9WgXcQcountryCode字符串可选Region code for response data.
示例:
USlanguageCode字符串可选Language preference for response data.
示例:
zh-CN
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
Beta
curl -X GET 'https://toolswitch.dev/v1/tools/justoneapi.x.youtube-get-video-comment-v1?cursor=0&sortBy=newest&videoId=dQw4w9WgXcQ&countryCode=US&languageCode=zh-CN' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/justoneapi.x.youtube-get-video-comment-v1?cursor=0&sortBy=newest&videoId=dQw4w9WgXcQ&countryCode=US&languageCode=zh-CN",
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-get-video-comment-v1?cursor=0&sortBy=newest&videoId=dQw4w9WgXcQ&countryCode=US&languageCode=zh-CN", {
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());网关接口为 Beta,地址与鉴权方式可能变更。 示例参数仅为样例数据。 调用按 $0.01476/success 计费,已含服务费。