跳转到内容
返回官网

商品关键词搜索接口

实现商品图搜,返回相关商品信息。 offerId经过加密处理后为openOfferId。对于搜索出来的商品,可以通过调用获取商品详情获取商品详情信息。

一、请求参数

请求URL:

POST https://kf.fw199.com/gateway/1688/product/keyword/offer/search

基础参数

参数名类型必须示例值说明
appidStringtrue32432143214214合作伙伴AppId
timestampStringtrue1633618722当前时间戳
seller_nickStringtrueb2b-16249611221688账号
signStringtrue999de41d862efaa6f1084ead3b3ba480如何计算生成见示例代码
request_dataJsontrue查询条件的业务报文

request业务参数

名称类型是否必须描述示例值
keywordsjava.lang.String关键词帐篷
categoryIdsjava.lang.String[]限定类目ID列表[“10166”]
quantityBeginjava.lang.Long起批量2
priceStartjava.lang.String价格区间过滤,起始价格10
priceEndjava.lang.String价格区间过滤,终止价格100
filterjava.lang.String[]过滤参数,shipIn48Hours(48小时发货),freeExchange7days(7天包换),powerMerchant(实力商家),crossPotential(跨境潜力商品),ttpft(批发团商品),jxhy(精选货源商品)[“jxhy”]
pageSizejava.lang.Long翻页大小20
pageNumjava.lang.Long当前页1

request_data的示例报文

{
"filter" : [ "shipIn48Hours" ],
"keywords" : "女士鞋子",
"pageSize" : 10,
"pageNum" : 1
}

二、请求示例代码

Java

@Test
public void AlibabaProductKeywordSearchRequest() throws Exception {
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("seller_nick", Config.AlibabaFenXiaoSellerNick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
JSONObject requestData = new JSONObject();
// JSONArray filters = new JSONArray();
// filters.add("jxhy");
// filters.add("shipIn48Hours");
// requestData.put("filter", filters);
requestData.put("keywords", "女士鞋子");
requestData.put("pageNum", 1);
requestData.put("pageSize", 1);
data.put("request_data", requestData.toJSONString());
data.put("sign", Utils.Sign(data, Config.AppSecret));
// 调用服务API
String response = doHttpRequest(Config.AlibabaProductKeywordSearchRequest, data);
}

三、返回结果

{
"code": 0,
"message": "ok",
"data": {
"result": {
"success": true,
"code": null,
"message": null,
"result": [
{
"openOfferId": "WUiP45gahkpKl8e4EpfN3g==",
"subject": "新款经典同款小白鞋女爆款百搭松糕厚底增高女鞋休闲新款透气板鞋",
"offerId": null,
"loginId": null,
"unit": null,
"quantityBegin": null,
"offerWeight": null,
"offerSuttleWeight": null,
"isJxhy": null,
"userId": null,
"companyInfo": {
"companyName": "瑞安******限公司",
"city": "温州市",
"province": "浙江",
"creditLevel": null,
"isFactory": null,
"shopRepurchaseRate": null,
"shopRepurchaseRateLevel": null,
"url": null
},
"offerImage": {
"imageUrl": "https://cbu01.alicdn.com/img/ibank/O1CN01C7rFB72CwSQwdOcEC_!!2209445208538-0-cib.jpg"
},
"offerPrice": {
"consignPrice": "19.00",
"priceUnderLine": "22.00",
"price": "22.00",
"quantityPrice": null
},
"offerTradeServiceInfo": [],
"offerHistoryTradeInfo": null,
"qualityEvaluation": {
"compositeScore": 3.5,
"consultationScore": 3,
"disputeScore": 4,
"logisticsScore": 3.5,
"goodsScore": 3,
"returnScore": 3.5
}
}
],
"pageInfo": {
"totalPage": 2001,
"currentPage": 1,
"pageSize": 1,
"totalRecords": 2000
}
}
},
"trace_id": ""
}

为空的情况

{
"code": 0,
"message": "ok",
"data": {
"result": {
"success": false,
"code": "SEARCH_ERROR",
"message": null,
"result": null,
"pageInfo": null
}
},
"trace_id": ""
}

说明: code为0表示成功,非0为失败,message会包含失败原因。业务上成功与否,见data中success值,返回字段说明见文档