主题
POST /v3/serp/youtube/video_comments/live/advanced
/v3/serp/youtube/video_comments/live/advanced
该接口用于实时获取指定 YouTube 视频下的评论数据。调用后可返回该视频的前 20 条评论,以及评论信息和互动指标。
POST
https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced
该接口按请求计费。
参考价约 ¥0.0320 / 次 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
X-SeerMarTech-Charge-CNY
JSON
[{ ... }]
以下为任务对象中可用字段说明。
video_id
/v3/serp/youtube/organic/live/advanced
youtube_video
vQXvyV0zIP4
location_name
location_code
POST /v3/serp/youtube/locations
United States
2840
language_name
language_code
POST /v3/serp/youtube/languages
English
en
device
desktop
os
windows
macos
depth
20
700
tag
data
接口返回 JSON 数据,顶层 tasks 数组。
tasks
version
status_code
/v3/appendix/errors
status_message
time
cost
tasks_count
tasks_error
id
10000–60000
result_count
result
path
se_domain
check_url
datetime
yyyy-mm-dd hh-mm-ss +00:00
spell
refinement_chips
null
item_types
youtube_comment
title
comments_count
items_count
items
type
rank_group
rank_absolute
author_name
author_thumbnail
author_url
text
publication_date
timestamp
likes_count
reply_count
curl --location --request POST "https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced" \ --header "Authorization: Bearer smt_live_YOUR_KEY" \ --header "Content-Type: application/json" \ --data-raw '[ { "language_code": "en", "location_code": 2840, "video_id": "vQXvyV0zIP4" } ]'
import requests url = "https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced" headers = { "Authorization": "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json" } data = [ { "language_code": "en", "location_code": 2840, "video_id": "vQXvyV0zIP4" } ] response = requests.post(url, headers=headers, json=data) print(response.json)
import axios from "axios"; async function fetchYoutubeVideoComments { const response = await axios.post( "https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced", [ { language_code: "en", location_code: 2840, video_id: "vQXvyV0zIP4", }, ], { headers: { Authorization: "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json", }, } ); console.log(response.data); } fetchYoutubeVideoComments.catch(console.error);
{ "version": "0.1.20220819", "status_code": 20000, "status_message": "Ok.", "time": "4.1248 sec.", "cost": 0.002, "tasks_count": 1, "tasks_error": 0, "tasks": [ { "data": { "api": "serp", "function": "live", "se": "youtube", "se_type": "video_comments", "language_code": "en", "location_code": 2840, "video_id": "vQXvyV0zIP4", "device": "desktop", "os": "windows" }, "result": [ { "title": "The first-ever BMW M5 CS.", "comments_count": 4080, "items_count": 20, "items": [] } ] } ] }
tasks[].status_code
常见判断方式:
20000
完整错误码说明请参考:/v3/appendix/errors
YouTube 视频评论实时抓取(高级版)
POST
/v3/serp/youtube/video_comments/live/advanced接口概述
该接口用于实时获取指定 YouTube 视频下的评论数据。调用后可返回该视频的前 20 条评论,以及评论信息和互动指标。
POSThttps://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced计费说明
该接口按请求计费。
参考价约 ¥0.0320 / 次 扣费以响应头
X-SeerMarTech-Charge-CNY为准。调用规则
JSON(UTF-8 编码)[{ ... }]请求参数
以下为任务对象中可用字段说明。
video_id/v3/serp/youtube/organic/live/advanced的youtube_video结果项中获取。示例:vQXvyV0zIP4location_namelocation_code,则此字段填。传此字段时无需再传location_code。可通过POST /v3/serp/youtube/locations获取可用地区列表。示例:United Stateslocation_codelocation_name,则此字段填。传此字段时无需再传location_name。可通过POST /v3/serp/youtube/locations获取可用地区列表。示例:2840language_namelanguage_code,则此字段填。传此字段时无需再传language_code。可通过POST /v3/serp/youtube/languages获取可用语言列表。示例:Englishlanguage_codelanguage_name,则此字段填。传此字段时无需再传language_name。可通过POST /v3/serp/youtube/languages获取可用语言列表。示例:endevicedesktoposwindows、macos。默认值:windowsdepth20,最大值:700。注意: 每 20 条结果按一个 SERP 单计费;若depth大于20,且搜索引擎返回 20 条结果,可能产生额外费用;若设置的depth高于返回数量,差额会自动退回到账户余额。tagdata对象中。响应结构
接口返回 JSON 数据,顶层
tasks数组。顶层字段
versionstatus_code/v3/appendix/errorsstatus_message/v3/appendix/errorstimecosttasks_counttasks数组中的任务数量tasks_errortasks数组中返回错误的任务数量taskstasks[] 字段
idstatus_code10000–60000,完整列表见/v3/appendix/errorsstatus_messagetimecostresult_countresult数组中的结果数量pathdataresultresult[] 字段
video_idse_domainlocation_codelanguage_codecheck_urldatetimeyyyy-mm-dd hh-mm-ss +00:00spellrefinement_chipsnullitem_typesyoutube_commenttitlecomments_countitems_countitems数组中的结果数itemsitems[] 字段
typeyoutube_commentrank_grouprank_absoluteauthor_nameauthor_thumbnailauthor_urltextpublication_datetimestampyyyy-mm-dd hh-mm-ss +00:00likes_countreply_count请求示例
cURL
Python
TypeScript
响应示例
状态码与错误处理
status_code表示整次请求的处理结果tasks[].status_code表示单个任务的处理结果status_codetasks[].status_code常见判断方式:
20000:请求成功完整错误码说明请参考:
/v3/appendix/errors使用建议
video_id须准确,否则无法返回目标视频评论。depth,但应注意可能产生额外计费。location_code与language_code,便于程序稳定处理。tag业务侧任务 ID。check_url可用于人工抽样核验。实用场景
likes_count和reply_count找出高热度评论,为社区运营、置顶回复和互动提供依据。text,归纳用户最心的产品特性、使用问题和购买意向。timestamp与publication_date观察评论在发布时间后的增长节奏,评估传播效果。location_code、language_code抓取评论结果,分析不同市场用户的反馈偏好。