项目地址:https://github.com/cluic/wxauto-restful-api
基于 FastAPI 开发的 HTTP API 服务,为 wxautox4 提供完整的 RESTful API 接口。支持消息发送、群管理、好友管理等微信自动化功能。
本项目专门为wxautox4设计,需要wxautox4 Plus版本
激活要求:wxautox4需要激活后才能使用。请先使用以下方式激活:
项目使用 config.yaml 作为主配置文件,所有服务器设置都通过此文件管理:
启动服务后,可以通过以下地址访问交互式 API 文档(请自行修改端口):
重要: wxautox4 需要激活后才能使用
编辑 config.yaml 文件:
打开浏览器访问: http://localhost:8000/docs (自行修改端口号)
所有接口都遵循统一的响应格式,详见 API 响应格式规范。
POST /v1/wechat/initialize - 初始化微信实例GET /v1/wechat/status - 获取微信状态POST /v1/wechat/send - 发送消息POST /v1/wechat/sendfile - 发送文件POST /v1/wechat/sendurlcard - 发送 URL 卡片POST /v1/wechat/getallmessage - 获取当前窗口消息POST /v1/wechat/gethistorymessage - 获取历史消息POST /v1/wechat/getnextnewmessage - 获取新消息POST /v1/wechat/getsession - 获取会话列表POST /v1/wechat/getsubwindow - 获取指定子窗口POST /v1/wechat/getallsubwindow - 获取所有子窗口POST /v1/wechat/chatwith - 切换聊天窗口POST /v1/wechat/getfriends - 获取好友列表POST /v1/wechat/getmyinfo - 获取我的信息POST /v1/wechat/getrecentgroups - 获取群聊列表POST /v1/wechat/switch/chat - 切换到聊天页面POST /v1/wechat/switch/contact - 切换到联系人页面POST /v1/wechat/isonline - 检查在线状态POST /v1/chat/send - 子窗口发送消息POST /v1/chat/getallmessage - 获取子窗口所有消息POST /v1/chat/getnewmessage - 获取子窗口新消息POST /v1/chat/msg/quote - 发送引用消息POST /v1/chat/close - 关闭子窗口POST /v1/files/upload - 上传文件GET /v1/files/{file_id} - 获取文件信息DELETE /v1/files/{file_id} - 删除文件GET /v1/files/ - 获取文件列表POST /v1/activation/activate - 激活许可证GET /v1/activation/check - 检查激活状态GET /v1/info/package - 获取包信息所有 API 请求都需要在 Header 中包含有效的认证 token:
配置你的 token 在 config.yaml 中:
所有 API 接口都遵循统一的响应格式:
详见 API 响应格式规范
config.yaml - 主配置文件(包含所有服务器设置)pyproject.toml - 项目依赖配置server.port - 服务端口(默认8000)server.host - 服务器监听地址(默认0.0.0.0)server.reload - 热重载开关(默认true)auth.token - API访问令牌database.type - 数据库类型(默认sqlite)