All Projects → xzkzdx → Weixin Platform History Article Api

xzkzdx / Weixin Platform History Article Api

微信公众号历史文章爬取api

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Weixin Platform History Article Api

Weixin Spider
微信公众号爬虫,公众号历史文章,文章评论,文章阅读及在看数据,可视化web页面,可部署于Windows服务器。基于Python3之flask/mysql/redis/mitmproxy/pywin32等实现,高效微信爬虫,微信公众号爬虫,历史文章,文章评论,数据更新。
Stars: ✭ 287 (+962.96%)
Mutual labels:  article, wechat, weixin
Wechat Jssdk
🐧WeChat JS-SDK integration with NodeJS
Stars: ✭ 571 (+2014.81%)
Mutual labels:  wechat, weixin
Wecron
✔️ 微信上的定时提醒 - Cron on WeChat
Stars: ✭ 537 (+1888.89%)
Mutual labels:  wechat, weixin
Wechat Miniprogram Examples
WeChat mini program examples. 微信小程序示例
Stars: ✭ 634 (+2248.15%)
Mutual labels:  wechat, weixin
Wechat sender
随时随地发送消息到微信
Stars: ✭ 474 (+1655.56%)
Mutual labels:  wechat, weixin
Planmaster
套餐助手:手机套餐对比选购小程序
Stars: ✭ 487 (+1703.7%)
Mutual labels:  wechat, weixin
Wechattweak Macos
A dynamic library tweak for WeChat macOS - 首款微信 macOS 客户端撤回拦截与多开
Stars: ✭ 6,505 (+23992.59%)
Mutual labels:  wechat, weixin
Wecheat
开箱即用的微信公众平台API模拟服务器,帮助你开发与调试微信公众平台应用
Stars: ✭ 440 (+1529.63%)
Mutual labels:  wechat, weixin
Iview Weapp
一套高质量的微信小程序 UI 组件库
Stars: ✭ 6,145 (+22659.26%)
Mutual labels:  wechat, weixin
Taro scaffold
基于 Taro / dva / redux-saga / react 的微信小程序脚手架,同时集成了 sprite 。
Stars: ✭ 24 (-11.11%)
Mutual labels:  wechat, weixin
Python Weixin
微信(weixin|wechat) Python SDK 支持开放平台和公众平台 支持微信小程序云开发
Stars: ✭ 746 (+2662.96%)
Mutual labels:  wechat, weixin
Weindex
微信相关资源汇总索引
Stars: ✭ 466 (+1625.93%)
Mutual labels:  wechat, weixin
Wechat Bot
带二次开发接口的PC微信聊天机器人
Stars: ✭ 458 (+1596.3%)
Mutual labels:  wechat, weixin
Sns auth
通用第三方登录SDK,支持微信,微信扫码,QQ,微博登录,支付宝登录,Facebook,Line,Twitter,Google
Stars: ✭ 520 (+1825.93%)
Mutual labels:  wechat, weixin
Pageslider
朋友圈广告 - 移动端滑屏翻页插件
Stars: ✭ 442 (+1537.04%)
Mutual labels:  wechat, weixin
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 589 (+2081.48%)
Mutual labels:  wechat, weixin
Weixin Java Miniapp Demo
基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
Stars: ✭ 779 (+2785.19%)
Mutual labels:  wechat, weixin
Werobot
WeRoBot 是一个微信公众号开发框架
Stars: ✭ 3,973 (+14614.81%)
Mutual labels:  wechat, weixin
Pay
可能是我用过的最优雅的 Alipay 和 WeChat 的支付 SDK 扩展包了
Stars: ✭ 4,176 (+15366.67%)
Mutual labels:  wechat, weixin
Quietweather
☀️ Develop a weather wechat mini program application in two days - 两天撸一个天气应用微信小程序
Stars: ✭ 677 (+2407.41%)
Mutual labels:  wechat, weixin

weixin platform history article api

微信公众号历史文章爬取api

@author:xzkzdx

@api site: https://github.com/xzkzdx/weixin-platform-history-article-api

@高效微信文章评论数据爬虫 api site: https://github.com/xzkzdx/weixin-spider

所需工具

1、环境依赖:建议使用 python3

2、请下载源码自行调试: https://github.com/xzkzdx/weixin-platform-history-article-api

3、建议使用fiddler抓包工具,或手写类似fiddler代理转发的工具

关于接口参数的获取

1、使用fiddler抓包工具获取必要的请求参数例如:uin 与 key

2、biz 也就是 __biz ,获取方式在公众号历史消息链接里,复制公众号历史消息的链接,找到&__biz=xxx==&中xxx==部分,样例代码给的是人民日报的__biz

调用api返回的json结果

# api调用结果的字段描述
api_result = 
{
    "status": status,  # api使用状态 200 正常
    "biz": h_biz,  # 公众号__biz标识
    "uin": h_uin,  # app登录用户的必要uin参数
    "cur_offset": h_offset,  # 当前请求的偏移量
    "next_offset": next_offset,  # 下一次请求的偏移量offset  status不为200时,会与cur_offset一致,用于调试
    "key": h_key,  # api必备的app key
    "results": {
        "article_count": len(article_infos),  # 获取的文章数量
        "article_infos": article_infos,  # 获取的全部文章信息
    },
    "ending": ending  # 是否历史文章爬取完毕,依据offset,可用于自定义增量爬取的结束条件
}
# 文章信息字段描述
article_infos = [{
    "article_title": article_title,  # 文章标题
    "article_author": article_author,  # 文章作者
    "article_publish_time": article_publish_time,  # 文章发布时间
    "article_digest": article_digest,  # 文章摘要
    "article_content_url": article_content_url,  # 文章详情链接
    "article_cover_url": article_cover_url,  # 封面图片链接
    "article_source_url": article_source_url,  # 源文链接
    "article_copy_right": copy_right,  # 1原创  0非原创
},]

样例:simple_example.py


from api import get_history_api

if __name__ == '__main__':
    """ '%3D%3D' 与 '==' 等价"""
    # 每一个公众号公众号都存在的公开的__biz信息
    biz = "MjM5MjAxNDM4MA=="  # 人民日报的 __biz 信息,也可以记做 MjM5MjAxNDM4MA%3D%3D
    # 账号私密的uin信息
    uin = "MTE3Mz********=="  # 微信app登录用户的uin信息,也可以记做 MTE3Mz********%3D%3D

    # 一个较长的公众号数据请求验证密钥 key, 有限时间内的单个公众号的密钥私密信息,下方的key只是样例
    key = "c47853a08ff0b5dfa2d8577abec94139b456b36e84fe805909478b9bd67354a9853abd97e1eb0ac53ab2ee9dccfcfec938e58069028f0d588972db2374137c0f1079a5779ef77afbe35c9a8c882a3117"

    # 自定义的偏移量及最大获取时间线数
    offset = "0"  # 公众号历史消息偏移量,起始位置为0,从当前最新图文发布时间向后递增
    count = "10"  # 由当前偏移量发布图文时间起算,历史连续不同发布时间的发布次数,最大限制为10

    # 调用的api
    result = get_history_api(biz, uin, key, offset, count)
    print(result)  # 获取的请求结果

注意

作者亲自实测,同一个微信账号最小访问限制时间为10秒, 即api调用频率至多为 每次/10秒, 在setting.py模块给了建议睡眠时间SLEEP_TIME = 10

另外

将uin与key部署在自己的代码里,使用api.py你将看到很好地效果。

当然,key是会过期的,如何动态不断地获取key来完成增量爬取。

代码已全部迁入 https://github.com/xzkzdx/weixin-spider

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].