商品类目预测
一、请求参数
1、基于商品图片进行类目预测,可以用于商品发布辅助 2、基于商品内容,包括商品类目、属性等,推荐出商品合理的类目,可用于类目信息错填判断。
请求URL:
POST https://kf.fw199.com/gateway/dd/product/get/recommend/category
公共参数
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| appid | String | 是 | 合作伙伴AppId | |
| timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
| seller_nick | String | 是 | 38173182 | 抖店的账号,对应蜂巢授权返回doudianseller字段 |
| sign | String | 是 |
业务参数
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| scene | String | 是 | product_info | 场景:category_infer: 基于标题、图片等推断商品类目;product_info: 表示基于商品内容进行类目错放判断,需要传入商品类目、属性等;smart_publish: 表示图片预测类目,需要传入商品主图; |
| pic | List | 否 | - | 商品主图图片url,scene为smart_publish时必传 |
| -url | String | 是 | https://p3-aio.ecombdimg.com/… | 图片链接,必须是素材中心的url |
| category_leaf_id | Int64 | 否 | 20415 | 商品类目id,scene为product_info时必传 |
| name | String | 否 | 商品标题 | 商品标题,scene为category_infer时必填; sense为product_info时选填 |
| product_format_new | Map | 否 | - | 商品类目属性 |
| - value | Int64 | 否 | 32314 | 属性id |
| - name | String | 否 | 衣长 | 属性名称 |
| standard_brand_id | Int64 | 否 | 30241 | 品牌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" }}四、响应参数
说明: code为0表示成功,非0为失败,message会包含失败原因。返回字段说明见文档 https://op.jinritemai.com/docs/api-docs/14/2004