9

豆瓣开发者不完全指南

 1 year ago
source link: https://feizhaojun.com/?p=3813
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

本文仅用于学习研究之目的,请勿用于其他用途。

豆瓣网关闭了图书、电影等相关的 API 接口。不过我们换一个思路,这些 API
豆瓣自己依然需要用,那我们便可以通过 Fiddler、Charles 等工具抓取豆瓣一些应用正在使用的接口。

豆瓣评分 微信小程序

通过微信小程序“豆瓣评分”的接口分析,我们可以得到:

豆瓣Api Host:https://frodo.douban.com

可用的 apiKey:0ac44ae016490db2204ce0a042db2916

其他可用apiKey:

054022eaeae0b00e0fc068c0c0a2102a

另外,豆瓣小程序的接口还对请求的 header 做的一些验证,我们需要在 header 里面携带:

"Referer": "https://servicewechat.com/wx2f9b06c1de1ccfca/91/page-frame.html"
"User-Agent": "MicroMessenger/"

于是我们就可以通过 Postman 等工具发起请求,获得接口信息。

完整的 cURL 示例:

curl --location --request GET 'https://frodo.douban.com/api/v2/book/rank_list?apiKey=0ac44ae016490db2204ce0a042db2916' \
--header 'User-Agent: MicroMessenger/' \
--header 'Referer: https://servicewechat.com/wx2f9b06c1de1ccfca/91/page-frame.html' \
--data-raw ''

豆瓣 App

另外,对豆瓣 App 抓包发现,api.douban.com 这个 Host 依旧也在使用,并且只验证了 apiKey(POST请求)。

可用 apiKey:

0ab215a8b1977939201640fa14c66bab

cURL 示例:

curl --location --request POST 'https://api.douban.com/v2/movie/imdb/tt6718170' \
--data-urlencode 'apikey=0ab215a8b1977939201640fa14c66bab'

接口文档可以参照:

您的赞助将会支持作者创作及本站运维

wxpay-qrcode.png

alipay-qrcode.png


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK