主题
通过任务 id 获取 YouTube 视频评论抓取任务的高级结果。
id
请求方式: GET请求地址:
GET
https://api.seermartech.cn/v3/serp/youtube/video_comments/task_get/advanced/$id
$id 为任务唯一标识符,采用 UUID 格式。任务创建后,可在 30 天 随时调用本接口获取结果。
$id
本接口本身不会重复扣费;费用在创建任务时产生。任务提交后的 30 天,结果可查询。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
X-SeerMarTech-Charge-CNY
你可以通过以下沙箱地址查看本接口可能返回的完整字段结构,响应中的字段为模拟数据:
https://sandbox.本平台.com/v3/serp/youtube/video_comments/task_get/advanced/00000000-0000-0000-0000-000000000000
沙箱接口不计费。
接口返回 JSON 数据,顶层 tasks 数组。
tasks
version
status_code
status_message
time
cost
tasks_count
tasks_error
10000-60000
result_count
result
path
data
video_id
se_domain
location_code
language_code
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
id="02261816-2027-0066-0000-c27d02864073" curl --location --request GET "https://api.seermartech.cn/v3/serp/youtube/video_comments/task_get/advanced/${id}" \ --header "Authorization: Bearer smt_live_YOUR_KEY" \ --header "Content-Type: application/json"
import requests task_id = "02261816-2027-0066-0000-c27d02864073" url = f"https://api.seermartech.cn/v3/serp/youtube/video_comments/task_get/advanced/{task_id}" headers = { "Authorization": "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) print(response.json)
import axios from "axios"; const taskId = "02231256-2604-0066-2000-57133b8fc54e"; axios({ method: "get", url: `https://api.seermartech.cn/v3/serp/youtube/video_comments/task_get/advanced/${taskId}`, headers: { Authorization: "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json", }, }) .then((response) => { // 输出任务结果 console.log(response.data); }) .catch((error) => { console.error(error); });
通常建议调用已完成任务列表接口,再按任务 ID 获取结果:
GET /v3/serp/youtube/video_comments/tasks_ready
GET /v3/serp/youtube/video_comments/task_get/advanced/$id
import requests headers = { "Authorization": "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json" } # 1. 获取已完成任务列表 ready_url = "https://api.seermartech.cn/v3/serp/youtube/video_comments/tasks_ready" ready_resp = requests.get(ready_url, headers=headers).json results = [] if ready_resp.get("status_code") == 20000: for task_group in ready_resp.get("tasks", []): for task in task_group.get("result", []): endpoint = task.get("endpoint_advanced") if endpoint: # 2. 拉取每个已完成任务的高级结果 result_resp = requests.get( "https://api.seermartech.cn" + endpoint, headers=headers ).json results.append(result_resp) print(results)
import axios from "axios"; const headers = { Authorization: "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json", }; async function fetchCompletedTasks { const readyResponse = await axios.get( "https://api.seermartech.cn/v3/serp/youtube/video_comments/tasks_ready", { headers } ); const results: any[] = []; if (readyResponse.data.status_code === 20000) { for (const taskGroup of readyResponse.data.tasks || []) { for (const task of taskGroup.result || []) { if (task.endpoint_advanced) { const taskResponse = await axios.get( `https://api.seermartech.cn${task.endpoint_advanced}`, { headers } ); results.push(taskResponse.data); } } } } console.log(results); } fetchCompletedTasks.catch(console.error);
{ "version": "0.1.20220819", "status_code": 20000, "status_message": "Ok.", "time": "0.0816 sec.", "cost": 0, "tasks_count": 1, "tasks_error": 0, "tasks": [ { "data": { "api": "serp", "function": "task_get", "se": "youtube", "se_type": "video_comments", "language_code": "en", "location_code": 2840, "video_id": "vQXvyV0zIP4", "priority": 2, "device": "desktop", "os": "windows" }, "result": [ { "title": "The first-ever BMW M5 CS.", "comments_count": 4081, "items_count": 20, "items": [] } ] } ] }
tasks[].status_code
0
40000+
获取 YouTube 视频评论高级结果
通过任务
id获取 YouTube 视频评论抓取任务的高级结果。接口说明
请求方式:
GET请求地址:https://api.seermartech.cn/v3/serp/youtube/video_comments/task_get/advanced/$id$id为任务唯一标识符,采用 UUID 格式。任务创建后,可在 30 天 随时调用本接口获取结果。计费说明
本接口本身不会重复扣费;费用在创建任务时产生。任务提交后的 30 天,结果可查询。
扣费以响应头
X-SeerMarTech-Charge-CNY为准。路径参数
id沙箱调试
你可以通过以下沙箱地址查看本接口可能返回的完整字段结构,响应中的字段为模拟数据:
https://sandbox.本平台.com/v3/serp/youtube/video_comments/task_get/advanced/00000000-0000-0000-0000-000000000000沙箱接口不计费。
返回结果说明
接口返回 JSON 数据,顶层
tasks数组。顶层字段
versionstatus_codestatus_messagetimecosttasks_counttasks数组中的任务数量tasks_errortasks数组中返回错误的任务数量taskstasks[] 字段
idstatus_code10000-60000status_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
已完成任务查询示例
通常建议调用已完成任务列表接口,再按任务 ID 获取结果:
GET /v3/serp/youtube/video_comments/tasks_readyGET /v3/serp/youtube/video_comments/task_get/advanced/$idPython 示例:取 ready 任务,再取结果
TypeScript 示例:取 ready 任务,再取结果
响应示例
错误处理建议
status_code和status_message,确认请求是否成功。tasks[].status_code,判断单个任务是否执行成功。tasks_error大于0,说明部分任务返回异常。40000+的状态码建立统一重试、告警和异常处理机制。结果解读建议
comments_count可用于评估视频整体互动规模。items中每条youtube_comment代表一条评论记录。likes_count与reply_count可用于识别高互动评论。timestamp与publication_date可用于分析评论时间分布与热点时段。author_name、author_url可用于识别高频互动用户或核心受众。实用场景
likes_count、reply_count找出最有传播价值的用户观点,用于选题或社区运营。timestamp分析评论出现节奏,评估视频发布后不同时间段的受众参与。