Skip to content

Google Finance Markets 实时 HTML

POST /v3/serp/google/finance_markets/live/html

本接口通过实时请求获取 Google Finance「Markets」标签页的原始 HTML。返回取决于请求中指定的搜索位置、语言、设备及市场类型等参数。

请求方式: POST
接口路径: /v3/serp/wp/v2/live/html

> 说明:该接口使用 /v3/serp/wp/v2/live/html 容路径,请勿将文档示例中的路径视为本接口路径。

计费说明

每次提交请求都会产生费用。原始资料未提供固定单价;扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

所有 POST 请求体使用 UTF-8 编码的 JSON 格式,并以数组形式提交。每次调用只能一个任务;平台限流以认证说明中的 30/60/120 次/分钟规则为准。

请求参数

主要参数

参数类型说明
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。示例:London,England,United Kingdom
language_namestring搜索引擎语言的完整名称。如果未指定 language_code,则填写此参数。填写此参数后无需再填写 language_code。示例:English
osstring设备操作系统,可选值:windows
tagstring用户自定义任务标识,可选。最大长度为 255 个字符,可用于请求与响应。提交的值会在响应的 data 对象中返回。
market_typestringGoogle Finance 市场类型,可选。可选值:most-activeindexesindexes/americasindexes/europe-middle-east-africaindexes/asia-pacificgainerslosersclimate-leaderscryptocurrenciescurrencies。默认值:most-active

请求示例

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",
      "market_type": "most-active",
      "tag": "finance-markets-demo"
    }
  ]'

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",
}

# 每次调用只能提交一个任务
payload = [
    {
        "language_code": "en",
        "location_code": 2840,
        "device": "desktop",
        "market_type": "most-active",
        "tag": "finance-markets-demo",
    }
]

response = requests.post(url, headers=headers, json=payload)
result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        "请求失败,错误码:%s,错误信息:%s"
        % (result.get("status_code"), result.get("status_message"))
    )

TypeScript

typescript
import axios from "axios";

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

console.log(response.data);

响应结构

接口返回 JSON 对象顶层 tasks 数组。响应状态码及错误信息请参考错误码文档。

顶层字段

字段类型说明
versionstring当前 API 版本
status_codeinteger请求级状态码
status_messagestring请求级提示信息
timestring请求执行耗时,单位为秒
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量
tasks_errorintegertasks 数组中返回错误的任务数量
tasksarray任务结果数组

tasks 字段

字段类型说明
idstring任务唯一标识,采用 UUID 格式
status_codeinteger任务状态码,通常位于 1000060000 范围
status_messagestring任务状态说明
timestring任务执行耗时,单位为秒
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量
patharray请求 URL 路径
dataobject请求中提交的任务参数
resultarray任务结果数组

result 字段

字段类型说明
keywordstringPOST 请求中的字段。返回时会对经过 URL 编码的进行解码,+ 会被解码为空格。
typestring请求中的搜索引擎类型
se_domainstring请求中的搜索引擎域名
location_codeinteger搜索位置代码
language_codestring搜索语言代码
datetimestring接收结果的日期和时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。示例:2019-11-15 12:57:46 +00:00
items_countintegeritems 数组中的结果数量
itemsarraySERP 中找到的结果
pageinteger返回 HTML 页面的序号
datestringHTML 页面扫描时间,格式为 年-月-日 时:分:秒 UTC 时差。示例:2019-11-15 12:57:46 +00:00
htmlstring页面原始 HTML

响应示例

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": [
    {
      "id": " ಒಂದ2f5b8d-8c12-4b20-9f66-123456789abc",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "7.7120 sec.",
      "cost": 0.003,
      "result_count": 1,
      "path": [
        "v3",
        "serp",
        "wp",
        "v2",
        "live",
        "html"
      ],
      "data": {
        "api": "serp",
        "function": "live",
        "se": "wp",
        "se_type": "v2",
        "language_name": "English",
        "location_name": "United States",
        "tag": "finance-markets-demo",
        "device": "desktop",
        "os": "windows",
        "market_type": "most-active"
      },
      "result": [
        {
          "keyword": "",
          "type": "v2",
          "se_domain": "google.com",
          "location_code": 2840,
          "language_code": "en",
          "datetime": "2019-11-15 12:57:46 +00:00",
          "items_count": 1,
          "items": [],
          "page": 1,
          "date": "2019-11-15 12:57:46 +00:00",
          "html": "<html>...</html>"
        }
      ]
    }
  ]
}

状态码与错误处理

  • 当顶层或任务级 status_code20000 时,表示请求成功。
  • status_code 为值时,应结合 status_message 判断原因。
  • 建议客户端同时处理 HTTP 错误、请求级错误和任务级错误。
  • tasks_error 大于 0 时,应逐项检查 tasks 数组中对应任务的状态。
  • 实扣费金额应读取响应头 X-SeerMarTech-Charge-CNY,不要依据响应体中的 cost 字段进行结算。

实用场景

  • 抓取不同国家和语言的市场页面,统一采集 Google Finance Markets,支持跨地区金融市场监测。
  • 获取涨榜、跌榜和活跃市场数据,构建投资资讯或行业动态看板,缩短市场信息整理时间。
  • 采集股票指数、加密货币和汇率页面 HTML,保留完整原始页面,便于后续解析、归档和审计。
  • 按市场区域获取指数数据,对美洲、欧洲中东非洲及亚太市场进行区域化对比分析。
  • 定时保存市场页面快,追踪搜索结果页面变化,为金融 SEO、资讯更新和竞品研究提供数据依据。

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