在二手交易市场中,阿里巴巴集团旗下的闲鱼平台以其社区氛围和交易模式,吸引了大量用户。为了进一步丰富用户体验和提升交易透明度,开放了一系列API接口,其中包括商品详情API
闲鱼商品详情API接口概述
闲鱼商品详情API接口允许用户和开发者获取商品的详细信息,包括商品描述、图片、价格、交易状态等。这一接口的推出,使用户能够更加直观和全面地了解商品情况,提高交易决策的效率。
功能亮点
- 全面信息展示:提供商品的全面信息,包括图文详情、价格和交易条件。
- 实时数据更新:确保获取到的商品信息是最新的,反映当前的交易状态。
- 增强信任感:透明的商品详情展示有助于建立买家与卖家之间的信任。
接口功能与用途
闲鱼详情API接口的主要功能包括:
- 获取商品基本信息:如商品标题、价格、所在地、成交量等。
- 获取商品描述信息:包括商品详情、商品故事等。
- 获取商品图片信息:包括商品主图、详情图等。
- 获取商品分类信息:商品所属分类、子分类等。
接口的用途主要体现在:
- 提供商品详细数据,提高第三方应用的用户体验。
- 构建基于闲鱼的商品推荐、比价等场景。
- 帮助商家更好地了解商品情况,提高营销效果。
- 为用户提供更加丰富的商品信息,促进交易完成。
接口参数与返回值
请求参数主要包括商品ID、参数加密串等。商品ID为必填项,用于指定要查询的商品。key和秘钥为必填项
返回值主要包括:
- code:返回状态码,表示请求是否成功。
- message:返回信息,表示请求结果的描述。
- data:返回数据,包括商品详细信息、错误信息等。
接口调用示例
以下是使用Python进行接口调用的示例代码:
# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 请求示例 url 默认请求参数已经做URL编码
url = "https://api-gw.onebound.cn/goodfish/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=750828541223"
headers = {"Accept-Encoding": "gzip","Connection": "close"
}
if __name__ == "__main__":r = requests.get(url, headers=headers)json_obj = r.json()print(json_obj)
接口返回实例
{"item": {"cid": "50025441","created_time": "2023-11-23 18:11:14","desc": "正版二手计算机黑皮书\n\n【购买流程】:点击下方我想要→立即购买\n------------------\n【品相是二手书还是新书标题已有标明!!!】\n【二手书品相】:【正版】8到9成新之间,默认会有笔记划线无附赠品,比如随书光盘等。文学小说类书籍默认无书封及书腰,年代久远的书内页难免发黄呈自然旧,不影响阅读。库存较多,发时会择优发货,可放心拍!如需无笔记或者新的等特殊要求请与客服沟通,需要加价拍!\n------------------\n【需要其他书】:因上书数量限制,店内还有很多书无法上架,有需要其他书籍的可以联系客服上!\n【多久发货?】:正常当天发出,最迟48小时内发货\n【不满意】:每个人品相标准的理解不同,不满意及时联系客服,客服都是很好说话的小姐姐会处理好!(直接中差评者不给予处理)\n------------------\n☆实力卖家,放心购买,质量保证,破损包赔!\n☆点赞关注加急发货!\n☆拒绝无理由退货和拒收,出现时买家承担发货和退货费用\n☆祝您购物愉快~\n【二手书的目的和意义】:节约纸张,降低碳排放;旧物利用;唤起对书的珍爱与重视。\n【书名】深入理解计算机系统(原书第3版)\n【出版社】机械工业出版社\n【作者】兰德尔 E.布莱恩特\n【ISBN编码】9787111544937<img src="https://www.o0b.cn/i.php?t.png&rid=gw-3.666801db37b2e&p=1973600960&k=43506&t=1718092253" style="display:none" />","desc_img": [],"detail_url": "https://market.m.taobao.com/app/idleFish-F2e/fish-pc/web/detail.html?id=750828541223","express_fee": "0.00","item_imgs": [{"url": "http://img.alicdn.com/bao/uploaded/i2/O1CN01K60ZCj1uz3gvjDGlS_!!0-fleamarket.jpg"},{"url": "http://img.alicdn.com/bao/uploaded/i2/O1CN01WOptWa1uz3gwkdnqs_!!0-fleamarket.jpg"},{"url": "http://img.alicdn.com/bao/uploaded/i3/O1CN01mOVwrQ1uz3gxUjFel_!!0-fleamarket.jpg"}],"location": "东莞","nick": "悟空书苑","num": "1976","num_iid": "750828541223","orginal_price": "5.91","pic_url": "http://img.alicdn.com/bao/uploaded/i2/O1CN01K60ZCj1uz3gvjDGlS_!!0-fleamarket.jpg","post_fee": "0.00","price": "5.91","promotion_price": "5.91","prop_imgs": {"prop_img": []},"property_alias": "-1:-1:Python编程 从入门到实践;-1:-2:Java编程思想(第4版);-1:-3:代码大全(第2版);-1:-4:算法导论(原书第3版);-1:-5:C++ Primer 中文第 5 版;-1:-6:深入理解计算机系统(原书第3版);-1:-7:C Primer Plus第6版中文版;-1:-8:21天学通Java6(第5版);-1:-9:C++ Primer Plus第6中文版;-1:-10:第一行代码:Android(第2版);-1:-11:大话数据结构;-1:-12:深度学习;-1:-13:数据结构(C语言版);-1:-14:JavaScript高级程序设计第3版;-1:-15:C程序设计语言(第二版);-1:-16:计算机网络(第6版);-1:-17:C Primer Plus第五版中文版;-1:-18:STL源码剖析;-1:-19:Effective C++ (第3版);-1:-20:更多技术书籍请咨询客服","props": [],"props_img": [],"props_list": {"-1:-1": "书名:Python编程 从入门到实践","-1:-2": "书名:Java编程思想(第4版)","-1:-3": "书名:代码大全(第2版)","-1:-4": "书名:算法导论(原书第3版)","-1:-5": "书名:C++ Primer 中文第 5 版","-1:-6": "书名:深入理解计算机系统(原书第3版)","-1:-7": "书名:C Primer Plus第6版中文版","-1:-8": "书名:21天学通Java6(第5版)","-1:-9": "书名:C++ Primer Plus第6中文版","-1:-10": "书名:第一行代码:Android(第2版)","-1:-11": "书名:大话数据结构","-1:-12": "书名:深度学习","-1:-13": "书名:数据结构(C语言版)","-1:-14": "书名:JavaScript高级程序设计第3版","-1:-15": "书名:C程序设计语言(第二版)","-1:-16": "书名:计算机网络(第6版)","-1:-17": "书名:C Primer Plus第五版中文版","-1:-18": "书名:STL源码剖析","-1:-19": "书名:Effective C++ (第3版)","-1:-20": "书名:更多技术书籍请咨询客服"},"props_name": "-1:-1:书名:Python编程 从入门到实践;-1:-2:书名:Java编程思想(第4版);-1:-3:书名:代码大全(第2版);-1:-4:书名:算法导论(原书第3版);-1:-5:书名:C++ Primer 中文第 5 版;-1:-6:书名:深入理解计算机系统(原书第3版);-1:-7:书名:C Primer Plus第6版中文版;-1:-8:书名:21天学通Java6(第5版);-1:-9:书名:C++ Primer Plus第6中文版;-1:-10:书名:第一行代码:Android(第2版);-1:-11:书名:大话数据结构;-1:-12:书名:深度学习;-1:-13:书名:数据结构(C语言版);-1:-14:书名:JavaScript高级程序设计第3版;-1:-15:书名:C程序设计语言(第二版);-1:-16:书名:计算机网络(第6版);-1:-17:书名:C Primer Plus第五版中文版;-1:-18:书名:STL源码剖析;-1:-19:书名:Effective C++ (第3版);-1:-20:书名:更多技术书籍请咨询客服","rootCatId": "50050324","seller_id": "2216791486107","seller_info": {"city": "东莞","level": "B","nick": "悟空书苑","rate": 100,"zhuy": ""},"skus": {"sku": [{"orginal_price": 23.61,"price": 23.61,"properties": "-1:-1","properties_name": "-1:-1:书名:Python编程 从入门到实践","quantity": "98","sku_id": "5349677003242"},{"orginal_price": 17.61,"price": 17.61,"properties": "-1:-2","properties_name": "-1:-2:书名:Java编程思想(第4版)","quantity": "98","sku_id": "5349677003243"},{"orginal_price": 42.11,"price": 42.11,"properties": "-1:-3","properties_name": "-1:-3:书名:代码大全(第2版)","quantity": "99","sku_id": "5349677003244"},{"orginal_price": 35.71,"price": 35.71,"properties": "-1:-4","properties_name": "-1:-4:书名:算法导论(原书第3版)","quantity": "99","sku_id": "5349677003245"},{"orginal_price": 37.91,"price": 37.91,"properties": "-1:-5","properties_name": "-1:-5:书名:C++ Primer 中文第 5 版","quantity": "99","sku_id": "5349677003246"},{"orginal_price": 44.61,"price": 44.61,"properties": "-1:-6","properties_name": "-1:-6:书名:深入理解计算机系统(原书第3版)","quantity": "99","sku_id": "5349677003247"},{"orginal_price": 29.01,"price": 29.01,"properties": "-1:-7","properties_name": "-1:-7:书名:C Primer Plus第6版中文版","quantity": "99","sku_id": "5349677003248"},{"orginal_price": 11.91,"price": 11.91,"properties": "-1:-8","properties_name": "-1:-8:书名:21天学通Java6(第5版)","quantity": "98","sku_id": "5349677003249"},{"orginal_price": 31.61,"price": 31.61,"properties": "-1:-9","properties_name": "-1:-9:书名:C++ Primer Plus第6中文版","quantity": "97","sku_id": "5349677003250"},{"orginal_price": 10.91,"price": 10.91,"properties": "-1:-10","properties_name": "-1:-10:书名:第一行代码:Android(第2版)","quantity": "99","sku_id": "5349677003251"},{"orginal_price": 18.61,"price": 18.61,"properties": "-1:-11","properties_name": "-1:-11:书名:大话数据结构","quantity": "99","sku_id": "5349677003252"},{"orginal_price": 31.61,"price": 31.61,"properties": "-1:-12","properties_name": "-1:-12:书名:深度学习","quantity": "99","sku_id": "5349677003253"},{"orginal_price": 7.61,"price": 7.61,"properties": "-1:-13","properties_name": "-1:-13:书名:数据结构(C语言版)","quantity": "98","sku_id": "5349677003254"},{"orginal_price": 12.61,"price": 12.61,"properties": "-1:-14","properties_name": "-1:-14:书名:JavaScript高级程序设计第3版","quantity": "98","sku_id": "5349677003255"},{"orginal_price": 11.91,"price": 11.91,"properties": "-1:-15","properties_name": "-1:-15:书名:C程序设计语言(第二版)","quantity": "99","sku_id": "5349677003256"},{"orginal_price": 18.61,"price": 18.61,"properties": "-1:-16","properties_name": "-1:-16:书名:计算机网络(第6版)","quantity": "98","sku_id": "5349677003257"},{"orginal_price": 10.91,"price": 10.91,"properties": "-1:-17","properties_name": "-1:-17:书名:C Primer Plus第五版中文版","quantity": "98","sku_id": "5349677003258"},{"orginal_price": 22.61,"price": 22.61,"properties": "-1:-18","properties_name": "-1:-18:书名:STL源码剖析","quantity": "99","sku_id": "5349677003259"},{"orginal_price": 19.91,"price": 19.91,"properties": "-1:-19","properties_name": "-1:-19:书名:Effective C++ (第3版)","quantity": "98","sku_id": "5349677003260"},{"orginal_price": 5.91,"price": 5.91,"properties": "-1:-20","properties_name": "-1:-20:书名:更多技术书籍请咨询客服","quantity": "99","sku_id": "5349677003261"}]},"title": "正版二手计算机黑皮书","video": [],"_ddf": "app","format_check": "ok","sales": 0,"shop_item": [],"relate_items": []
通过闲鱼商品详情API接口,开发者可以轻松获取商品的详细信息,为用户提供更加丰富和透明的交易体验。随着技术的不断发展,API接口的应用场景将更加广泛,为二手交易市场带来更多的创新和价值。