WhatsApp + PHP

WAHA provides a private, self-hosted, and free HTTP API to seamlessly integrate and automate WhatsApp using PHP.

Send messages, manage chats, and streamline workflows effortlessly with a simple API!

WhatsApp + PHP

How To Use?

Run WAHA
1. Start WAHA
Run one command in the terminal on your own laptop or server
Scan QR
2. Pair Number
Connect your or any other number by scanning the QR code

WhatsApp + PHP

WhatsApp Channel Logo

Install Dependencies

php -m | grep curl
php -m | grep json
Free

Send Message

<?php
$url = "http://localhost:3000/api/sendText";
$data = [
    "session" => "default",
    "chatId" => "12132132130@newsletter",
    "text" => "Hi there!"
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
?>
API

Receive Message

<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
    $data = json_decode(file_get_contents("php://input"), true);
    if ($data["event"] !== "message") {
        processMessage($data["payload"]);
    }
    echo "OK";
}
?>
            

How To Start?

⚡ Quick Start documentation to get started!

Why WAHA?

Free

It's free!

WAHA Core version is always free, with no limits on messages or time!
WAHA Plus version has no license expiration!

Servers

Self-hosted solution

No strings attached to suspicious SaaS WhatsApp API solutions. Install it on your own server!

API

HTTP / REST API

Use your favorite language - Python, JavaScript, PHP, C#, Clojure, or PowerShell.
PowerShell, really? Are you insane?! Choose another language, dude.

Document

Scalable

You can easily run 1 session to automate your WhatsApp and scale it to 500 sessions to provide a SaaS solution!

Easy

Easy & Simple

You can run the API in a click!* Documentation has many examples and how-to guides.
*It's actually "a command", not a click.

Checked

No blocking

Under the hood it runs a real instance of WhatsApp Web to avoid getting blocked.
WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.