Open-source WhatsApp bot vs hosted: the real libraries, the work nobody mentions, and an honest build-or-buy table
If you can code, or know someone who can, an open-source WhatsApp bot looks like the free option. The library is free. The bot your customers need is a lot more than the library. This guide lists the projects worth knowing on GitHub, the work they leave for you, and when building really is the better call.
Quick answer
Open-source WhatsApp bot libraries such as whatsapp-web.js and Baileys are free on GitHub, but they only handle sending and receiving messages, unofficially, through a linked device. You still build and pay for hosting, session upkeep, AI, knowledge retrieval, booking, an inbox and handoff. Meta's official Cloud API has open-source samples too. Build if WhatsApp is your product; buy if it is a channel.
What is an open-source WhatsApp bot?
An open-source WhatsApp bot is code you can download, read and run yourself to send and receive WhatsApp messages automatically. Most of them are libraries, not finished bots: they give you a way to connect to WhatsApp, and you write everything the bot actually does.
They come in two families. Unofficial libraries connect to a normal WhatsApp account as a linked device, the way WhatsApp Web does, after you scan a QR code. Official samples use Meta's WhatsApp Cloud API, which needs a Meta developer app and business setup, and charges per message. The difference matters more than the language a project is written in; our WhatsApp chatbot without the API explainer covers it in full.
Which WhatsApp bot projects are on GitHub?
These are the well-known projects, each checked on GitHub in October 2026. The unofficial ones all state that they are not affiliated with WhatsApp.
| Project | What it is | Connection | Licence |
|---|---|---|---|
| whatsapp-web.js | Node.js library that runs WhatsApp Web in a headless browser | Unofficial, linked device | Apache-2.0 |
| Baileys | TypeScript/JavaScript library that speaks the WhatsApp Web protocol over a socket, no browser | Unofficial, linked device | MIT |
| whatsmeow | Go library for the WhatsApp web multidevice API | Unofficial, linked device | MPL-2.0 |
| WAHA | A ready-made HTTP API server you run yourself, with a choice of engines | Unofficial, linked device | Apache-2.0 |
| Evolution API | Open-source WhatsApp integration API server you host | Check its docs for the connection types it supports | See repository |
| Cloud API examples and Jasper's Market | Meta's own sample code for the WhatsApp Cloud API, including a full demo bot | Official API | See repository |
Two details worth knowing. The whatsapp-web.js readme says it is not guaranteed you will not be blocked and that WhatsApp does not allow bots or unofficial clients. And Meta's official Node.js SDK repository is archived, so on the official side most developers work from the samples and the raw API. WhatsApp's own help centre says linking an unofficial app may result in a temporary or permanent ban, which applies to every unofficial row above.
What a library does not do for you
A library gets messages in and out. Everything that makes a bot useful to a small business is left to you. Here is the work list.
- Hosting. A server that runs all day, restarts after crashes and stores the session safely. Browser-based libraries are memory-hungry.
- Session upkeep. Linked sessions drop: WhatsApp's help centre says linked devices log out if the phone is unused for more than 14 days, and WhatsApp updates can break unofficial libraries until a maintainer catches up. Someone has to notice, rescan and redeploy.
- The AI. A pay-per-use AI service, prompts that keep it on your business, and guardrails so it does not invent prices.
- Knowledge retrieval. Crawling your website, reading PDFs and price lists, splitting them up, and finding the right passage for each question (often called RAG, retrieval-augmented generation). Plus a way to say "I do not know" and flag the gap. Our retrieval explainer covers how this works.
- Booking. Your opening hours, real free slots, double-booking protection when two people ask at once, reminders and calendar export.
- An inbox. A screen where you and staff can read every chat, take over, and hand back to the bot, so customers are never stuck.
- Lead capture. Name, need, budget, timing, and some way to see who is hot.
- Safety limits. Reply caps per hour and day, human pacing, "stop" handling, and no path to bulk sending.
- Maintenance. Library updates, security patches, backups, and the 2am outage.
Build vs buy: honest time estimates
Building a basic bot is quick. Building a dependable one is weeks of work. The times below are our estimates for one experienced developer working from an open-source library, not measurements, and your mileage will vary.
| Piece | Build it yourself (estimate) | Hosted AI agent |
|---|---|---|
| Connect a number and echo replies | Half a day to a day | Minutes |
| Keyword or menu bot | 1 to 3 days | Not needed; the AI reads free text |
| AI answers from your website and PDFs | 1 to 3 weeks, including retrieval and testing | Paste a URL, upload files |
| Booking with real slots and no double booking | 1 to 2 weeks | Set your hours |
| Inbox with human takeover | 2 to 4 weeks | Included |
| Rate limits, pacing, stop handling | 2 to 5 days | Included |
| Ongoing maintenance | Several hours a month, plus incidents | The vendor's job |
| Total to a dependable first version | Roughly 6 to 12 weeks | About 15 minutes to set up, then tuning |
The comparison flips if your needs are unusual. If you need the bot to call your own systems, run custom logic or live inside a product you sell, a hosted tool will not stretch that far and building is the right answer. We go deeper on that trade-off in buying an AI agent vs building your own and hiring a freelancer to build a chatbot.
What does an open-source WhatsApp bot cost to run?
The code is free; the running costs are small but never zero, and developer time is the big one. Here are the parts, with prices we checked in October 2026.
- Server. DigitalOcean's smallest Basic Droplet is $4 a month with 512 MiB of memory; a 2 GiB one is $12. Railway's Hobby plan is $5 a month including $5 of usage. A headless-browser library will want more memory than the smallest plan.
- AI usage. Billed per use by whichever AI provider you choose. Cheap per reply, but it grows with volume and with how much context you send.
- Meta fees, official route only. Meta's pricing documentation says that from 1 October 2026 each business number gets 1,000 free service messages a month, then replies are charged; templates and marketing are charged per message.
- Your time or a developer's. Usually the largest line, and the one that never ends.
Unofficial libraries add one cost that is not on any invoice: the number itself. If WhatsApp restricts it, every customer who has it saved is now messaging a dead line. Put any bot like this on a dedicated number; our guide to a dedicated WhatsApp number explains how.
When is open source the right choice?
Open source wins when you have the skills, a reason to own the code, and time for upkeep. It loses when WhatsApp is just one of the ways customers reach a small business that needs answers today.
Build with open source if
- WhatsApp is part of a product you sell.
- You need deep links into your own systems.
- You have a developer for the long run, not just the launch.
- You want the official Cloud API and full control of the code.
Use a hosted tool if
- You need answers, booking and an inbox this week.
- Nobody on the team wants to be on call for a bot.
- Your time is worth more than a monthly fee.
- You want someone else to absorb WhatsApp's changes.
Where ReplyKit fits
We make ReplyKit, so weigh our view accordingly. ReplyKit is the hosted side of this choice: an AI agent for WhatsApp and website chat that already does the work list above. It learns from your website, PDFs, price lists and Q&A pairs, answers only from that knowledge and escalates when the answer is missing, books real open slots with double-booking protection and a reminder about 24 hours before, scores leads hot, warm or cold, and gives you one inbox with one-click takeover.
It connects through Quick Connect, a QR scan that pairs your number as a linked device. That is the same unofficial mechanism as the libraries above: not the WhatsApp Business API, not sanctioned by Meta, and a number can be restricted. Read will WhatsApp ban my number for automation? first. We enforce reply-only behaviour and default limits of 30 AI replies an hour and 200 a day per number, and we recommend a dedicated number. There are no Meta fees.
ReplyKit is not the right choice if you need custom integrations: it has no Zapier, webhooks or native CRM connections, only CSV export. It also does no broadcasts, groups or official API. If those matter, build, or use an official-API platform. If not, compare your build estimate with $29 to $99 a month, or test it on your own content with a 7-day free trial, no card needed.
Frequently asked questions
Is there an open-source WhatsApp bot?
Yes. Well-known open-source libraries on GitHub include whatsapp-web.js, Baileys and whatsmeow, plus self-hosted API servers such as WAHA and Evolution API. These connect unofficially as a linked device. Meta also publishes open-source sample code for its official Cloud API.
Is whatsapp-web.js safe to use for business?
It works, but it is unofficial. Its own readme says WhatsApp does not allow bots or unofficial clients and that you are not guaranteed to avoid a block. Use a dedicated number and inbound-only replies if you use it at all.
What is the difference between Baileys and whatsapp-web.js?
whatsapp-web.js runs WhatsApp Web inside a headless browser, which is heavier on memory. Baileys talks to the WhatsApp Web protocol directly over a socket without a browser. Both are unofficial linked-device libraries with the same ban risk.
Is there an open-source WhatsApp bot builder?
Most open-source projects are libraries or API servers you build on, not drag-and-drop builders. You write the logic, AI prompts, knowledge retrieval, booking and inbox yourself. Hosted tools exist to skip that work.
How long does it take to build a WhatsApp AI bot yourself?
Our estimate for one experienced developer is half a day for a basic echo bot and roughly 6 to 12 weeks for a dependable bot with AI answers from your content, booking, an inbox and safety limits. Maintenance continues after that.
Can I use the official WhatsApp API with open-source code?
Yes. Meta publishes Cloud API sample code on GitHub, including a full demo bot. You still need a Meta developer app, a business portfolio and a webhook server, plus a payment method once you pass Meta's free allowances, after which Meta charges per message.
Compare your build estimate with 15 minutes
Knowledge, booking, inbox and limits already built. 7-day free trial, no credit card, 300 AI replies.
Sources and further reading
- whatsapp-web.js on GitHub · Apache-2.0 library using a headless browser; disclaimer on blocking
- Baileys on GitHub · MIT socket-based library; disclaimer discouraging bulk or automated messaging
- whatsmeow on GitHub · MPL-2.0 Go library
- WAHA on GitHub · Apache-2.0 self-hosted WhatsApp HTTP API
- Evolution API on GitHub · open-source WhatsApp integration API
- Meta, WhatsApp Cloud API examples on GitHub · official sample code
- Meta, Jasper's Market sample app on GitHub · official demo bot
- WhatsApp Cloud API Node.js SDK on GitHub · official SDK repository, archived
- Meta for Developers, WhatsApp Cloud API Get Started · developer app, business portfolio and webhook requirements
- Meta for Developers, Pricing on the WhatsApp Business Platform · service message free tier and charges from 1 October 2026
- WhatsApp Help Center, About linked devices · 14-day logout rule; unofficial apps may lead to a ban
- DigitalOcean Droplet pricing · $4 and $12 Basic Droplets, checked October 2026
- Railway pricing · $5 Hobby plan, checked October 2026
ReplyKit is an independent product and is not affiliated with or endorsed by Meta or WhatsApp. Open-source project details were checked on GitHub and hosting prices on the providers' pricing pages in October 2026 and may change. Time estimates are estimates. Nothing here is legal advice.