为了进行电商平台 的API开发,首先我们需要做下面几件事情。
1)开发者注册一个账号
2)然后为每个JD应用注册一个应用程序键(App Key) 。
3)下载JDAPI的SDK并掌握基本的API基础知识和调用
4)利用SDK接口和对象,传入AppKey或者必要的时候获取并传入SessionKey来进行程序开发。
5)利用JD平台的文档中心和API测试工具,对接口进行测试。从而了解返回信息,方便程序获取。
以上是一般JD API应用开发的关键流程,其中通过JD文档中心和API测试工具,进行概念了解和接口信息查询很重要。因为这些数据就是我们需要在逐步显示出来的。JD的API很多,不过都分为了好几个领域,慢慢就会了解深入了。
API示例:
{
"items": {
"url": "https://search.jd.com/Search?keyword=女装&spm=a.0.0&pvid=3b375194749e448e9dd6fea48db417dd&page=1",
"keyword": "女装",
"page": 1,
"real_total_results": "622691",
"total_results": "622691",
"pagecount": 100,
"products_total": "",
"list_count": "",
"page_size": 30,
"item": [
{
"num_iid": "10083603372966",
"detail_url": "https://item.jd.com/10083603372966.html",
"title": "旅途原品(ltyp)德国杨子2/60美丽诺羊毛无缝一体针织衫打底衫女秋冬 松石绿-德国杨子纱 M",
"pic_url": "//img11.360buyimg.com/n7/jfs/t1/184443/17/36928/18211/64df1c5fF19326d05/22736ad75bb1ce85.jpg",
"price": "439.00",
"promotion_price": "439.00",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "旅途原品服饰旗舰店"
},
{
"num_iid": "100034001730",
"detail_url": "https://item.jd.com/100034001730.html",
"title": "京东京造5A抑菌抗发黄T恤女40支新疆棉t恤女夏短袖百搭T黑色 L",
"pic_url": "//img10.360buyimg.com/n7/jfs/t1/107104/19/38217/84164/64917c2bF66c5665d/9e0d5e1b5a05985b.jpg",
"price": "39.90",
"promotion_price": "39.90",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "京东京造自营官方旗舰店"
},
{
"num_iid": "10057525668348",
"detail_url": "https://item.jd.com/10057525668348.html",
"title": "王熙麦纯棉白色短袖t恤女学生休闲风宽松正肩夏季新款女装ins圆领上衣 白色【四只可爱】 M 建议105-120斤",
"pic_url": "//img13.360buyimg.com/n7/jfs/t1/103098/10/33101/92971/632aad2bE534da86b/adc3c1c670436f4c.jpg",
"price": "19.80",
"promotion_price": "19.80",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "王熙麦旗舰店"
},
{
"num_iid": "10052272731071",
"detail_url": "https://item.jd.com/10052272731071.html",
"title": "爱心东东\t\n卡吉蘭娜(Kajilanna)新款连衣裙2023夏季女装收腰显瘦纱裙法式温柔风气质套装裙子夏天 杏色上衣+咖色裙子 M 建议体重99-108斤",
"pic_url": "//img11.360buyimg.com/n7/jfs/t1/87775/22/42010/46982/64a91d29F5e70cd50/01259f1789e681ef.jpg",
"price": "89.00",
"promotion_price": "89.00",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "卡吉蘭娜旗舰店"
},
{
"num_iid": "10068834571089",
"detail_url": "https://item.jd.com/10068834571089.html",
"title": "妍莉芬(yanlifen)连衣裙女装2023年秋季新款韩版气质套装中长款吊带裙法式裙子秋装 白色上衣+吊带裙 M(建议95-110斤)",
"pic_url": "//img14.360buyimg.com/n7/jfs/t1/160163/14/34646/86392/63ea4e4bF181f9de6/45353c2b88071af9.jpg",
"price": "168.00",
"promotion_price": "168.00",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "妍莉芬服饰旗舰店"
},
{
"num_iid": "100062187817",
"detail_url": "https://item.jd.com/100062187817.html",
"title": "莫代尔短袖T恤宽松针织气质百搭圆领中袖打底内搭冰丝上衣女均码",
"pic_url": "//img12.360buyimg.com/n7/jfs/t1/170717/38/37540/112880/64a25877F7e8f231f/4555dc9e5d4ae231.jpg",
"price": "75.00",
"promotion_price": "75.00",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "莫代尔京东自营旗舰店"
},
{
"num_iid": "10083593755809",
"detail_url": "https://item.jd.com/10083593755809.html",
"title": "旅途原品(ltyp)100%羊毛極简立体竖条纹堆堆领针织衫打底衫女秋冬 巴黎灰-100%绵羊毛 L",
"pic_url": "//img14.360buyimg.com/n7/jfs/t1/177161/39/36342/61580/64df0667F692080d5/01e07075850fbf7e.jpg",
"price": "399.00",
"promotion_price": "399.00",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "旅途原品服饰旗舰店"
},
{
"num_iid": "10069412888085",
"detail_url": "https://item.jd.com/10069412888085.html",
"title": "索菲堡 100%新疆棉2023夏季短袖t恤女宽松百搭设计感小众洋气ins上衣潮 白色(粉图) M",
"pic_url": "//img10.360buyimg.com/n7/jfs/t1/96150/26/35115/161065/63f602d8F3ed3b0d7/c3b2656d3dcc55c1.jpg",
"price": "38.00",
"promotion_price": "38.00",
"sales": 0,
"sample_id": "",
"post_fee": "",
"seller": "索菲堡服饰旗舰店"
},
注:本帖只展示部分代码,响应参数,注册账号可免费测试或者加v联系"