Personal WeChat API: messaging, contacts, groups and Moments
Tencent offers no API for personal WeChat accounts. We host the account and expose messaging, contacts, groups and Moments as HTTP endpoints with real-time webhooks.
Personal WeChat API capabilities
One API key for every endpoint, one consistent JSON response format.
Messaging
Send and receive text, images, files, voice, video, link cards and mini program cards. @mention members in groups and recall messages.
POST /v1/message/send_textView endpoint →Contacts
Search and add friends, auto-accept friend requests, set remarks and tags, list friends and profiles.
GET /v1/contact/friendsView endpoint →Group management
Create groups, invite and remove members, change group names and announcements, list members.
POST /v1/group/createView endpoint →Moments
Post text and image Moments, read friends' Moments, like and comment, schedule posts.
POST /v1/moment/postView endpoint →Real-time webhooks
New messages, friend requests, members joining or leaving and account logouts are pushed to your server instantly.
POST {your webhook URL}View endpoint →Login & multi-account
Log in hosted accounts by QR code, check online status, get notified on logout. One API key manages many accounts.
POST /v1/account/login_qrcodeView endpoint →Example: a WeChat bot that auto-replies
Subscribe to message.received, check whether the bot was mentioned, then call the send endpoint. A minimal working Python example:
from flask import Flask, request
import requests
app = Flask(__name__)
API = "https://api.wechatapilabs.com/v1/message/send_text"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
@app.post("/wechat/callback")
def callback():
evt = request.get_json()
if evt["event"] == "message.received":
d = evt["data"]
if d["type"] == "text" and (d.get("at_me") or not d.get("room_id")):
reply = "Got it: " + d["content"] # replace with your logic or an LLM
requests.post(API, headers=HEADERS, json={
"account_id": evt["account_id"],
"to": d.get("room_id") or d["from"],
"content": reply,
"at": [d["from"]] if d.get("room_id") else [],
}, timeout=10)
return {"ok": True}
Building a WeChat bot or community automation? Start with a test account.
Personal WeChat API FAQ
How does the personal WeChat API work?
Accounts are kept online through hosted login. Everything the account can do is exposed as HTTP endpoints, and incoming events are pushed to your webhook. You don't maintain clients or protocol updates.
How many messages can an account send per day?
There's no hard cap, but risk rises with volume. High-risk actions such as adding friends and mass sends are rate-limited by default, with recommended limits by account age.
Can I use a newly registered account?
Not recommended. New accounts doing heavy automation get restricted quickly. Use the account normally for a while first, then ramp up.
Can the phone stay logged in?
Yes. Keep WeChat logged in on the phone; messages stay in sync with the hosted session.
Background reading: Is there a personal WeChat account API?