Skip to content

Piyushhbhutoria/whatsappWebAPI

Repository files navigation

logowhatsappWebAPI

whatsappWebAPI

Go-Build GitHub GitHub release (latest by date) GitHub go.mod Go version Go Report Card GitHub All Releases GitHub repo size

A WhatsApp Web API built with Go using whatsmeow. Send messages, images, and manage WhatsApp interactions programmatically.

Important: Phone numbers must include the country code (e.g., 91XXXXXXXXXX for India).

Setup

Option 1: Download the latest binary from releases

Option 2: Build from source (requires Go 1.25+)

git clone https://github.com/Piyushhbhutoria/whatsappWebAPI.git cd whatsappWebAPI make run

Configuration flags:

  • -debug: Enable debug logs
  • -db-dialect: sqlite3 or postgres (default: sqlite3)
  • -db-address: Database connection string

Usage

  1. Run the application and scan the QR code with WhatsApp Web
  2. Use commands interactively:

Commands

Messaging:

  • send <jid> <text> - Send text message
  • sendimg <jid> <image path> [caption] - Send image
  • sendbulk <csv file> - Bulk text (CSV: <jid>,<message>)
  • sendbulkimg <csv file> - Bulk images (CSV: <jid>,<image path>,[caption])

User Management:

  • checkuser <phone numbers...> - Check if users are on WhatsApp
  • getuser <jids...> - Get user info
  • getavatar <jid> [preview] - Get user avatar

Groups:

  • listgroups - List all groups
  • getgroup <group_jid> - Get group info
  • getinvitelink <group_jid> [--reset] - Get/reset invite link
  • queryinvitelink <link> - Query invite link info
  • joininvitelink <link> - Join group via invite link

Presence & Privacy:

  • subscribepresence <jid> - Subscribe to presence updates
  • presence <presence_type> - Send presence
  • chatpresence <presence_type> <jid> [media_type] - Send chat presence
  • privacysettings - Get privacy settings

Utility:

  • reconnect - Reconnect to WhatsApp
  • logout - Logout from WhatsApp
  • appstate <types...> [resync] - Sync app state
  • Ctrl+C - Exit

CSV Format Examples

Bulk Text:

919876543210,Hello from bulk message 919876543211,Another message 

Bulk Image:

919876543210,/path/to/image1.jpg,Caption 1 919876543211,/path/to/image2.jpg,Caption 2 

Demo files available in files folder.

License

FOSSA Status

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •