WhatsApp AI Bot 2026: Build Your Own With whatsapp-web.js (22k Stars) - No API Fees

📘 Tutorials 2026-08-03 2 min read

The official WhatsApp Business API charges per conversation and requires business verification. But for personal use or small shops, open-source libraries can run an AI bot on your own number for free.

## The short answer For personal and small-business bots, **whatsapp-web.js** (22,325 stars, Apache-2.0) is the most popular open-source WhatsApp client library: it connects through the WhatsApp Web session, so you can build an AI bot on your existing number without paying per-conversation fees. **Baileys** (10,558 stars, MIT) is the TypeScript alternative with better multi-device support. ## What you can build - Auto-reply FAQ bot powered by any LLM (OpenAI, Claude, or local Ollama). - Order-taking assistant that reads a product catalog and answers stock/price questions. - Personal assistant that summarizes forwarded links (feed URLs to an LLM). - Broadcast tool for small shops - with strict compliance in mind. ## Getting started (Node.js) ```bash npm install whatsapp-web.js qrcode-terminal ``` ```javascript const { Client, LocalAuth } = require('whatsapp-web.js'); const client = new Client({ authStrategy: new LocalAuth() }); client.on('qr', (qr) => console.log(qr)); // scan with your phone client.on('message', async (msg) => { const reply = await askLLM(msg.body); // your LLM call msg.reply(reply); }); client.initialize(); ``` Key points: use `LocalAuth` so you do not re-scan the QR every restart; run it on a VPS or Raspberry Pi so the session stays alive; handle WhatsApp's rate limits with delays between messages. ## Compliance warning The WhatsApp Web protocol is not an official API. For anything beyond light personal use, WhatsApp can ban numbers that automate at scale. If you are running a business, the official Business Platform (Meta) or a BSP (Twilio, 360dialog) is the compliant path - expect ~$0.005-0.05 per conversation depending on country and template type. ## FAQ **Is using whatsapp-web.js against WhatsApp ToS?** It uses the web client protocol, which is not an official API; there is ban risk for high-volume automation. Keep volumes low for personal use. **Can it send media?** Yes - images, documents, and audio via MessageMedia. **Does it work with multi-device?** Baileys has better multi-device support; whatsapp-web.js works but with some limitations. ## Related - [Hermes Connects to WhatsApp Official Cloud API](/post/hermes接入whatsapp官方云一次性把坑讲完-ba6b35) - [Telegram AI Bot Guide 2026](/post/telegram-ai-bot-guide-20260803)
Related Articles
2026-06-29
The Mainline Dragon Strategy — Chasing the Leader Without Paying for Data
2026-06-29
The AI Hiding in Your Laptop
2026-07-14
Free AI Coding Assistant Setup 2026: 5-Min VS Code Guide (Continue, Copilot, Windsurf)

💬 Comments (0)

No comments yet. Be the first!

Login to comment