Skip to content

亚马逊 ASIN 实时 HTML

POST /v3/merchant/amazon/asin/live/html

接口说明

POST https://api.seermartech.cn/v3/merchant/amazon/asin/live/html

本接口根据指定的亚马逊商品 ASIN、地区和语言,实时获取商品页面的 HTML及数据。接口以 JSON 格式返回结果。

所有 POST 请求体使用 UTF-8 编码的 JSON 数组格式。每次 Live API 请求只能平台限流以认证说明中的 30/60/120 次/分钟规则为准。

接口在任务提交成功后计费,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数

请求体为 JSON 数组:

json
[
  {
    "asin": "B0756FCPPN",
    "location_name": "United States",
    "language_name": "English (United States)"
  }
]

任务参数

参数类型说明
asinstring亚马逊商品唯一标识符 ASIN。可通过 /v3/merchant/amazon/products/products/live/advanced/ 获取。
location_namestring条件填搜索引擎地区的完整名称。当未指定 location_codelocation_coordinate 时填。使用此参数后,无需再传另外两个地区参数。示例:HA1,England,United Kingdom
location_codeinteger条件填搜索引擎地区代码。当未指定 location_namelocation_coordinate 时填。使用此参数后,无需再传另外两个地区参数。可通过 /v3/merchant/amazon/locations 获取。示例:9045969
location_coordinatestring条件填地区 GPS 坐标,格式为 纬度,经度,半径。纬度和经度最多支持 7 位小数,半径最小值为 199.9。当未指定 location_namelocation_code 时填。示例:53.476225,-2.243572,200
language_namestring条件填搜索引擎语言的完整名称。当未指定 language_code 时填。使用此参数后,无需再传 language_code。可通过 /v3/merchant/amazon/languages 获取。示例:English (United Kingdom)
language_codestring条件填搜索引擎语言代码。当未指定 language_name 时填。使用此参数后,无需再传 language_name。可通过 /v3/merchant/amazon/languages 获取。示例:en_GB
se_domainstring搜索引擎域名。平台通常会根据地区和语言自动选择对应域名,也可以手动指定,例如 amazon.comamazon.co.ukamazon.fr
tagstring自定义任务标识,用于任务与结果,最长 255 个字符。提交的值会原样返回在响应任务的 data 对象中。

地区与语言参数规则

地区参数和语言参数均采用三选一的互斥方式:

  • 地区:location_namelocation_codelocation_coordinate 三任选一。
  • 语言:language_namelanguage_code 二任选一。

响应结构

接口返回 JSON 对象 tasks 数组。

顶层响应字段

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

任务字段

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

result 字段

字段类型说明
asinstring请求中提交的 ASIN。
typestring搜索引擎类型,固定值为 asin
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 数组中的结果数量。
itemsarrayHTML 页面及数据。

items 字段

字段类型说明
pageinteger返回 HTML 页面的序号。
datestringHTML 页面扫描时间,采用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00
htmlstring亚马逊商品页面 HTML。

请求示例

curl

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/merchant/amazon/asin/live/html" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "location_name": "United States",
      "language_name": "English (United States)",
      "asin": "B0756FCPPN"
    }
  ]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/merchant/amazon/asin/live/html"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

# 每次 Live API 请求只能提交一个任务
payload = [
    {
        "location_name": "United States",
        "language_name": "English (United States)",
        "asin": "B0756FCPPN",
    }
]

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/merchant/amazon/asin/live/html",
  [
    {
      location_name: "United States",
      language_name: "English (United States)",
      asin: "B0756FCPPN",
    },
  ],
  {
    headers: {
      Authorization: "Bearer smt_live_YOUR_KEY",
      "Content-Type": "application/json",
    },
  }
);

const result = response.data;

if (result.status_code === 20000) {
  console.log(result);
} else {
  console.error(
    `请求失败,状态码:${result.status_code},信息:${result.status_message}`
  );
}

响应示例

json
{
  "version": "0.1.20260520",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "15.1520 sec.",
  "cost": 0.036,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": " aba6a3e1-8f0e-4f67-a7a5-xxxxxxxxxxxx",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "14.8200 sec.",
      "cost": 0.036,
      "result_count": 1,
      "path": [
        "v3",
        "merchant",
        "amazon",
        "asin",
        "live",
        "html"
      ],
      "data": {
        "api": "merchant",
        "function": "asin",
        "se": "amazon",
        "language_code": "en_US",
        "location_code": 2840,
        "asin": "B0756FCPPN",
        "se_type": "asin",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "asin": "B0756FCPPN",
          "type": "asin",
          "se_domain": "amazon.com",
          "location_code": 2840,
          "language_code": "en_US",
          "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_codestatus_message 判断请求及任务是否成功:

  • 顶层 status_code:表示本次接口请求的总体状态。
  • 任务级 status_code:表示任务的处理状态。
  • tasks_error:用于快速判断是否存在失败任务。
  • status_message:提供状态或错误的补说明。

建议在业务系统中实现异常重试、失败任务记录和错误告警机制。

实用场景

  • 抓取指定 ASIN 的商品页面 HTML,解析标题、描述、价格、评分和库存等,支持商品信息监控与竞品分析。
  • 定期扫描重点商品页面,对比不同时间的 HTML,及时发现价格、促销、评论摘要或页面结构变化。
  • 按国家或亚马逊站点获取商品页面,分析同一 ASIN 在不同市场的展示差异,为跨境 SEO 和本地化运营提供依据。
  • 保存原始商品页面快,建立可追溯的数据样本,用于页面异常排查、合规检查和历史数据复盘。
  • 批量构建商品数据管道,将 HTML 解析结果接商品库或竞争报系统,提升亚马逊商品数据更新效率。

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