主题
POST /v3/serp/youtube/video_comments/live/advanced
/v3/serp/youtube/video_comments/live/advanced
POST https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced
https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced
本接口用于实时获取指定 YouTube 视频的评论数据。每次请求最多返回视频评论结果中的前 20 条,并提供评论信息、发布时间、点赞数和回复数等指标。
所有 POST 请求体使用 UTF-8 编码的 JSON 格式,并将任务参数放顶层 JSON 数组中。每个请求只能 1 个任务;平台限流以认证说明中的 30/60/120 次/分钟规则为准。
接口按请求计费。参考价约 ¥0.0144 / 次,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。获取 20 条结果时,可能产生额外费用;如果请求的 depth 高于返回结果数量,未使用部分将自动退还至账户余额。
X-SeerMarTech-Charge-CNY
depth
video_id
youtube_video
vQXvyV0zIP4
location_name
location_code
GET /v3/serp/youtube/locations
United States
2840
language_name
language_code
GET /v3/serp/youtube/languages
English
en
device
desktop
os
20
200
tag
data
> location_name 与 location_code 二选一;language_name 与 language_code 二选一。
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", "device": "desktop", "os": "windows", "depth": 20 } ]'
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", } payload = [ { "language_code": "en", "location_code": 2840, "video_id": "vQXvyV0zIP4", "device": "desktop", "os": "windows", } ] response = requests.post(url, headers=headers, json=payload, timeout=60) result = response.json() if result.get("status_code") == 20000: print(result) else: print( f"请求失败,错误码:{result.get('status_code')}," f"错误信息:{result.get('status_message')}" )
import axios from "axios"; 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", device: "desktop", os: "windows", }, ], { headers: { Authorization: "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json", }, } ); const result = response.data; if (result.status_code === 20000) { console.log(result); } else { console.error( `请求失败,错误码:${result.status_code},错误信息:${result.status_message}` ); }
服务端返回 JSON 数据,核心结果位于 tasks 数组中。
tasks
version
status_code
20000
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
2019-11-15 12:57:46 +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
2022-11-15 12:57:46 +00:00
likes_count
reply_count
{ "version": "0.1.20220819", "status_code": 20000, "status_message": "Ok.", "time": "4.1248 sec.", "cost": 0.0144, "tasks_count": 1, "tasks_error": 0, "tasks": [ { "id": "00000000-0000-0000-0000-000000000000", "status_code": 20000, "status_message": "Ok.", "time": "4.1248 sec.", "cost": 0.0144, "result_count": 1, "path": [ "v3", "serp", "youtube", "video_comments", "live", "advanced" ], "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": [ { "video_id": "vQXvyV0zIP4", "se_domain": "youtube.com", "location_code": 2840, "language_code": "en", "check_url": "https://www.youtube.com/watch?v=vQXvyV0zIP4", "datetime": "2019-11-15 12:57:46 +00:00", "spell": null, "refinement_chips": null, "item_types": [ "youtube_comment" ], "title": "The first-ever BMW M5 CS.", "comments_count": 4080, "items_count": 20, "items": [ { "type": "youtube_comment", "rank_group": 1, "rank_absolute": 1, "author_name": "Example Author", "author_thumbnail": "https://example.com/avatar.jpg", "author_url": "https://www.youtube.com/@example", "text": "Example comment text.", "publication_date": "2 years ago", "timestamp": "2022-11-15 12:57:46 +00:00", "likes_count": 120, "reply_count": 8 } ] } ] } ] }
请根据顶层 status_code 和任务级 status_code 判断请求是否成功。建议在客户端实现以下处理逻辑:
0
SERP YouTube 视频评论实时高级接口
POST
/v3/serp/youtube/video_comments/live/advanced接口概述
POST
https://api.seermartech.cn/v3/serp/youtube/video_comments/live/advanced本接口用于实时获取指定 YouTube 视频的评论数据。每次请求最多返回视频评论结果中的前 20 条,并提供评论信息、发布时间、点赞数和回复数等指标。
所有 POST 请求体使用 UTF-8 编码的 JSON 格式,并将任务参数放顶层 JSON 数组中。每个请求只能 1 个任务;平台限流以认证说明中的 30/60/120 次/分钟规则为准。
计费说明
接口按请求计费。参考价约 ¥0.0144 / 次,扣费以响应头
X-SeerMarTech-Charge-CNY为准。获取 20 条结果时,可能产生额外费用;如果请求的depth高于返回结果数量,未使用部分将自动退还至账户余额。请求参数
video_idyoutube_video项中获取。示例:vQXvyV0zIP4location_namelocation_code时填;使用此参数时无需再传location_code。可通过GET /v3/serp/youtube/locations获取可用地区。示例:United Stateslocation_codelocation_name时填;使用此参数时无需再传location_name。示例:2840language_namelanguage_code时填;使用此参数时无需再传language_code。可通过GET /v3/serp/youtube/languages获取可用语言。示例:Englishlanguage_codelanguage_name时填;使用此参数时无需再传language_name。示例:endevicedesktop。osdepth20;最大值:200。当设置值大于20时,如果搜索引擎返回 20 条结果,可能产生额外计费。tagdata对象中。>
location_name与location_code二选一;language_name与language_code二选一。请求示例
curl
Python
TypeScript
响应结构
服务端返回 JSON 数据,核心结果位于
tasks数组中。顶层响应字段
versionstatus_code20000。status_messagetimecostX-SeerMarTech-Charge-CNY为准。tasks_counttasks数组中的任务总数。tasks_errortasks数组中返回错误的任务数量。tasks任务字段
idstatus_code10000至60000范围。status_messagetimecostX-SeerMarTech-Charge-CNY为准。result_countresult数组中的数量。pathdataresultresult字段 video_idse_domainlocation_codelanguage_codecheck_urldatetimeyyyy-mm-dd hh-mm-ss +00:00。示例:2019-11-15 12:57:46 +00:00spellrefinement_chipsnull。item_typesyoutube_comment。titlecomments_countitems_countitems数组中返回的评论数量。itemsitems评论字段 typeyoutube_comment。rank_grouptype的结果会进行组排名,不同类型结果之间不计此字段。rank_absoluteauthor_nameauthor_thumbnailauthor_urltextpublication_datetimestampyyyy-mm-dd hh-mm-ss +00:00。示例:2022-11-15 12:57:46 +00:00likes_countreply_count响应示例
状态码与异常处理
请根据顶层
status_code和任务级status_code判断请求是否成功。建议在客户端实现以下处理逻辑:status_code是否为20000;tasks_error大于0的响应逐个检查任务状态;id、status_code和status_message,便于重试和问题追踪;X-SeerMarTech-Charge-CNY返回值为准。实用场景
likes_count、reply_count和排名筛选热门评论,定位潜在用户需求和舆风险。comments_count和评论明细,评估视频传播效果及用户参与度。