Skip to content

Google Finance Explore 实时 HTML 结果

POST /v3/serp/google/finance_explore/live/html

本接口用于实时获取 Google Finance「Explore(探索)」页的原始 HTML。返回结果取决于请求中指定的地区和语言参数。

请求方法与路径:

http
POST https://api.seermartech.cn/v3/serp/wp/v2/live/html

> /v3/serp/wp/v2/live/html 为容 API 路径。每次请求只能提交 1 个任务;平台限流以认证说明中的 30/60/120 次/分钟规则为准。

计费说明

每个请求单独计费,示例响应中的 cost 为历史计费字段。示例值 0.003 美对应参考价约 ¥0.0216 / 次

扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数

请求体使用 UTF-8 编码的 JSON 数组格式:

json
[
  {
    "language_code": "en",
    "location_code": 2840
  }
]

主要参数

参数类型说明
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 对象中。
news_typestring财经新闻筛选类型,可选。可用值:top_storieslocal_marketworld_markets。默认值:top_stories

响应结构

接口返回 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 结果字段

字段类型说明
keywordstring请求中提交的。返回时会对经过 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 中发现的搜索结果。

items 数组字段

字段类型说明
pageinteger返回的 HTML 页面序号。
datestringHTML 页面抓取时间,格式为:year-month-date:minutes:UTC_difference_hours:UTC_difference_minutes。例如:2019-11-15 12:57:46 +00:00
htmlstringGoogle Finance Explore 页面的原始 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",
      "news_type": "top_stories",
      "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",
}

payload = [
    {
        "language_code": "en",
        "location_code": 2840,
        "device": "desktop",
        "os": "windows",
        "news_type": "top_stories",
        "tag": "tag1",
    }
]

response = requests.post(url, headers=headers, json=payload, timeout=60)
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",
      os: "windows",
      news_type: "top_stories",
      tag: "tag1",
    },
  ],
  {
    headers: {
      Authorization: "Bearer smt_live_YOUR_KEY",
      "Content-Type": "application/json",
    },
  }
);

console.log(response.data);

响应示例

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": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "7.7543 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",
        "keyword": "NASDAQ-100",
        "tag": "tag1",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "keyword": "NASDAQ-100",
          "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>"
            }
          ]
        }
      ]
    }
  ]
}

错误处理

建议客户端至少处理以下:

  • 检查 HTTP 状态码,识别网络、认证或服务端异常。
  • 检查顶层 status_code,确认请求是否成功。
  • 检查每个任务的 status_code,单个任务失败被忽略。
  • 根据 status_message 记录错误原因和排障信息。
  • 通过 tasks_error 判断本次请求是否失败任务。

成功响应通常使用状态码 20000,完整状态码列表请参考错误码文档。

实用场景

  • 抓取财经探索页 HTML:获取指定地区和语言下的 Google Finance Explore 原始页面,用于构建财经搜索结果采集与归档系统。
  • 监测市场新闻变化:按 news_type 获取头条、本地市场或市场,及时发现财经新闻版位变化。
  • 分析金融展现:围绕股票、指数或行业采集页面 HTML,评估金融主题在搜索结果中的呈现。
  • 建立竞品财经监控:定期抓取不同地区的财经探索页面,比较竞争品牌、行业和市场的。
  • 支持 SEO 页面解析:保存原始 HTML 并进行二次解析,提取标题、链接、模块结构等信息,为金融 SEO 监控和报告生成提供数据。

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