Open Sourcenpm + pip

WABridge

A lightweight WhatsApp HTTP Bridge.

Link your WhatsApp via CLI, then send messages through a simple REST API. Supports text, images, video, audio, documents — to individuals, groups, and channels.

$ npm install -g wabridge

Or run directly: npx wabridge

How It Works

WABridge sits between your applications and WhatsApp, routing messages through a local HTTP server.

Loading diagram...

Your App sends HTTP requests to WABridge, which delivers them to WhatsApp.

Simple REST API

One POST request to send a message. No complex SDKs or auth flows required.

Rich Media

Send images, videos, voice notes, and documents. Supports URLs and local file paths.

Groups & Channels

Send to individuals, groups, and channels. List groups with their JIDs programmatically.

Self-Hosted

Runs on your machine. No third-party cloud services. Your messages stay local.

Python SDK

Send messages from Python with one function call. Sync and async support built in.

Interactive CLI

Test messages interactively from the terminal. Link via QR code or pairing code.

Quick Start

1

Link WhatsApp

QR Code (default):

$ wabridge
# Scan the QR code with WhatsApp
# Settings > Linked Devices > Link a Device

Pairing Code (alternative):

$ wabridge --code
# Enter your phone number and get an 8-digit pairing code

Auth is saved to ~/.wabridge/ — you only need to link once.

2

Start the API Server

$ wabridge start
WABridge server running on port 3000

Custom port: wabridge start 8080

3

Send Messages

Using curl:

$ curl -X POST http://localhost:3000/send \
  -H 'Content-Type: application/json' \
  -d '{"phone": "919876543210", "message": "BUY NIFTY 24000 CE @ 150"}'

Using Python:

$ pip install wabridge

from wabridge import WABridge
wa = WABridge()
wa.send("919876543210", "BUY NIFTY 24000 CE @ 150")

API Endpoints

GET/status

Check WhatsApp connection status

{ "status": "open", "user": "[email protected]" }
GET/groups

List all WhatsApp groups with their JIDs

{ "groups": [{ "id": "[email protected]", "subject": "Trading Alerts" }] }
POST/send

Send text, image, video, audio, or document

{ "phone": "919876543210", "message": "BUY NIFTY 24000 CE @ 150" }
POST/send/self

Send a message to yourself

{ "message": "Portfolio P&L: +5000" }
POST/send/group

Send a message to a WhatsApp group

{ "groupId": "[email protected]", "message": "NIFTY crossed 25000!" }
POST/send/channel

Send a message to a WhatsApp channel

{ "channelId": "120363098765@newsletter", "message": "Market closed." }

Message Content Fields

All send endpoints accept these content fields:

FieldTypeDescription
messagestringText message
imageURL or file pathImage with optional caption
videoURL or file pathVideo with optional caption
audioURL or file pathVoice note or audio file
documentURL or file pathDocument attachment

Use Cases

Trading Alerts

wa.send("BUY NIFTY 24000 CE @ 150")

Send Chart Images

wa.send("91...", image="url", caption="NIFTY")

Group Portfolio Updates

wa.send_group("[email protected]", "P&L: +5000")

Send P&L Reports

wa.send("91...", document="pnl.pdf")

Broadcast Market Alerts

wa.send([(n, "NIFTY 25000!") for n in nums])

Price Monitoring

if price > 25000: wa.send(f"Alert: {price}")

Requirements

Node.js >= 20.0.0

For the WABridge server

Python >= 3.8

For the Python SDK (optional)