主题
serp/google/finance_markets/task_get/advanced:按 ID 获取 Google Finance 市场高级结果
本接口使用 GET 方法,通过任务 ID 获取 Google Finance「市场」页的高级结果:
GET https://api.seermartech.cn/v3/serp/google/finance_markets/task_get/advanced/$id
Google Finance Markets API 可返回市场指数、金融资产对、市场、市场趋势和等实时数据。结果取决于创建任务时指定的 keyword、location 和 language 参数 keyword 通常用于传股票或指数代码。
计费说明
- 创建任务时计费。
- 任务创建成功后,可在 30 天获取任务结果。
- 本接口本身不会重复扣费。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
路径参数:
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。任务创建后可在 30 天使用该 ID 获取结果。 |
请求示例
curl
bash
TASK_ID="02261816-2027-0066-0000-c27d02864073"
curl --location --request GET \
"https://api.seermartech.cn/v3/serp/google/finance_markets/task_get/advanced/${TASK_ID}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02231256-2604-0066-2000-57133b8fc54e"
url = (
"https://api.seermartech.cn/v3/serp/google/finance_markets/"
f"task_get/advanced/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
response.raise_for_status()
result = response.json()
print(result)TypeScript
typescript
import axios from "axios";
const taskId = "02231256-2604-0066-2000-57133b8fc54e";
axios
.get(
`https://api.seermartech.cn/v3/serp/google/finance_markets/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.response?.data || error.message);
});返回结构
接口返回 JSON 对象 tasks 数组。每个任务对象任务状态及对应的 SERP 结果。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
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 | SERP 结果数组。 |
data 字段
data含创建任务时使用的参数,示例:
json
{
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "finance_markets",
"language_name": "English",
"location_code": 2840,
"keyword": "NASDAQ-100",
"market_filter": "most-active",
"priority": 2,
"device": "desktop",
"os": "windows"
}result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 创建任务时提交的。返回时会进行 URL 解码,编码会被还原;加号 + 会被解码为空格。 |
type | string | 搜索结果类型。本接口固定为 finance_markets。 |
se_domain | string | 创建任务时指定的搜索引擎域名。 |
location_code | string | 地区代码。 |
language_code | string | 语言代码。 |
check_url | string | 对应搜索引擎结果页的直接 URL,可用于核验结果准确性。 |
datetime | string | 获取结果的时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
spell | object | 搜索引擎自动纠错信息。如果被自动修正,该字段会记录修正后的及纠错类型。 |
refinement_chips | object | 搜索细化选项。本接口通常为 null。 |
item_types | array | SERP 中出现的结果类型。 |
se_results_count | integer | SERP 中的结果总数。 |
items_count | integer | items 数组中的数量。 |
items | array | SERP 中返回的结果。 |
item_types 可能:
google_finance_hero_groupsgoogle_finance_explore_market_trendsgoogle_finance_newsgoogle_finance_interestedgoogle_finance_people_also_search
items 结果
google_finance_hero_groups
市场概览分组,不同金融市场中的指数、资产对和市场。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_hero_groups。 |
rank_group | integer | 同类型中的分组排名。不同类型不会影响该排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
markets | array | 金融市场数据数组。 |
markets 中每个:
| 字段 | 类型 | 说明 |
|---|---|---|
market | string | 市场标识。可能值:US、Europe、Asia、Currencies、Crypto、Futures。 |
items | array | 该市场下的金融资产或指数数据。 |
google_finance_explore_market_trends
市场趋势模块。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_explore_market_trends。 |
rank_group | integer | 同类型中的分组排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
title | string | 市场趋势模块标题,例如 Europe, Middle East, and Africa。 |
sub_title | string | 市场趋势模块副标题。 |
url | string | 市场趋势页面 URL,可能为 null。 |
items | array | 与该趋势模块的市场指数、资产对或市场。 |
google_finance_news
财经新闻模块。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_news。 |
rank_group | integer | 同类型中的分组排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
title | string | 新闻模块标题,例如 In the news。 |
sub_title | string | 新闻模块副标题。 |
items | array | 新闻文章数组。 |
新闻文章字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_news_element。 |
title | string | 新闻标题。 |
url | string | 新闻文章 URL。 |
source | string | 新闻来源网站名称。 |
image_url | string | 新闻主图 URL。 |
timestamp | string | 新闻时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
quotes | array | 新闻中提及的市场指数、市场或资产对。 |
google_finance_interested
根据近期搜索、的证券及活动生成的市场列表。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_interested。 |
rank_group | integer | 同类型中的分组排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
items | array | 市场指数、资产对或市场。 |
google_finance_people_also_search
用户还搜索的金融市场或资产。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 通常为 google_finance_people_also_search。 |
items | array | 市场指数、资产对或市场。 |
市场数据
markets.items、趋势模块的 items、列表的 items、的 quotes 可能以下三类。
google_finance_market_index_element
市场指数。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_market_index_element。 |
ticker | string | 市场指数代码,例如 DAX。 |
market_identifier | string | 市场标识,例如 INDEXDB。 |
index_value | float | 指定时间点的指数值。 |
index_value_delta | float | 指数值变化量。 |
identifier | string | 素完整标识,由 ticker 和 market_identifier 组成,例如 PX1:INDEXDB。 |
displayed_name | string | 页面展示的指数名称,例如 CAC 40。 |
url | string | 该指数在 Google Finance 中对应页面的 URL。 |
location | string | 指数所在地,例如 Europe/Paris。 |
trend | string | 指数趋势。可能值:up、down、stable。 |
timestamp | string | 指数值读取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
percentage_delta | float | 指数值百分比变化。 |
google_finance_asset_pair_element
资产对,例如货币对。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_asset_pair_element。 |
base_symbol | string | 基础资产代码,例如 EUR。 |
quote_symbol | string | 报价资产代码,例如 USD。 |
base_display_name | string | 基础资产名称,例如 Euro。 |
quote_display_name | string | 报价资产名称。 |
price | float | 基础资产相对于报价资产的价格。 |
price_delta | float | 价格变化量。 |
identifier | string | 资产对标识,例如 EUR-USD。 |
displayed_name | string | 页面展示名称,例如 EUR / USD。 |
url | string | 资产对对应页面的 URL。 |
location | string | 市场所在地。 |
trend | string | 价格趋势。可能值:up、down、stable。 |
timestamp | string | 价格读取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
percentage_delta | float | 价格百分比变化。 |
google_finance_market_instrument_element
市场,例如期货。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 google_finance_market_instrument_element。 |
ticker | string | 市场代码,例如 YMW00。 |
price | float | 指定时间点的市场价格。 |
price_delta | float | 价格变化量。 |
price_currency | string | 价格货币,例如 USD。 |
identifier | string | 市场完整标识,例如 YMW00:CBOT。 |
displayed_name | string | 页面展示名称,例如 E-mini Dow ($5)。 |
url | string | 市场对应页面的 URL。 |
location | string | 市场所在地。 |
trend | string | 价格趋势。可能值:up、down、stable。 |
timestamp | string | 价格读取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
percentage_delta | float | 价格百分比变化。 |
返回示例
以下为结构化示例,返回的 items 数量及字段会根据、地区、语言和市场筛选条件变化。
json
{
"version": "0.1.20241227",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1027 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02261816-2027-0066-0000-c27d02864073",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0871 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"serp",
"google",
"finance_markets",
"task_get",
"advanced"
],
"data": {
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "finance_markets",
"language_name": "English",
"location_code": 2840,
"keyword": "NASDAQ-100",
"market_filter": "most-active",
"priority": 2,
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "NASDAQ-100",
"type": "finance_markets",
"se_domain": "google.com",
"location_code": "2840",
"language_code": "en",
"check_url": "https://www.google.com/finance",
"datetime": "2025-02-07 08:10:00 +00:00",
"spell": null,
"refinement_chips": null,
"item_types": [
"google_finance_hero_groups",
"google_finance_explore_market_trends",
"google_finance_news",
"google_finance_interested",
"google_finance_people_also_search"
],
"se_results_count": 0,
"items_count": 4,
"items": [
{
"type": "google_finance_hero_groups",
"rank_group": 1,
"rank_absolute": 1,
"markets": [
{
"market": "US",
"items": [
{
"type": "google_finance_market_index_element",
"ticker": "DAX",
"market_identifier": "INDEXDB",
"index_value": 22100.5,
"index_value_delta": 125.4,
"identifier": "PX1:INDEXDB",
"displayed_name": "CAC 40",
"url": "https://www.google.com/finance",
"location": "Europe/Paris",
"trend": "up",
"timestamp": "2025-02-10 09:40:00 +00:00",
"percentage_delta": 0.57
}
]
}
]
},
{
"type": "google_finance_explore_market_trends",
"rank_group": 1,
"rank_absolute": 2,
"title": "Most active",
"sub_title": "The stocks or funds with the highest trading volume",
"url": null,
"items": []
},
{
"type": "google_finance_news",
"rank_group": 1,
"rank_absolute": 3,
"title": "In the news",
"sub_title": "Based on most active",
"items": [
{
"type": "google_finance_news_element",
"title": "示例财经新闻标题",
"url": "https://example.com/news/article",
"source": "示例新闻来源",
"image_url": "https://example.com/images/article.jpg",
"timestamp": "2025-02-07 08:10:00 +00:00",
"quotes": []
}
]
},
{
"type": "google_finance_interested",
"rank_group": 1,
"rank_absolute": 4,
"items": []
}
]
}
]
}
]
}错误处理
建议同时检查以下状态字段:
- 顶层
status_code:判断接口请求是否成功。 tasks[].status_code:判断任务是否成功。status_message和tasks[].status_message:获取错误或状态说明。tasks_error:判断是否存在失败任务。result:任务成功时通常结果数据;任务失败或尚未完成时可能为空。
常见成功状态码:
| 状态码 | 说明 |
|---|---|
20000 | 请求成功。 |
任务状态码可能处于 10000 至 60000 范围。生产环境中应根据状态码和状态说明实现重试、时、空结果及异常任务处理逻辑。
实用场景
- 监控股票指数和金融变化:定期获取市场指数、期货及资产对的价格和涨跌,为市场监控面板提供实时数据。
- 分析热门市场趋势:读取
google_finance_explore_market_trends模块,识别交易活跃度较高的股票或基金,财经选题和行业趋势研究。 - 聚合财经:提取
google_finance_news及quotes字段,将市场与,构建金融资讯聚合或舆分析页面。 - 追踪用户的金融资产:利用
google_finance_interested返回的资产列表,分析近期搜索和行为,优化金融产品推荐或分发。 - 扩展市场:利用
google_finance_people_also_search获取金融资产和指数,扩展 SEO主题、集合及专题页覆盖范围。