WhatsApp API for Node.js

Uses the built-in fetch (Node 18+). No SDK needed. There is no official SDK, just one HTTP request.

Send a message with Node.js

Node.js
const res = await fetch("https://quackapi.com/v1/messages/chat", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.QUACKAPI_KEY,
  },
  body: JSON.stringify({
    deviceId: 1,
    to: "923001234567",
    body: "Hello from QuackAPI",
  }),
});

const data = await res.json();
if (!res.ok) throw new Error(data.message);
console.log(data); // { success: true, messageId: 123, status: "queued" }

Before you run it

  • Connect a device and use its numeric id as deviceId.
  • Set QUACKAPI_KEY to your wa_ key.
  • Run this on a server. Never ship the key to a browser or app.

Handling errors

Non-2xx responses carry a JSON message. See the errors page for what each code means and which to retry.

Related

Last reviewed 2026-11-09. QuackAPI is an unofficial linked-device service. Acceptable use