AsinSeed官方API文档-中文版
2023年2月3日 更新
开启更多功能,提升办公效能

创建日期:2018.10.17

更新日期:2019.06.12

版本号:V2.0.0


API请求域名:https://www.asinseed.com

API请求方式:HTTP GET

1. 请求地址

根据asin进行查询

{DOMAIN}/api/{marketplace}/{asin}/{partner}/{qid}

根据关键词进行查询

{DOMAIN}/api/{marketplace}/{partner}/{qid}?keyword={keyword}


注意:不同查询方式返回结果集不同,请注意区分

2. 请求参数

marketplace

亚马逊站点

US-美国站; CA-加拿大站; MX-墨西哥站; UK-英国站; DE-德国站; FR-法国站; IT-意大利站; ES-西班牙站; JP-日本站; IN-印度站;

asin

商品ASIN,变体的ASIN

keyword

关键词,查询相关的键词

partner

服务商编号,由AsinSeed官方统一分配给客户

qid

校验参数,生成规则见后文

3. 校验参数qid生成

根据查询方式,按 {marketplace}_{asin}_{secretKey}{marketplace}_{keyword}_{secretKey} 方式拼接,使用MD5加密成密文字符串,取[0,12)位作为校验参数qid的值。

secretKey是若干字符串,由AsinSeed官方提供,千万不要透露给第三方。

JAVA

/**
* 计算出用于API的QID值
* @param marketplace
* @param asin 如果是关键词则传入关键词即可
* 注意:如果qid不匹配,请检查转化的大小写
*/
public static String qid(String marketplace, String asin){
if (marketplace == null || StringUtils.isBlank(asin)) return "";

String encode = MD5Encoder.encode(marketplace + "_" + asin.toUpperCase() + "_" + "您自己的secretKey".toLowerCase());
return encode.substring(0, 12).toLowerCase();
}

4. 响应参数

asin 方式

{
code: 响应代码[OK:成功;ERR_GLOBAL_400:参数错误;ERR_GLOBAL_500:系统异常]
message: 异常信息[响应成功时,异常消息为空字符串("")]
data: 响应数据
{
asin: 查询商品ASIN
marketplace: 站点
keywords: 通过ASIN查询到的关键词
[
{
keyword: 关键词
search_volume: 关键词搜索量,为空时不返回
search_weight: 关键词热度
}
]
variations: 变体
[
{
asin: 变体ASIN
attribute: 变体属性(款式)
traffic_words_num: 变体流量词数
}
]
frequencies: 高频词
[
{
word: 高频词
frequency: 出现频词
}
]
product_information: 产品信息
{
marketplace: 站点
asin: asin
title: 标题
brand: 品牌
available_date: 上架日期
image: 商品图片(512)URL
}
}
}


关键词方式

{
code: 响应代码[OK:成功;ERR_GLOBAL_400:参数错误;ERR_GLOBAL_500:系统异常]
message: 异常信息[响应成功时,异常消息为空字符串("")]
data: 响应数据
{
marketplace: 站点
                keyword: 查询的关键词
keywords: 通过ASIN查询到的关键词
[
{
keyword: 关键词
search_volume: 关键词搜索量,为空时不返回
search_trend: 搜量趋势
[
{
month: 月份
searches: 对应月份的搜索量
}
]
purchase: 月购买量(在亚马逊站内搜索该关键词后产生购买的商品数量)
results: 结果数(指搜索该关键词后,出现了多少相关产品)
cvr: 购买率(购买率 = 购买量/搜索量)
}
]
frequencies: 高频词
[
{
word: 高频词
frequency: 出现频词
}
]
}
}

5. 响应示例

asin方式

{
"code": "OK",
"data": {
"marketplace": "US",
"asin": "B0031M9H30",
"keywords": [
{
"search_volume": 236358,
"keyword": "garbage can",
"search_weight": 94
},
{
"search_volume": 204233,
"keyword": "kitchen trash can",
"search_weight": 94
}
],
"variations": [
{
"asin": "B00JWQ5NF0",
"attribute": "13 Gal $71.99",
"traffic_words_num": 241
},
{
"asin": "B0031M9H30",
"attribute": "18 Gal from 16 sellers",
"traffic_words_num": 409
}
],
"frequencies": [
{
"word": "trash",
"frequency": 149
},
{
"word": "can",
"frequency": 126
}
],
"product_information": {
"image": "https://images-na.ssl-images-amazon.com/images/I/41cX73-LylL._SS200_.jpg",
"marketplace": "US",
"asin": "B0031M9H30",
"available_date": "20200908",
"title": "NINESTARS DZT-70-11R Automatic Touchless Infrared Motion Sensor Trash Can/Recycler, 18 Gal 70L, Stainless Steel Base (D Shape, Silver/Black Lid)",
"brand": "Ninestars"
}
},
"message": ""
}

注意:数组元素进行了截取,故这里只粘贴了返回结果集的一部分

关键词方式

{
"code": "OK",
"data": {
"keywords": [
{
"search_trend": [
{
"month": "201805",
"searches": 528295
},
{
"month": "201806",
"searches": 587863
},
{
"month": "201807",
"searches": 860380
},
{
"month": "201808",
"searches": 1038736
},
{
"month": "201809",
"searches": 1038132
},
{
"month": "201810",
"searches": 1181751
},
{
"month": "201811",
"searches": 1352626
},
{
"month": "201812",
"searches": 1453391
},
{
"month": "201901",
"searches": 820066
},
{
"month": "201902",
"searches": 680471
},
{
"month": "201903",
"searches": 790709
},
{
"month": "201904",
"searches": 680509
},
{
"month": "201905",
"searches": 689969
}
],
"purchase": 37189,
"search_volume": 689969,
"keyword": "flashlight",
"results": 100000,
"cvr": 0.0539
},
{
"search_trend": [
{
"month": "201805",
"searches": 247844
},
{
"month": "201806",
"searches": 276447
},
{
"month": "201807",
"searches": 278446
},
{
"month": "201808",
"searches": 375879
},
{
"month": "201809",
"searches": 400990
},
{
"month": "201810",
"searches": 406524
},
{
"month": "201811",
"searches": 418249
},
{
"month": "201812",
"searches": 402726
},
{
"month": "201901",
"searches": 256520
},
{
"month": "201902",
"searches": 217391
},
{
"month": "201903",
"searches": 234052
},
{
"month": "201904",
"searches": 172946
},
{
"month": "201905",
"searches": 171377
}
],
"purchase": 7643,
"search_volume": 171377,
"keyword": "led flashlight",
"results": 40000,
"cvr": 0.0446
}
],
"marketplace": "US",
"keyword": "flashlight",
"frequencies": [
{
"word": "flashlight",
"frequency": 615
},
{
"word": "led",
"frequency": 64
}
]
},
"message": ""
}

注意:数组元素进行了截取,故这里只粘贴了返回结果集的一部分,关键词趋势数据只支持最近

13个月的数据

6. 异常响应

ERR_GLOBAL_400 参数错误

异常信息:

  • [qid] can not be blank
  • [partner] code can not be blank
  • [qid] does not match
  • [asin] must start with 'B0'

7. 调用示例

CURL

##asin 方式
curl https://www.asinseed.com/api/US/B0031M9H30/test/d410411a494b
##关键词方式
curl https://www.asinseed.com/api/US/test/95aa8ce9e611?keyword=flashlight


JAVA

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.security.MessageDigest;

public class AsinSeedApiTest {
private static final char[] HEX_CHAR = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
private static final String PARTNER_CODE = "test";
private static final String PARTNER_SECRET_KEY = "7442a95a-b804-4929-af93-fb73e51f8d4a";

private static String byteArrayToHexString(byte[] byteArray) {
StringBuffer resultSb = new StringBuffer();
for (int i = 0; i < byteArray.length; i++) {
int n = byteArray[i];
n = n < 0 ? n + 256 : n;
resultSb.append(HEX_CHAR[n / 16]).append(HEX_CHAR[n % 16]);
}
return resultSb.toString();
}

private static String encode(String origin) {
String output = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
output = byteArrayToHexString(md.digest(origin.getBytes("UTF-8")));
} catch (Throwable e) {
e.printStackTrace();
}
return null != output ? output.substring(0, 12) : "";
}

public static void main(String[] args) {
String marketplace = "US";
String asin = "B017H39S5U";
String partner = PARTNER_CODE;
String qid = marketplace + "_" + asin + "_" + PARTNER_SECRET_KEY;
qid = encode(qid);
String urlStr = "https://www.asinseed.com/api/" + marketplace + "/" + asin + "/" + partner + "/" + qid;
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(urlStr);
try {
HttpResponse response = httpClient.execute(httpGet);
HttpEntity responseEntity = response.getEntity();
if (null != responseEntity) {
String responseJsonStr = EntityUtils.toString(responseEntity, "UTF-8");
JSONObject result = JSON.parseObject(responseJsonStr);
String code = result.getString("code");
if ("ok".equalsIgnoreCase(code)) {
JSONObject data = result.getJSONObject("data");
JSONArray keywords = data.getJSONArray("keywords");
//TODO your custom business logic
System.out.println(keywords.toJSONString());
} else {
String errMsg = result.get("message").toString();
//TODO handle the error msg from api
System.out.println("errorMs=>" + errMsg);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}