跳转到内容
返回官网

商品类目预测

一、请求参数

1、基于商品图片进行类目预测,可以用于商品发布辅助 2、基于商品内容,包括商品类目、属性等,推荐出商品合理的类目,可用于类目信息错填判断。

请求URL:

POST https://kf.fw199.com/gateway/dd/product/get/recommend/category

公共参数

参数名称参数类型是否必须示例值参数描述
appidString合作伙伴AppId
timestampString1657525936当前Unix时间戳,秒
seller_nickString38173182抖店的账号,对应蜂巢授权返回doudianseller字段
signString

业务参数

参数名称参数类型是否必须示例值参数描述
sceneStringproduct_info场景:category_infer: 基于标题、图片等推断商品类目;product_info: 表示基于商品内容进行类目错放判断,需要传入商品类目、属性等;smart_publish: 表示图片预测类目,需要传入商品主图;
picList-商品主图图片url,scene为smart_publish时必传
-urlStringhttps://p3-aio.ecombdimg.com/图片链接,必须是素材中心的url
category_leaf_idInt6420415商品类目id,scene为product_info时必传
nameString商品标题商品标题,scene为category_infer时必填; sense为product_info时选填
product_format_newMap-商品类目属性
- valueInt6432314属性id
- nameString衣长属性名称
standard_brand_idInt6430241品牌id

二、请求示例代码

Java

请求示例代码

public void DDProductGetRecommendCategory() throws Exception {
Map<String, Object> data = new HashMap<String, Object>();
data.put("appid", Config.AppId);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("seller_nick", Config.DDSellerNick);
data.put("scene", "category_infer");
data.put("name", "女生秋冬加绒加厚保暖针织彬");
data.put("pic", "[\n" +
" {\n" +
" \"url\": \"https://p3-aio.ecombdimg.com/obj/ecom-shop-material/v1_GhxlaZ_70852585116381186630419_c55b8401b00e96e4114431a1dbd7c99c_sx_582346_www1000-1000\"" +
" }\n" +
" ]");
data.put("sign", Sign(data,Config.AppSecret));
// 调用服务API
String resp = doHttpRequest(Config.DDProductGetRecommendCategory, data);
System.out.println(resp);
}

三、返回结果

{
"code": 0,
"message": "ok",
"data": {
"categoryDetails": [
{
"category_detail": {
"first_cid": 20005,
"first_cname": "女装",
"fourth_cid": 0,
"fourth_cname": "",
"second_cid": 20247,
"second_cname": "毛针织衫",
"third_cid": 0,
"third_cname": ""
},
"qualification_status": 0
},
{
"category_detail": {
"first_cid": 20005,
"first_cname": "女装",
"fourth_cid": 0,
"fourth_cname": "",
"second_cid": 40541,
"second_cname": "女装(鉴真)",
"third_cid": 0,
"third_cname": ""
},
"qualification_status": 2
},
{
"category_detail": {
"first_cid": 20005,
"first_cname": "女装",
"fourth_cid": 0,
"fourth_cname": "",
"second_cid": 20245,
"second_cname": "大码女装",
"third_cid": 38671,
"third_cname": "大码毛针织衫"
},
"qualification_status": 2
}
],
"recommend_id": "2025103016192772A792CE8484F37781F3_ab0f57e35eb749a"
}
}

四、响应参数

m_f366b4cf272e93a5b388e86203342601_r_4167915

说明: code为0表示成功,非0为失败,message会包含失败原因。返回字段说明见文档 https://op.jinritemai.com/docs/api-docs/14/2004