Skip to content

获取 Google Shopping 卖家结果(按任务 ID)

GET /v3/merchant/google/sellers/tasks_ready

本接口使用 GET 方法,请求路径为:

/v3/merchant/google/sellers/task_get/advanced/$id

根据任务 ID 获取 Google Shopping 卖家结果。任务提交成功后,可在 30 天重复获取结果,获取任务结果不额外收费。费用在提交任务时产生,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数

请求路径中的 $id 为任务唯一标识符。

参数类型说明
idstring任务唯一标识符,UUID 格式。任务提交后 30 天可使用该 ID 获取结果。

请求示例

cURL

bash
id="04171157-0696-0183-0000-4f63affdd40a"

curl --location --request GET \
  "https://api.seermartech.cn/v3/merchant/google/sellers/task_get/advanced/${id}" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json"

TypeScript

typescript
import axios from "axios";

const taskId = "02231453-2604-0066-2000-64d39c6677d4";

axios
  .get(
    `https://api.seermartech.cn/v3/merchant/google/sellers/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);
  });

Python

python
import requests

task_id = "04171157-0696-0183-0000-4f63affdd40a"

url = (
    "https://api.seermartech.cn"
    f"/v3/merchant/google/sellers/task_get/advanced/{task_id}"
)

response = requests.get(
    url,
    headers={
        "Authorization": "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
    },
)

if response.ok:
    result = response.json()
    print(result)
else:
    print(f"请求失败:HTTP {response.status_code}")
    print(response.text)

响应说明

接口返回 JSON 数据,顶层 tasks 数组。每个任务对象任务状态、请求参数和 Google Shopping 卖家结果。

顶层响应字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger通用响应状态码。通常 20000 表示成功。
status_messagestring通用状态说明。
timestring接口执行耗时,例如 0.0713 sec.
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

任务字段

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

data 字段

data 中通常会返回提交任务时使用的主要参数,例如:

字段类型说明
se_typestringGoogle Shopping 结果类型,例如 shops_list
sestring搜索引擎类型,例如 google
apistringAPI 类型,例如 merchant
functionstring功能名称,例如 sellers
language_codestring搜索语言代码。
location_codeinteger搜索地域代码。
product_idstringGoogle Shopping 商品 ID。
devicestring设备类型,例如 desktop
osstring操作系统类型,例如 windows

result 字段

结果基础字段

字段类型说明
product_idstring提交任务时使用的商品 ID。
typestring搜索引擎结果类型。
se_domainstring提交任务时使用的搜索引擎域名。
location_codeinteger提交任务时使用的地域代码。
language_codestring提交任务时使用的语言代码。
check_urlstringGoogle Shopping 结果页的直接 URL,可用于核验结果准确性。
datetimestring获取结果的时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。例如:2019-11-15 12:57:46 +00:00
titlestring商品标题。
urlstring商品页 URL。
image_urlstring商品图片 URL。
ratingobject商品评分信息。
item_typesarray结果页中的结果类型。可能 shops_listbuy_on_google
items_countintegeritems 数组中的结果数量。
itemsarray结果页中的商品或卖家结果。

rating 商品评分字段

字段类型说明
typestring评分类型,固定为 rating_element
positionstring评分在结果页中的位置,可选值:leftright
rating_typestring评分类型,可选值:Max5PercentsCustomMax
valueinteger评分值。
votes_countinteger评价数量。
rating_maxinteger当前评分类型对应的最大值。

items 数组

items 数组中的根据 type 不同分为以下两类:

  • shops_list:卖家列表结果。
  • buy_on_google:站购买结果。

通用排名字段

字段类型说明
typestring结果类型。
rank_groupinteger同类型结果中的组排名。不同类型之间不会连续计算该字段。
rank_absoluteinteger在整个 Google Shopping 结果页中的绝对排名。
positionstring素在结果页中的位置,可选值:leftright
xpathstring素在结果页中的 XPath。
domainstring结果中的域名。
titlestring商品标题。
urlstring跳转至卖家商品页的 Shopping URL。
detailsstring商品及特殊优惠;无时为 null
base_priceinteger不含税费和运费的商品价格。
taxinteger税费金额,不是百分比。
shipping_priceinteger运费。
total_priceinteger含税费和运费的商品总价。
currencystringISO 4217 货币代码,例如 USD
seller_namestring卖家名称。
ratingobject卖家评分信息。
product_conditionstring商品成色。可能值:UsedRefurbishedNewPre-ownednull
product_availabilitystring商品库存状态。
shop_ad_aclkstring广告点击跳转参数。可用于通过卖家广告 URL 接口获取广告落地页 URL。
product_annotationstring商品标注或优惠徽章,例如 LOW PRICESPECIAL OFFERSALEPRICE DROP;无标注时为 null

shops_list 专有字段

typeshops_list 时,除通用字段外,还可能:

字段类型说明
price_multiplierinteger月付价格覆盖的月数。
displayed_payment_breakdownstring结果页展示的分期付款说明。
shop_ad_aclkstring卖家广告点击参数。

buy_on_google 专有字段

typebuy_on_google 时,字段结构与 shops_list 基本一致,但以下字段通常特定表现:

字段类型说明
typestring固定为 buy_on_google
shop_ad_aclkstring该类型结果通常为 null
product_conditionstring商品成色,可能值:UsedRefurbishedNewnull
product_availabilitystring商品库存状态。

商品库存状态

product_availability 可能返回以下值:

说明
in_stock有库存
limited_stock库存有限
out_of_stock无库存
backordered缺货补
pre_order_available支持预订
on_display_to_order可展示并下单

卖家评分字段

items[].rating 用于表示卖家店铺评分,字段如下:

字段类型说明
typestring评分类型,固定为 rating_element
rating_typestring评分类型,可选值:Max5PercentsCustomMax
valueinteger评分值。
votes_countinteger评价数量。
rating_maxinteger评分最大值。
positionstring评分在结果页中的位置,可选值:leftright

响应示例

json
{
  "version": "0.1.20240313",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0713 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "04171157-0696-0183-0000-4f63affdd40a",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0581 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "merchant",
        "google",
        "sellers",
        "task_get",
        "advanced"
      ],
      "data": {
        "se_type": "shops_list",
        "se": "google",
        "api": "merchant",
        "function": "sellers",
        "language_code": "en",
        "location_code": 2840,
        "product_id": "1113158713975221117",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "product_id": "1113158713975221117",
          "type": "shops_list",
          "se_domain": "google.com",
          "location_code": 2840,
          "language_code": "en",
          "check_url": "https://www.google.com/shopping",
          "datetime": "2024-04-08 12:57:46 +00:00",
          "title": "Apple iPhone 8 Plus - 64 GB - Gold - T-Mobile - GSM",
          "url": "https://www.example.com/product/iphone-8-plus",
          "image_url": "https://www.example.com/images/iphone-8-plus.jpg",
          "rating": null,
          "item_types": [
            "shops_list"
          ],
          "items_count": 1,
          "items": [
            {
              "type": "shops_list",
              "rank_group": 1,
              "rank_absolute": 1,
              "position": "right",
              "xpath": "/html/body/div/div/div/div/div/table/tbody/tr",
              "domain": "www.example.com",
              "title": "Apple iPhone 8 Plus - 64 GB - Gold - T-Mobile - GSM",
              "url": "https://www.example.com/product/iphone-8-plus",
              "details": "Free delivery",
              "base_price": 129,
              "tax": 13.22,
              "shipping_price": 1.99,
              "total_price": 144.21,
              "currency": "USD",
              "price_multiplier": null,
              "displayed_payment_breakdown": null,
              "seller_name": "Example Seller",
              "rating": {
                "type": "rating_element",
                "position": "left",
                "rating_type": "Max5",
                "value": 4.6,
                "votes_count": 13600,
                "rating_max": 5
              },
              "shop_ad_aclk": null,
              "product_condition": "Refurbished",
              "product_annotation": null,
              "product_availability": "in_stock"
            }
          ]
        }
      ]
    }
  ]
}

错误处理

请同时检查顶层响应和任务对象中的状态字段:

  • 顶层 status_code:判断本次 API 请求是否成功。
  • tasks[].status_code:判断任务是否成功。
  • status_message:获取错误或状态说明。
  • tasks_error:统计返回错误的任务数量。
  • tasks[].result 为空或任务状态码表示错误时,不应继续读取结果字段。

获取已完成任务

在批量任务场景中,可以调用以下接口获取已完成任务列表,再根据返回的任务 ID 获取详细结果:

GET /v3/merchant/google/sellers/tasks_ready

随后逐个调用:

GET /v3/merchant/google/sellers/task_get/advanced/$id

建议在任务状态码达到成功状态后再读取 result,并为时、任务不存在、任务失败和结果为空等设计重试及异常处理机制。

沙盒测试

可使用本平台提供的沙盒接口查看该端点支持的完整字段结构。沙盒响应中的字段值为模拟数据,不会产生费用。沙盒请求路径为:

/v3/merchant/google/sellers/task_get/advanced/00000000-0000-0000-0000-000000000000

实用场景

  • 监控商品卖家排名:按商品 ID 定期获取 Google Shopping 卖家列表,比较不同卖家的排名变化,评估商品在购物结果中的表现。
  • 对比竞品价格:汇总 base_pricetaxshipping_pricetotal_price,识别竞品的真实到手价,为定价策略和促销活动提供依据。
  • 分析卖家库存状态:根据 product_availability 统计有货、低库存和缺货卖家,判断市场供给和补货优级。
  • 评估卖家口碑:结合 ratingvotes_count 分析卖家评分及评价规模,筛选高信誉渠道并支持渠道合作决策。
  • 识别商品促销信息:读取 detailsproduct_annotation 中的优惠、降价及信息,追踪竞品促销策略和价格变化。

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