Skip to content

微信3.x HTTP接口文档

基础地址: http://127.0.0.1:19088

所有接口均为 POST 请求,参数以 JSON 格式传递。


消息相关

发送文本消息

POST /api/send_text_msg

参数类型必填说明
wxidstring接收人wxid
msgstring消息内容
json
{"wxid": "filehelper", "msg": "Hello World!"}

发送文本消息(协议)

POST /api/send_text_pb

参数类型必填说明
wxidstring接收人wxid
msgstring消息内容
typestring消息类型
json
{"wxid": "filehelper", "msg": "你好啊", "type": "1"}

发送图片消息

POST /api/send_image_msg

参数类型必填说明
wxidstring接收人wxid
image_pathstring图片本地路径
json
{"wxid": "filehelper", "image_path": "c:\\1.jpg"}

发送文件

POST /api/send_file_msg

参数类型必填说明
wxidstring接收人wxid
full_pathstring文件完整路径
json
{"wxid": "filehelper", "full_path": "C:\\Users\\Desktop\\file.md"}

发送语音(协议)

POST /api/send_voice

参数类型必填说明
toWxidstring接收人wxid
silkPathstringsilk格式语音文件路径
secondsstring语音时长(秒)
json
{"toWxid": "wxid_xxx", "silkPath": "D:\\output.silk", "seconds": "20"}

发送表情

POST /api/send_custom_emotion

参数类型必填说明
wxidstring接收人wxid
file_pathstring表情文件路径
json
{"wxid": "filehelper", "file_path": "D:\\1.gif"}

发送名片

POST /api/send_card_msg

参数类型必填说明
towxidstring接收人wxid
fromwxidstring名片wxid
json
{"towxid": "filehelper", "fromwxid": "wxid_xxx"}

发送At消息

POST /api/send_at_text

参数类型必填说明
room_idstring群聊ID
msgstring消息内容
wxidsstring被@人的wxid,notify@all表示@所有人
json
{"room_id": "50582745779@chatroom", "msg": "在干嘛呢", "wxids": "notify@all"}

发送引用消息

POST /api/send_quote_msg

参数类型必填说明
wxidstring接收人wxid或群聊ID
msgIdstring被引用的消息ID
msgstring回复内容
json
{"wxid": "50582745779@chatroom", "msgId": "8292128004080533745", "msg": "回复内容"}

撤回消息

POST /api/revoke_msg

参数类型必填说明
index_idstring消息索引ID
json
{"index_id": "4796650063682630984"}

转发单条消息

POST /api/forward_single_msg

参数类型必填说明
msgidnumber消息ID
wxidstring转发目标wxid
json
{"msgid": 7123908525629997597, "wxid": "filehelper"}

个人信息

获取自己详细信息

POST /api/get_profile_cache

json
{}

登录

POST /api/login

json
{}

检查登录状态

POST /api/check_login

json
{}

刷新登录二维码

POST /api/reflash_qrcode

json
{}

修改昵称

POST /api/mod_self_nick_name

参数类型必填说明
newNamestring新昵称
json
{"newName": "新昵称"}

好友管理

获取好友列表

POST /api/get_frien_lists

json
{}

获取好友详细信息(协议)

POST /api/net_scene_get_contact

参数类型必填说明
wxidsstringwxid
roomIdstring群聊ID
json
{"wxids": "wxid_xxx", "roomId": ""}

获取好友详细信息(缓存)

POST /api/get_contact_cache

参数类型必填说明
wxidstring好友wxid
json
{"wxid": "wxid_xxx"}

网络搜索微信号

POST /api/net_scene_search_contact

参数类型必填说明
searchstring搜索关键词
json
{"search": "13671934252"}

添加好友

POST /api/add_friend

参数类型必填说明
wxidstringwxid 或 v3
greetstring验证消息
scencestring场景值
rolestring朋友权限
json
{"wxid": "wxid_xxx", "greet": "你好啊", "scence": "30", "role": "0"}

通过好友

POST /api/accept_friend

参数类型必填说明
v3stringv3数据
v4stringv4数据
scencestring好友来源
rolestring朋友权限
json
{"v3": "v3", "v4": "v4", "scence": "好友来源", "role": "朋友权限"}

删除好友

POST /api/del_contact

参数类型必填说明
wxidstring好友wxid
json
{"wxid": "wxid_xxx"}

群聊管理

获取群聊列表

POST /api/get_room_lists

json
{}

获取群成员列表

POST /api/net_scene_get_member_from_chat_room

参数类型必填说明
room_idstring群聊ID
json
{"room_id": "5367651578@chatroom"}

创建群聊

POST /api/creat_chat_room

参数类型必填说明
wxidsstring成员wxid,多个用逗号分隔
json
{"wxids": "wxid_xxx,wxid_yyy"}

设置群公告

POST /api/set_room_announcement

参数类型必填说明
roomIdstring群聊ID
announcementstring公告内容
json
{"roomId": "53324112125@chatroom", "announcement": "测试公告"}

修改群聊名称

POST /api/mod_chat_room_topic

参数类型必填说明
topicstring新群名称
room_idstring群聊ID
json
{"topic": "新群名称", "room_id": "57317789416@chatroom"}

拉人进群

POST /api/add_member_to_chat_room

参数类型必填说明
wxid_liststring要拉入的wxid
room_idstring群聊ID
json
{"wxid_list": "wxid_xxx", "room_id": "38994638667@chatroom"}

踢出群聊

POST /api/del_member_from_chat_room

参数类型必填说明
wxid_liststring要踢出的wxid
room_idstring群聊ID
json
{"wxid_list": "wxid_xxx", "room_id": "群wxid"}

数据库操作

获取数据库句柄

POST /api/get_db_handle

json
{}

执行sql语句

POST /api/sqlite3_exec

参数类型必填说明
dbHandlestring数据库句柄
sqlstringSQL语句
json
{"dbHandle": "1622390499712", "sql": "select * from sqlite_master"}

朋友圈

发朋友圈

POST /api/sns_post

参数类型必填说明
contentstring朋友圈文本内容
blackListstring不可见名单
withauserListstring可见名单
json
{"content": "这是我测试的朋友圈", "blackList": "", "withauserList": ""}

获取朋友圈首页

POST /api/sns_get_first_page

json
{}

点赞朋友圈

POST /api/sns_like

参数类型必填说明
sns_idstring朋友圈ID
wxidstring自己的wxid
json
{"sns_id": "14417590059746931229", "wxid": "wxid_xxx"}

其他功能

CDN下载

POST /api/cdn_download

参数类型必填说明
file_idstringCDN文件ID
aes_keystringAES解密密钥
save_pathstring文件保存路径
json
{"file_id": "[file_id]", "aes_key": "[aes_key]", "save_path": "D:\\file.jpg"}

解码图片

POST /api/decode_img

参数类型必填说明
pathstring加密图片路径
savestring解码后保存路径
json
{"path": "F:\\wechatflie\\xxx.dat", "save": "d:\\output.jpg"}

OCR识别

POST /api/ocr

参数类型必填说明
wechatocr_exe_pathstringWeChatOCR路径
wechat_dirstring微信安装目录
img_pathstring待识别图片路径
json
{
    "wechatocr_exe_path": "C:\\...\\WeChatOCR.exe",
    "wechat_dir": "D:\\WeChat\\[3.9.11.17]",
    "img_path": "C:\\image.png"
}

确认收款

POST /api/ten_pay_trans_fer_confirm

参数类型必填说明
wxidstring转账发送方wxid
transIdstring转账交易ID
json
{"wxid": "wxid_xxx", "transId": "1000050001202408161428438482833"}

基于 MIT 许可发布