主题
Amazon 卖家实时 HTML 数据
POST /v3/merchant/amazon/sellers/live/html
接口说明
本接口通过 POST 请求调用:
POST https://api.seermartech.cn/v3/merchant/amazon/sellers/live/html
接口返回指定 Amazon 商品卖家页面的 HTML 数据。
> 注意:调用本接口前,获取商品的 asin。可通过 /v3/merchant/amazon/products/live/advanced/ 接口查询。
每次 Live API 请求只能提交一个任务;平台限流以认证说明中的 30/60/120 次/分钟规则为准。
计费说明
提交任务时计费,无需额外调用结果获取接口。
- 参考价约 ¥0.0360 / 次
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准
所有 POST 请求体使用 UTF-8 编码的 JSON 数组格式。
请求参数
请求体格式:
json
[
{
"asin": "B0756FCPPN",
"location_name": "United States",
"language_name": "English (United States)"
}
]| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
asin | string | 是 | Amazon 商品唯一标识符。可通过 /v3/merchant/amazon/products/live/advanced/ 获取。由于 ASIN 由 Amazon 动态分,因此不存在固定的完整取值列表。示例:B085RFFC9Q |
location_name | string | 条件填 | 地理位置完整名称。当未指定 location_code 或 location_coordinate 时填。指定此参数后,无需再传另外两个位置参数。可通过 /v3/merchant/amazon/locations 获取可用位置及名称。示例:London,England,United Kingdom |
location_code | integer | 条件填 | 地理位置代码。当未指定 location_name 或 location_coordinate 时填。指定此参数后,无需再传另外两个位置参数。可通过 /v3/merchant/amazon/locations 获取。示例:2840 |
location_coordinate | string | 条件填 | 地理位置 GPS 坐标,格式为 纬度,经度,半径。纬度和经度最多支持 7 位小数,半径最小值为 199.9。当未指定 location_name 或 location_code 时填。示例:53.476225,-2.243572,200 |
language_name | string | 条件填 | 语言完整名称。当未指定 language_code 时填。指定此参数后,无需再传 language_code。可通过 /v3/merchant/amazon/languages 获取可用语言。示例:English (United States) |
language_code | string | 条件填 | 语言代码。当未指定 language_name 时填。指定此参数后,无需再传 language_name。可通过 /v3/merchant/amazon/languages 获取。示例:en_US |
se_domain | string | 否 | Amazon 搜索引擎域名。本平台会根据位置和语言自动选择域名,也可以手动指定,例如:amazon.co.uk、amazon.com.au、amazon.de。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。可用于识别任务并将任务与结果。提交的值会在响应 data 对象中返回。 |
位置参数互斥
以下三个参数至少指定一个,且只能使用一个:
location_namelocation_codelocation_coordinate
语言参数也至少指定一个,且只能使用一个:
language_namelanguage_code
响应结构
接口返回 JSON 数据 tasks 任务数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。成功通常为 20000。 |
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 | 与 POST 请求中提交的任务参数对应的数据。 |
result | array | 任务结果数组。 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
asin | string | 请求中提交的 ASIN。 |
type | string | 请求中的搜索引擎类型。 |
se_domain | string | 请求使用的 Amazon 搜索引擎域名。 |
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 | Amazon 搜索结果数组。 |
page | integer | 返回 HTML 页面的序号。 |
date | string | HTML 页面抓取时间,使用 UTC 格式 yyyy-mm-dd hh-mm-ss +00:00。示例:2019-11-15 12:57:46 +00:00 |
html | string | 返回的 HTML 页面。 |
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/merchant/amazon/sellers/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"
}
]'PHP
php
<?php
$apiUrl = 'https://api.seermartech.cn';
$apiKey = 'smt_live_YOUR_KEY';
$postData = [
[
'location_name' => 'United States',
'language_name' => 'English (United States)',
'asin' => 'B0756FCPPN'
]
];
$ch = curl_init($apiUrl . '/v3/merchant/amazon/sellers/live/html');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($postData, JSON_UNESCAPED_UNICODE)
]);
$response = curl_exec($ch);
if ($response === false) {
echo '请求失败:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);TypeScript
typescript
import axios from "axios";
axios({
method: "post",
url: "https://api.seermartech.cn/v3/merchant/amazon/sellers/live/html",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
data: [
{
location_name: "United States",
language_name: "English (United States)",
asin: "B0756FCPPN",
},
],
})
.then((response) => {
// 处理响应数据
console.log(response.data);
})
.catch((error) => {
console.error("请求失败:", error.response?.data || error.message);
});Python
python
import requests
url = "https://api.seermartech.cn/v3/merchant/amazon/sellers/live/html"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
post_data = [
{
"location_name": "United States",
"language_name": "English (United States)",
"asin": "B0756FCPPN",
}
]
response = requests.post(url, headers=headers, json=post_data)
result = response.json()
if result.get("status_code") == 20000:
# 处理成功结果
print(result)
else:
print(
"请求失败,状态码:%s,信息:%s"
% (result.get("status_code"), result.get("status_message"))
)C#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class AmazonSellersExample
{
public static async Task Main()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");
var postData = new[]
{
new
{
location_name = "United States",
language_name = "English (United States)",
asin = "B0756FCPPN"
}
};
var json = JsonSerializer.Serialize(postData);
using var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
var response = await httpClient.PostAsync(
"https://api.seermartech.cn/v3/merchant/amazon/sellers/live/html",
content
);
var result = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
// 处理成功结果
Console.WriteLine(result);
}
else
{
Console.WriteLine($"请求失败:{result}");
}
}
}响应示例
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": "00000000-0000-0000-0000-000000000000",
"status_code": 20000,
"status_message": "Ok.",
"time": "15.1520 sec.",
"cost": 0.036,
"result_count": 1,
"path": [
"v3",
"merchant",
"amazon",
"sellers",
"live",
"html"
],
"data": {
"api": "merchant",
"function": "sellers",
"se": "amazon",
"language_code": "en_US",
"location_code": 2840,
"asin": "B0756FCPPN",
"se_type": "sellers",
"device": "desktop",
"os": "windows"
},
"result": [
{
"asin": "B0756FCPPN",
"type": "sellers",
"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_code - 任务级
tasks[].status_code - 对应的
status_message
当状态码不为 20000 时,应记录错误信息并根据业务需要进行重试或告警。完整状态码列表请参考错误码文档。
实用场景
- 采集商品卖家页面 HTML:获取指定 ASIN 在不同国家和语言环境下的卖家页面,用于构建竞品卖家监测系统。
- 对比区域化卖家信息:切换
location_code或se_domain抓取不同站点页面,分析区域市场中的卖家数量与展示差异。 - 保存页面快进行审计:定期保存
html字段,追踪卖家页面结构、价格展示和商品销售状态的变化。 - 解析卖家竞争格局:结合
items中的页面结果,统计同一商品的卖家分布,为选品和定价策略提供依据。 - 建立商品监控任务体系:使用
tag商品、客户或项目,便于批量任务管理、结果归档和异常追踪。