主题
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_code | integer | 搜索引擎位置代码。如果未指定 location_name,则填写此参数。填写此参数后无需再填写 location_name。可通过位置列表接口 /v3/serp/google/locations 获取可用位置代码。示例:2840 |
language_code | string | 搜索引擎语言代码。如果未指定 language_name,则填写此参数。填写此参数后无需再填写 language_name。可通过语言列表接口 /v3/serp/google/languages 获取可用语言代码。示例:en |
device | string | 设备类型,可选值:desktop |
参数
| 参数 | 类型 | 说明 |
|---|---|---|
location_name | string | 搜索引擎位置的完整名称。如果未指定 location_code,则填写此参数。填写此参数后无需再填写 location_code。示例:London,England,United Kingdom |
language_name | string | 搜索引擎语言的完整名称。如果未指定 language_code,则填写此参数。填写此参数后无需再填写 language_code。示例:English |
os | string | 设备操作系统,可选值:windows |
tag | string | 用户自定义任务标识,可选。最大长度为 255 个字符,可用于请求与响应。提交的值会在响应的 data 对象中返回。 |
market_type | string | Google Finance 市场类型,可选。可选值:most-active、indexes、indexes/americas、indexes/europe-middle-east-africa、indexes/asia-pacific、gainers、losers、climate-leaders、cryptocurrencies、currencies。默认值: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 数组。响应状态码及错误信息请参考错误码文档。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 请求级状态码 |
status_message | string | 请求级提示信息 |
time | string | 请求执行耗时,单位为秒 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | tasks 数组中返回错误的任务数量 |
tasks | array | 任务结果数组 |
tasks 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,采用 UUID 格式 |
status_code | integer | 任务状态码,通常位于 10000 至 60000 范围 |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时,单位为秒 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量 |
path | array | 请求 URL 路径 |
data | object | 请求中提交的任务参数 |
result | array | 任务结果数组 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | POST 请求中的字段。返回时会对经过 URL 编码的进行解码,+ 会被解码为空格。 |
type | string | 请求中的搜索引擎类型 |
se_domain | string | 请求中的搜索引擎域名 |
location_code | integer | 搜索位置代码 |
language_code | string | 搜索语言代码 |
datetime | string | 接收结果的日期和时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。示例:2019-11-15 12:57:46 +00:00 |
items_count | integer | items 数组中的结果数量 |
items | array | SERP 中找到的结果 |
page | integer | 返回 HTML 页面的序号 |
date | string | HTML 页面扫描时间,格式为 年-月-日 时:分:秒 UTC 时差。示例:2019-11-15 12:57:46 +00:00 |
html | string | 页面原始 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_code为20000时,表示请求成功。 - 当
status_code为值时,应结合status_message判断原因。 - 建议客户端同时处理 HTTP 错误、请求级错误和任务级错误。
- 当
tasks_error大于0时,应逐项检查tasks数组中对应任务的状态。 - 实扣费金额应读取响应头
X-SeerMarTech-Charge-CNY,不要依据响应体中的cost字段进行结算。
实用场景
- 抓取不同国家和语言的市场页面,统一采集 Google Finance Markets,支持跨地区金融市场监测。
- 获取涨榜、跌榜和活跃市场数据,构建投资资讯或行业动态看板,缩短市场信息整理时间。
- 采集股票指数、加密货币和汇率页面 HTML,保留完整原始页面,便于后续解析、归档和审计。
- 按市场区域获取指数数据,对美洲、欧洲中东非洲及亚太市场进行区域化对比分析。
- 定时保存市场页面快,追踪搜索结果页面变化,为金融 SEO、资讯更新和竞品研究提供数据依据。