Skip to content

Google Finance Markets 实时 HTML

本接口用于获取 Google Finance「Markets」标签页的原始 HTML。返回结果会受到请求中 locationlanguage 参数的影响,适合需要抓取页面原始结构、自定义解析 DOM 或复现页面展示结果的场景。

接口说明

  • 请求方式POST
  • 接口路径/v3/serp/wp/v2/live/html
  • 完整地址https://api.seermartech.cn/v3/serp/wp/v2/live/html

说明:

  • 单次 Live SERP 请求只提交 1 个任务
  • 每分钟最多可发送 2000 次 API 调用
  • POST 数据需使用 UTF-8 编码的 JSON 格式
  • 请求体为 JSON 数组:[{ ... }]

计费说明

该接口按请求计费。

参考价约 ¥0.0480 / 次 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数

主要参数

字段名类型说明
location_codeinteger条件填搜索引擎地区代码。若未传 location_name,则提供该字段;传后可不再传 location_name。可通过 /v3/serp/google/locations 获取可用地区代码。示例:2840
language_codestring条件填搜索引擎语言代码。若未传 language_name,则提供该字段;传后可不再传 language_name。可通过 /v3/serp/google/languages 获取可用语言代码。示例:en
devicestring设备类型。可选值:desktop

附加参数

字段名类型说明
location_namestring条件填搜索引擎地区完整名称。若未传 location_code,则提供该字段;传后可不再传 location_code。可通过 /v3/serp/google/locations 获取可用地区名称。示例:London,England,United Kingdom
language_namestring条件填搜索引擎语言完整名称。若未传 language_code,则提供该字段;传后可不再传 language_code。可通过 /v3/serp/google/languages 获取可用语言名称。示例:English
osstring设备操作系统。可选值:windows
tagstring自定义任务标识,最长 255 个字符。可用于请求与结果对账;响应中的 data 对象会返回该值
market_typestringGoogle Finance 市场类型。可选值:most-activeindexesindexes/americasindexes/europe-middle-east-africaindexes/asia-pacificgainerslosersclimate-leaderscryptocurrenciescurrencies。默认值:most-active

返回结果说明

接口返回 JSON 数据,顶层 tasks 数组,用于承载本次创建任务的处理结果。

顶层字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码,完整列表参见 /v3/appendix/errors
status_messagestring通用状态信息,完整列表参见 /v3/appendix/errors
timestring执行耗时,单位秒
costfloat本次请求总成本,单位 USD
tasks_countintegertasks 数组中的任务数量
tasks_errorinteger返回错误的任务数量
tasksarray任务结果数组

tasks[] 字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,取值范围通常为 10000-60000,完整列表参见 /v3/appendix/errors
status_messagestring任务状态信息
timestring任务执行耗时,单位秒
costfloat当前任务成本,单位 USD
result_countintegerresult 数组中的结果数量
patharray请求路径信息
dataobject回显请求时提交的参数
resultarray结果数组

result[] 字段

字段名类型说明
keywordstringPOST 数组中传的。若 %## 编码会自动解码,+ 会被解码为空格
typestringPOST 数组中的搜索引擎类型
se_domainstringPOST 数组中的搜索引擎域名
location_codeintegerPOST 数组中的地区代码
language_codestringPOST 数组中的语言代码
datetimestring结果抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00
items_countintegeritems 数组中的结果数量
itemsarraySERP 结果项数组

items[] 字段

字段名类型说明
pageinteger返回的 HTML 页序号
datestringHTML 抓取时间,格式:year-month-date:minutes:UTC_difference_hours:UTC_difference_minutes
htmlstring原始 HTML 页面

请求示例

cURL

bash
curl --location --request POST "https://api.seermartech.cn/v3/serp/wp/v2/live/html" \
 --header "Authorization: Bearer smt_live_YOUR_KEY" \
 --header "Content-Type: application/json" \
 --data-raw '[
 {
 "language_code": "en",
 "location_code": 2840,
 "device": "desktop",
 "os": "windows",
 "market_type": "most-active",
 "tag": "tag1"
 }
 ]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/serp/wp/v2/live/html"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}
data = [
 {
 "language_code": "en",
 "location_code": 2840,
 "device": "desktop",
 "os": "windows",
 "market_type": "most-active",
 "tag": "tag1"
 }
]

response = requests.post(url, headers=headers, json=data)
print(response.json)

TypeScript

typescript
import axios from "axios";

async function main {
 const response = await axios.post(
 "https://api.seermartech.cn/v3/serp/wp/v2/live/html",
 [
 {
 language_code: "en",
 location_code: 2840,
 device: "desktop",
 os: "windows",
 market_type: "most-active",
 tag: "tag1",
 },
 ],
 {
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json",
 },
 }
 );

 console.log(response.data);
}

main.catch(console.error);

响应示例

json
{
 "version": "0.1.20200130",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "7.7543 sec.",
 "cost": 0.003,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "serp",
 "function": "live",
 "se": "wp",
 "se_type": "v2",
 "language_name": "English",
 "location_name": "United States",
 "tag": "tag1",
 "device": "desktop",
 "os": "windows"
 },
 "result": [
 {
 "items": [
 {
 "page": 1,
 "date": "2019-11-15 12:57:46 +00:00",
 "html": "<!doctype html>...</html>"
 }
 ]
 }
 ]
 }
 ]
}

状态码与错误处理

  • 顶层 status_code 表示整次请求的处理状态
  • tasks[].status_code 表示单个任务的处理状态
  • 建议同时检查:
  • 顶层 status_code
  • tasks_error
  • 每个任务的 status_code
  • 错误码与状态说明请参考:/v3/appendix/errors

建议在系统中实现异常处理与重试机制,是在批量拉取市场页面、监控不同地区金融展示结果时。

使用说明补

  • 本接口返回的是原始 HTML,而不是结构化金融字段
  • 如果你需要自行提取涨跌榜、指数模块、币种/汇率列表等,应在业务侧解析 items[].html
  • 返回与地区、语言、市场类型密切,建议固定参数组合以保证结果可比性
  • 单次请求 1 个任务,因此批量抓取时应在客户端按任务逐条发送

实用场景

  • 抓取热门市场页:获取 most-activegainerslosers 等页面原始 HTML,用于构建自有金融观察看板或舆源
  • 监控地区差异:按不同 location_codelanguage_code 拉取 Markets 页面,比较不同国家/语言环境下的金融展示差异
  • 解析加密货币与汇率模块:使用 cryptocurrenciescurrencies 页面 HTML,自定义抽取币种、汇率和卡片,服务聚合业务
  • 跟踪指数栏目结构变化:抓取 indexes/americasindexes/asia-pacific 等页面,监测页面 DOM 或块变化,降低解析规则失效风险
  • 验证搜索展示结果:在 SEO 或运营场景中复现特定地区和语言下的 Markets 页面原始输出,排查抓取结果与前端展示不一致的问题

统一入口:官网 · LLM API · 控制台