获取微信公众号的所有历史文章接口

搜狗的话已经不行了

获取微信公众号的所有历史文章

搜索接口

Request Method: GET
https://mp.weixin.qq.com/cgi-bin/searchbiz?action=search_biz&begin=0&count=数量默认5&query=微信号&token=tk值&lang=zh_CN&f=json&ajax=1

:authority: mp.weixin.qq.com
:method: GET
:path: /cgi-bin/searchbiz?action=search_biz&begin=0&count=数量默认5&query=微信号&token=tk值&lang=zh_CN&f=json&ajax=1
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9
cache-control: no-cache
cookie: CK必须的
pragma: no-cache
referer: https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit_v2&action=edit&isNew=1&type=10&share=1&token=tk值&lang=zh_CN
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3900.0 Iron Safari/537.36
x-requested-with: XMLHttpRequest

从返回中取到biz编号
也就是fakeid
所以理论上已经有biz则可以省略这一步

文章列表接口

请求十来次后 请求间隔150秒为好
Request Method: GET
https://mp.weixin.qq.com/cgi-bin/appmsg?action=list_ex&begin=翻页起始默认0 默认步进5 如第80页就是395&count=数量默认5&fakeid=biz编号&type=9&query=&token=tk值&lang=zh_CN&f=json&ajax=1

:authority: mp.weixin.qq.com
:method: GET
:path: /cgi-bin/appmsg?action=list_ex&begin=0&count=数量默认5&fakeid=biz编号&type=9&query=&token=tk值&lang=zh_CN&f=json&ajax=1
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9
cache-control: no-cache
cookie: 
pragma: no-cache
referer: https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit_v2&action=edit&isNew=1&type=10&share=1&token=tk值&lang=zh_CN
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3900.0 Iron Safari/537.36
x-requested-with: XMLHttpRequest

从返回中取到 title、link

文章接口

请求几次后 请求间隔150秒再来为好
文章默认会从http跳到https

内容区域
js_content
/div

app端的接口

基本上不能做到全自动了
公众号全部历史文章
https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzU0MTc5MjM0NA==&scene=126&bizpsid=0&devicetype=android-22&version=27000435&lang=zh_CN&nettype=WIFI&a8scene=3&pass_ticket=wIxh%2Bu3kXFqUGOQ4kEF7HGeHsafQxjGUPnVsqQ6WdJpGtfdeTYJyr%2B68CzM1%2Fi3A&wx_header=1

Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: UA必须的
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
x-wechat-key: x-wechat-key
x-wechat-uin: MjE1NjExMzA3必须的
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: CK必须的
X-Requested-With: com.tencent.mm
Pragma: no-cache

/mp/profile_ext?action=getmsg&__biz=MjM5ODIzNDEx&f=json&offset=25&count=10&is_ok=1&scene=124&uin=MTU0MTQzNj&key=f57423
参数比较多,其中有用的参数 __biz 是用户和公众号之间的唯一id,uin是用户的id,这个是不变的,key 是请求的秘钥,一段时间就会失效,offset 是偏移量,count 是每次请求的条数,返回值可以看到返回数据包括文章标题titile、摘要digest、文章地址content_url、阅读原文地址source_url、封面cover、作者author

内容开始
var msgList