首先声明本人对于以下研究仅出于学习目的,不存在任何商业化行为。
通过京东app的api调用下单接口直接下单需要做一下两步:
- 签名:京东app的每一个接口都会带上
sign
参数,值是由body
,st
,sv
,client
,clientVersion
,uuid
等参数决定的,如果要获得京东sign签名需要研究so库。
POST https://api.m.jd.com/client.action?functionId=liveAuthorInfoV8510&clientVersion=8.5.12&build=73078&client=android&d_brand=Xiaomi&d_model=2014813&osVersion=5.1.1&screen=1280*720&partner=tencent&aid=c71b2af5f9ca20fc&oaid=&eid=eidAc03c8721cbs6PHTyK55HT5+qiww7vvlzIDx0853LGjeaRzu5dCDwMMU4u6wZIK1Xw3NJteWAa2Q/Fauh+5TWxQtDOYzH6mXtIg9d9JAtWqSOjERo&sdkVersion=22&lang=zh_CN&uuid=858734013255931-2982c1c99793&area=7_402_3645_55818&networkType=wifi&wifiBssid=a1fc402ba8d76f46acdb1dce735ddcc8&st=1589890491440&sign=6c9e34b06e6828e4adbecd59805f6466&sv=101 HTTP/1.1
Cookie: whwswswws=zJyadqAKa78wMXWbEPPSk5dwE4Jos2c0yeTcpviBp7Q8NpoCluTFLEF1J7BlKgTcscVhTlCBSKiPPDLsOvzP8xg==;unionwsws={"devicefinger":"eidAc01c8126cbs6PHTyK55HT5+qiww7vvlzIDx0853LGjeaRzu5dCDwMMU4u6wZIK1Xw3NJteWAa2Q\/Fauh+5TWxQtDOYzH6mXtIg9d9JAtWqSOjERo","jmafinger":"zJya8qAKa78wMXWbEPPSk5dwE4Jos1c0yeTcpviBp7Q8NpoCluTFLEF1J7BlKgTcscVhTlCBSKiPPDLs9vzP8xg=="};
Charset: UTF-8
Connection: Keep-Alive
jdc-backup: whwswswws=zJyadqAKa78wMXWbEPPSk5dwE4Jos2c0yeTcpviBp7Q8NpoCluTFLEF1J7BlKgTcscVhTlCBSKiPPDLsOvzP8xg==;unionwsws={"devicefinger":"eidAc01c8126cbs6PHTyK55HT5+qiww7vvlzIDx0853LGjeaRzu5dCDwMMU4u6wZIK1Xw3NJteWAa2Q\/Fauh+5TWxQtDOYzH6mXtIg9d9JAtWqSOjERo","jmafinger":"zJya8qAKa78wMXWbEPPSk5dwE4Jos1c0yeTcpviBp7Q8NpoCluTFLEF1J7BlKgTcscVhTlCBSKiPPDLs9vzP8xg=="};
Accept-Encoding: gzip,deflate
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 93
Host: api.m.jd.com
User-Agent: okhttp/3.12.1body=%7B%22authorId%22%3A%22591810%22%2C%22liveId%22%3A%221193445%22%2C%22position%22%3A0%7D&
-
需要抓包京东APP下单,获取下订单请求,注意在下订单请求之前还有几个接口需要调用,下面贴下单接口的示例截图
-
分析抢购商品
有的商品是不加购物车直接预约购买的,如茅台,AJ,手机等等,这时候就要先调用商品预约接口,接口参数
-
调整时间
我们的服务器和京东服务器时间肯定是有延迟的,所以这里需要给一个提前下单时间。 -
养号
京东秒杀抢购类都是有概率的,所以这里最好是多个账号一起抢,提高成功率。
上面是我对于京东app秒杀的学习研究。这里就不放源码了,感兴趣的朋友可以加我QQ2049466382共同探讨学习。