Skip to content

按任务 ID 获取 Google Shopping 商品高级结果

GET /v3/merchant/google/products/tasks_ready

本接口使用 GET 方法,通过任务 ID 获取 Google Shopping 商品高级结果。

请求方法与路径:

text
GET https://api.seermartech.cn/v3/merchant/google/products/task_get/advanced/$id

计费说明

提交任务时会产生费用。任务结果可在提交后的 30 天重复获取,获取结果本身不额外收费。

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

请求参数

参数通过 URL 路径传递。

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

请求示例

curl

bash
curl --location --request GET \
  "https://api.seermartech.cn/v3/merchant/google/products/task_get/advanced/04171054-0696-0179-0000-e56ea58342c5" \
  --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/products/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 = "04171054-0696-0179-0000-e56ea58342c5"
url = (
    "https://api.seermartech.cn/v3/merchant/google/products/"
    f"task_get/advanced/{task_id}"
)

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

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

响应结构

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段

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

tasks素字段

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

data 通常以下任务参数:

字段类型说明
se_typestring搜索类型,例如 shopping
sestring搜索引擎,例如 google
apistringAPI 模块,例如 merchant
functionstring功能名称,例如 products
keywordstring查询。
language_codestring语言代码。
location_codeinteger地理位置代码。
price_minstring商品最低价格筛选条件。
price_maxstring商品最高价格筛选条件,如请求时提供。
devicestring设备类型,例如 desktopmobile
osstring操作系统,例如 windowsandroid

result 字段

字段类型说明
keywordstringPOST 请求中的。返回时会对 URL 编码进行解码,+ 会被解码为空格。
typestring请求中的搜索类型。
se_domainstring请求中的搜索引擎域名。
location_codeinteger请求中的地理位置代码。
language_codestring请求中的语言代码。
check_urlstringGoogle Shopping 结果页的直接 URL,可用于核验结果准确性。
datetimestring结果获取时间,UTC 格式,例如 2019-11-15 12:57:46 +00:00
spellobject搜索引擎自动纠错信息。
item_typesarray当前 Shopping 搜索结果中的结果类型。
items_countintegeritems 数组中的数量。
itemsarray搜索结果数组。

spell

当搜索引擎对查询进行了纠正时返回。

字段类型说明
keywordstring自动纠正后的,结果将基于该提供。
typestring自动纠错类型。可选值:did_you_meanshowing_results_forno_results_found_forincluding_results_for

item_types

可能以下值:

  • google_shopping_sponsored_carousel
  • google_shopping_paid
  • google_shopping_serp
  • google_shopping_carousel
  • related_searches

搜索结果通用字段

以下字段可能出现在 items 中:

字段类型说明
typestring结果类型。
rank_groupinteger同类型中的组排名。不同类型之间不会连续计算该排名。
rank_absoluteinteger在整个 Google Shopping 搜索结果中的绝对排名。
positionstring素在搜索结果中的位置,可为 leftright
xpathstring素在页面中的 XPath。
titlestring素或商品标题。
itemsarray素中的附加商品或;没有时为 null

商品字段

商品主要出现在以下类型中:

  • google_shopping_sponsored_carousel_element
  • google_shopping_carousel_element
  • google_shopping_serp
字段类型说明
titlestring商品标题。
tagsarray商品标签。
sellerstring销售该商品的商家名称。
pricefloat商品价格,例如 384.99
old_pricefloat商品原价;商品发生降价时返回。
price_multiplierinteger分期付款对应的月数。
currencystringISO 4217 货币代码,例如 USD
descriptionstring商品描述。
urlstring商家网站上的商品 URL。该字段已弃用,通常返回 null
shopping_urlstringGoogle Shopping 商品页 URL。
product_idstringGoogle Shopping 商品唯一标识。该值由 Google 动态分,无固定完整枚举;无值时返回 null
data_docidstring搜索结果的唯一标识,由 Google 动态分。
gidstringGoogle Shopping局商品标识。无值时返回 null
sellerstring商品对应的销售商名称。
product_imagesarray商品图片 URL 数组,第一个 URL 为主图。
shop_ad_aclkstring广告点击引用参数。可用于调用 /v3/merchant/google/sellers/ad_url/ 获取广告 URL。
reviews_countintegerGoogle Shopping 用户评论数量,无值时返回 null
is_best_matchboolean是否带有“最佳匹”标签,无值时返回 null
additional_specificationsobject商品附加参数,可用于调用 Google Shopping 商品规格或商家接口获取更多信息。

additional_specifications 可用于以下接口:

text
POST /v3/merchant/google/products/task_post/
POST /v3/merchant/google/sellers/task_post/

product_rating 商品评分

字段类型说明
typestring评分类型,通常为 rating_element
positionstring评分位置,可为 leftright
rating_typestring评分类型:Max5PercentsCustomMax
valuestring评分值。
votes_countinteger评分或评论数量。
rating_maxinteger当前评分类型的最大值。

shop_rating 商家评分

shop_rating 的字段结构与 product_rating 基本一致,用于表示商家基于用户评价计算的评分。

字段类型说明
typestring评分类型,通常为 rating_element
rating_typestring评分类型:Max5PercentsCustomMax
valuestring评分值。
votes_countinteger用户评价数量。
rating_maxinteger当前评分类型的最大值。
positionstring评分位置,可为 leftright

##送信息

delivery_info

字段类型说明
delivery_messagestring商家展示的说明,例如“”。
delivery_priceobject根据请求中指定的地理位置计算的费用。时为 null

delivery_price

字段类型说明
currentfloat当前价格。
regularfloat未折扣的常规价格。
max_valuefloat未折扣价格的最大值。
currencystringISO 4217 货币代码。
is_price_rangeboolean是否为价格区间。
displayed_pricestringGoogle Shopping 页面展示的价格文本。

特殊优惠信息

special_offer_info

字段类型说明
titlestring特殊优惠标题。
sub_titlestring特殊优惠副标题。
fixed_discountinteger固定金额折扣。
fixed_discount_currencystring固定金额折扣的货币。
percentage_discountinteger折扣百分比。
coupon_codestring优惠券代码。
coupon_infostring优惠券说明。
urlstring特殊优惠页面 URL。该字段已弃用,通常返回 null
domainstring特殊优惠页面域名。该字段已弃用,通常返回 null

各类结果

表示 Google Shopping 赞助商品轮播模块。该对象通常:

  • type
  • rank_group
  • rank_absolute
  • position
  • xpath
  • title
  • items

items 中的类型为 google_shopping_sponsored_carousel_element,商品字段:

  • xpath
  • title
  • tags
  • seller
  • price
  • currency
  • product_rating
  • product_images
  • shop_ad_aclk
  • delivery_info
  • special_offer_info

表示 Google Shopping 商品轮播模块。该对象:

  • type
  • rank_group
  • rank_absolute
  • position
  • xpath
  • title
  • items

items 中的类型为 google_shopping_carousel_element,除通用商品字段外,还可能:

  • shopping_url
  • product_id
  • data_docid
  • gid
  • delivery_info
  • special_offer_info

google_shopping_serp

表示 Google Shopping 常规商品结果。除通用排名字段外,还可能:

  • domain
  • title
  • description
  • url
  • shopping_url
  • tags
  • price
  • price_multiplier
  • old_price
  • currency
  • product_id
  • data_docid
  • seller
  • additional_specifications
  • reviews_count
  • is_best_match
  • product_rating
  • shop_rating
  • product_images
  • shop_ad_aclk
  • delivery_info
  • stores_count_info
  • gid

google_shopping_paid

表示付费商品或广告结果。

字段类型说明
typestring固定为 google_shopping_paid
rank_groupinteger同类型中的组排名。
rank_absoluteinteger在整个搜索结果中的绝对排名。
positionstring结果位置,可为 leftright
xpathstring页面 XPath。
domainstring搜索结果中的域名。
titlestring商品或广告标题。
descriptionstring商品或广告描述。
urlstring商家网站 URL。该字段已弃用,通常返回 null
shop_ad_aclkstring广告点击引用参数,可用于获取广告 URL。

表示搜索词模块。

字段类型说明
typestring固定为 related_searches
rank_groupinteger同类型中的组排名。
rank_absoluteinteger在整个搜索结果中的绝对排名。
positionstring结果位置,可为 leftright
xpathstring页面 XPath。
itemsarray列表;无结果时为 null

商家数量信息

stores_count_info

用于描述提供同一商品的商家数量。

字段类型说明
countstring提供该商品的商家数量。
displayed_textstringGoogle Shopping 页面展示的原始文本。
count_from_textboolean数量是否从展示文本中提取。若页面 HTML 中存在准确数量,则为 false;否则从 displayed_text 中提取时为 true

响应示例

json
{
  "version": "0.1.20210617",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.1346 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "04171054-0696-0179-0000-e56ea58342c5",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.1200 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "merchant",
        "google",
        "products",
        "task_get",
        "advanced"
      ],
      "data": {
        "se_type": "shopping",
        "se": "google",
        "api": "merchant",
        "function": "products",
        "language_code": "en",
        "location_code": 2840,
        "keyword": "buy iphone",
        "price_min": "5",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "keyword": "buy iphone",
          "type": "shopping",
          "se_domain": "google.com",
          "location_code": 2840,
          "language_code": "en",
          "check_url": "https://www.google.com/search?tbm=shop&q=buy+iphone",
          "datetime": "2019-11-15 12:57:46 +00:00",
          "spell": null,
          "item_types": [
            "google_shopping_serp",
            "google_shopping_carousel",
            "related_searches"
          ],
          "items_count": 160,
          "items": [
            {
              "type": "google_shopping_serp",
              "rank_group": 1,
              "rank_absolute": 3,
              "position": "left",
              "xpath": "/html/body/div/div/div",
              "domain": null,
              "title": "Apple iPhone 12 - 128 GB - Black - Unlocked",
              "description": "5G to download movies on the fly and stream high-quality video.",
              "url": null,
              "shopping_url": null,
              "tags": [],
              "price": 1099.99,
              "price_multiplier": null,
              "old_price": null,
              "currency": "USD",
              "product_id": "3805205938126402128",
              "data_docid": "9874368152810998595",
              "seller": "Back Market",
              "additional_specifications": null,
              "reviews_count": 9134,
              "is_best_match": false,
              "product_rating": {
                "type": "rating_element",
                "position": "left",
                "rating_type": "Max5",
                "value": "4.53",
                "votes_count": 9134,
                "rating_max": null
              },
              "shop_rating": null,
              "product_images": [],
              "shop_ad_aclk": "DChcSEwikz5aloKHxAhX8R5EFHc8oBzsYABA",
              "delivery_info": {
                "delivery_message": "$124.88 delivery",
                "delivery_price": {
                  "current": 124.88,
                  "regular": null,
                  "max_value": null,
                  "currency": "USD",
                  "is_price_range": false,
                  "displayed_price": "$124.88"
                }
              },
              "stores_count_info": {
                "count": "5",
                "displayed_text": "Compare prices from 5+ stores",
                "count_from_text": false
              },
              "gid": "9961958114952839788"
            },
            {
              "type": "related_searches",
              "rank_group": 223,
              "rank_absolute": 82,
              "position": "right",
              "xpath": "XPath1f2a2c1c-d234-4fb5-ac16-06f7c241b07c",
              "items": [
                "buy iphone online",
                "iphone deals"
              ]
            }
          ]
        }
      ]
    }
  ]
}

状态码与异常处理

请根据以下字段判断请求和任务是否成功:

  • 顶层 status_code
  • tasks[].status_code
  • status_message
  • tasks_error
  • result

建议在客户端中处理以下:

  1. HTTP 请求失败。
  2. 顶层 status_code20000
  3. 单个任务的 status_code 表示错误。
  4. result 为空或为 null
  5. 部分任务成功、部分任务失败。

任务结果获取流程

如需批量获取已完成任务,可调用:

text
GET /v3/merchant/google/products/tasks_ready

随后根据返回的任务结果地址,或直接拼接任务 ID 调用:

text
GET /v3/merchant/google/products/task_get/advanced/$id

测试接口:

text
https://sandbox.seermartech.cn/v3/merchant/google/products/task_get/advanced/00000000-0000-0000-0000-000000000000

测试环境会返回虚拟数据的完整字段结构,不产生费用。

实用场景

  • 监控商品搜索排名:定期获取商品在 Google Shopping 中的绝对排名和组排名,评估商品与竞争表现。
  • 比较竞品价格与商家数量:分析 priceold_pricesellerstores_count_info,识别价格差异和市场供给。
  • 跟踪促销与优惠券:提取 special_offer_info、折扣比例和优惠券代码,监测竞品促销策略并优化自身活动。
  • 评估商品口碑:结合 product_ratingshop_ratingreviews_count,筛选高评分商品或分析竞品用户反馈。
  • 分析竞争力:比较 delivery_infodelivery_price,评估不同商家的成本、策略及地域竞争优势。

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