失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 调用API接口 获取和解析 京东按关键字搜索商品数据

调用API接口 获取和解析 京东按关键字搜索商品数据

时间:2019-01-17 02:34:38

相关推荐

调用API接口 获取和解析 京东按关键字搜索商品数据

这篇文章主要介绍了如何调用API接口 获取和解析京东按关键字搜索商品数据,帮助大家更好的理解和使用API接口。

点击测试

请求示例

<?php// 请求示例 url 默认请求参数已经URL编码处理// 本示例代码未加密secret参数明文传输,若要加密请参考:/taobao/demo/sdk/demo-sign.php$method = "GET";$url = "https://api-/jd/item_search/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&seller_info=no&nick=&seller_info=&nick=&ppath=&imgid=&filter=";$curl = curl_init();curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);curl_setopt($curl, CURLOPT_FAILONERROR, false);curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);curl_setopt($curl, CURLOPT_HEADER, true);curl_setopt($curl, CURLOPT_ENCODING, "gzip");var_dump(curl_exec($curl));?>

响应示例

{

"items": {

"keyword": "游戏",

"page": 1,

"real_total_results": 2200,

"total_results": 2200,

"pagecount": 100,

"page_size": 20,

"data_from": "app",

"item": [

{

"num_iid": "100029518272",

"detail_url": "/100029518272.html",

"title": "索尼(SONY)PS5 PlayStation5",

"pic_url": "/mobilecms/jfs/t1/158996/3/29164/178023/62dd72bcEd41481b6/0053ade98896bd06.jpg",

"price": "3899.00",

"promotion_price": "3899.00",

"sales": 0,

"seller_id": "1000004319",

"seller": "PlayStation京东自营官方旗舰店"

},

{

"num_iid": "100021269358",

"detail_url": "/100021269358.html",

"title": "任天堂 Nintendo Switch 国行续航增强版 NS家用体感游戏机掌机 便携掌上游戏机 红蓝主机",

"pic_url": "/mobilecms/jfs/t1/132878/26/26992/185549/625678c0Ea05b8fd9/9afc374fb122470d.jpg",

"price": "2099.00",

"promotion_price": "2099.00",

"sales": 0,

"seller_id": "1000300901",

"seller": "Nintendo Switch官方旗舰店京东自营"

},

{

"num_iid": "8314939",

"detail_url": "/8314939.html",

"title": "任天堂(Nintendo) Switch NS掌上游戏机 OLED主机 日版彩色 续航加强版 便携家用体感掌机",

"pic_url": "/mobilecms/jfs/t1/4898/11/17886/77480/62adfcc1E0be9627d/98ac0becaa3163c9.jpg",

"price": "2398.00",

"promotion_price": "2398.00",

"sales": 0,

"seller_id": "1000017121",

"seller": "数码海外京东自营专区"

},

{

"num_iid": "67036047844",

"detail_url": "/67036047844.html",

"title": "活石掌上游戏机SUP掌机PSP街机电视怀旧复古红白机迷你双人超级玛丽俄罗斯方块成人女男六一儿童节礼物 尊享双人版500款游戏【升级芯片】+3米电视AV线",

"pic_url": "/mobilecms/jfs/t1/118893/6/24797/184379/6242d68dE7432b791/8fa9d0c38ec4e9c2.jpg",

"price": "59.00",

"promotion_price": "59.00",

"sales": 0,

"seller_id": "79429",

"seller": "童乐玩具专营店"

},

{

"num_iid": "8314939",

"detail_url": "/8314939.html",

"title": "任天堂(Nintendo) Switch NS掌上游戏机 OLED主机 日版白色 续航加强版 便携家用体感掌机",

"pic_url": "/mobilecms/jfs/t1/149163/33/28393/78576/62adfd16E5fa10e9e/eb0fe90cf7b80420.jpg",

"price": "2359.00",

"promotion_price": "2359.00",

"sales": 0,

"seller_id": "1000017121",

"seller": "数码海外京东自营专区"

},

{

"num_iid": "100020844550",

"detail_url": "/100020844550.html",

"title": "Pico Neo3 6+256G先锋版【赢16款VR应用】 VR眼镜VR一体机 骁龙XR2 瞳距调节 PCVR",

"pic_url": "/mobilecms/jfs/t1/55886/33/17168/412688/62da560bEf13ea5f4/2146ceb4cef86250.jpg",

"price": "2199.00",

"promotion_price": "2199.00",

"sales": 0,

"seller_id": "1000040084",

"seller": "Pico京东自营旗舰店"

},

{

"num_iid": "67036047844",

"detail_url": "/67036047844.html",

"title": "活石掌上游戏机SUP掌机PSP街机电视怀旧复古红白机迷你双人超级玛丽俄罗斯方块成人女男六一儿童节礼物 尊享双人版800款游戏【升级芯片】+3米电视AV线",

"pic_url": "/mobilecms/jfs/t1/191055/29/21988/184584/6242d74bEfeb0d6d2/794823ffde9c603c.jpg",

"price": "79.00",

"promotion_price": "79.00",

"sales": 0,

"seller_id": "79429",

"seller": "童乐玩具专营店"

},

{

"num_iid": "1079906302",

"detail_url": "/1079906302.html",

"title": "简朵 i5 10400F升八核/GTX1650 4G/16G内存游戏台式吃鸡电脑主机DIY组装机",

"pic_url": "/mobilecms/jfs/t1/77080/15/21415/612892/62d937f0Effeda3bf/9a824ef44bab38fa.jpg",

"price": "2029.00",

"promotion_price": "2029.00",

"sales": 0,

"seller_id": "56190",

"seller": "硕扬DIY电脑旗舰店"

},

{

"num_iid": "100020914344",

"detail_url": "/100020914344.html",

"title": "任天堂 Nintendo Switch 国行续航增强版红蓝主机 & 健身环大冒险游戏套装",

"pic_url": "/mobilecms/jfs/t1/141233/8/26953/281962/61f0b3fbE94fe7982/7450cee088aa2d5e.jpg",

"price": "2598.00",

"promotion_price": "2598.00",

"sales": 0,

"seller_id": "1000300901",

"seller": "Nintendo Switch官方旗舰店京东自营"

},

{

"num_iid": "100017901795",

"detail_url": "/100017901795.html",

"title": "OnexPlayer 1S壹号游戏掌机WIN10掌上游戏机8.4英寸第十一代酷睿i7笔记本电脑平板二合一i7-1195G7 16GB+1TB",

"pic_url": "/mobilecms/jfs/t1/190174/10/19668/192387/61289875E7947761c/1906bb2a91b9701d.jpg",

"price": "6999.00",

"promotion_price": "6999.00",

"sales": 0,

"seller_id": "1000375567",

"seller": "OneXPlayer京东自营旗舰店"

},

{

"num_iid": "100020430750",

"detail_url": "/100020430750.html",

"title": "小霸王跳舞毯体感游戏机家用双人瑜伽毯",

"pic_url": "/mobilecms/jfs/t1/161912/30/27117/209220/61b5f61bE5aca5a6e/2c6d90f0eb02d4fa.jpg",

"price": "558.00",

"promotion_price": "558.00",

"sales": 0,

"seller_id": "1000115127",

"seller": "小霸王自营旗舰店"

},

{

"num_iid": "100020430750",

"detail_url": "/100020430750.html",

"title": "小霸王 D106游戏机97格斗经典街机摇杆世嘉FC红白机怀旧电视游戏机",

"pic_url": "/mobilecms/jfs/t1/169140/38/21808/126865/6180d641Ec4fed568/744265169336bb23.jpg",

"price": "438.00",

"promotion_price": "438.00",

"sales": 0,

"seller_id": "1000115127",

"seller": "小霸王自营旗舰店"

},

{

"num_iid": "100029518270",

"detail_url": "/100029518270.html",

"title": "索尼(SONY)PS5 PlayStation®5 数字版 ",

"pic_url": "/mobilecms/jfs/t1/145469/37/28724/174677/62d104c2Ea51ca556/77ceb2a6e764c31c.jpg",

"price": "3099.00",

"promotion_price": "3099.00",

"sales": 0,

"seller_id": "1000004319",

"seller": "PlayStation京东自营官方旗舰店"

},

{

"num_iid": "12851117",

"detail_url": "/12851117.html",

"title": "游戏设计艺术(第3版)?[The Art of Game Design](博文视点出品)",

"pic_url": "/mobilecms/jfs/t1/192681/17/1782/251308/609568a6Ef1b42f66/08016f8d2b1b32ce.jpg",

"price": "203.40",

"promotion_price": "203.40",

"sales": 0,

"seller_id": "1000004142",

"seller": "电子工业出版社"

},

{

"num_iid": "10048465931298",

"detail_url": "/10048465931298.html",

"title": "【国内保税】任天堂(Nintendo)Switch NS掌上游戏机续航加强版 红蓝主机 港版",

"pic_url": "/mobilecms/jfs/t1/85154/22/29565/100759/62de09d8Eb914083d/dd192d62563f358d.jpg",

"price": "1699.00",

"promotion_price": "1699.00",

"sales": 0,

"seller_id": "11888058",

"seller": "京东国际精选旗舰店"

},

{

"num_iid": "100039993758",

"detail_url": "/100039993758.html",

"title": "联想笔记本电脑 拯救者R9000P 16英寸高性能电竞游戏本(标压 8核 R7-5800H 16G 512G RTX3060 2.5k屏 165Hz)",

"pic_url": "/mobilecms/jfs/t1/194249/4/25856/83034/62a869d8E0844bcca/71ca40ee3bfd347f.jpg",

"price": "8399.00",

"promotion_price": "8399.00",

"sales": 0,

"seller_id": "1000000157",

"seller": "联想京东自营旗舰店"

},

{

"num_iid": "10053292555586",

"detail_url": "/10053292555586.html",

"title": "【国内保税仓】任天堂(Nintendo)Switch NS掌上游戏机 便携家用OLED/续航加强版 日版OLED白色64GB(保税仓1-3天送达)",

"pic_url": "/mobilecms/jfs/t1/117157/37/27636/74101/62de2d4cEac6fa5d0/6b230d0e6eb82e2a.jpg",

"price": "2139.00",

"promotion_price": "2139.00",

"sales": 0,

"seller_id": "11888058",

"seller": "京东国际精选旗舰店"

},

{

"num_iid": "12390889",

"detail_url": "/12390889.html",

"title": "游戏设计:深层设计思想与技巧",

"pic_url": "/mobilecms/jfs/t23899/207/1433857894/308942/60286ea7/5b5fb42bNf9ae4c2e.jpg",

"price": "60.00",

"promotion_price": "60.00",

"sales": 0,

"seller_id": "1000004142",

"seller": "电子工业出版社"

},

{

"num_iid": "10024527874323",

"detail_url": "/10024527874323.html",

"title": "索尼(SONY) PlayStation5 PS5 游戏主机 日版游戏机 体感游戏机 支持8K 新款 PS5 日版光驱版【CFI-1000|1100】",

"pic_url": "/mobilecms/jfs/t1/106990/10/27454/24472/6246fa1cE6aa98a52/da61556c0e4c.jpg",

"price": "4299.00",

"promotion_price": "4299.00",

"sales": 0,

"seller_id": "181097",

"seller": "楽天海外官方旗舰店"

},

{

"num_iid": "100018322085",

"detail_url": "/100018322085.html",

"title": "ROG幻16 第12代英特尔酷睿16英寸设计师高性能游戏笔记本电脑(i7-12700H 16G 512G RTX3060 2.5K165Hz)",

"pic_url": "/mobilecms/jfs/t1/41819/2/18830/332529/6296fb04Ead0c0e32/80ef21a3b00b1344.jpg",

"price": "9999.00",

"promotion_price": "9999.00",

"sales": 0,

"seller_id": "1000107961",

"seller": "玩家国度ROG京东自营官方旗舰店"

}

]

},

"error_code": "0000",

"reason": "ok",

"secache": "d368088f10c68d048932288ddc9e690d",

"secache_time": 1658729619,

"secache_date": "-07-25 14:13:39",

"translate_status": "",

"translate_time": 0,

"language": {

"default_lang": "cn",

"current_lang": "cn"

},

"error": "",

"cache": 0,

"api_info": "today:80 max:10100 all[109=80+10+19];expires:2030-12-31",

"execution_time": "5.321",

"server_time": "Beijing/-07-25 14:13:39",

"client_ip": "106.6.38.104",

"call_args": {

"q": "游戏",

"start_price": "0",

"end_price": "0",

"page": "1",

"cat": "0"

},

"api_type": "jd",

"translate_language": "zh-CN",

"translate_engine": "google_new",

"server_memory": "1.03MB",

"request_id": "gw-4.62de348e60326",

"last_id": "1100767132"

}

如果觉得《调用API接口 获取和解析 京东按关键字搜索商品数据》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。