{"id":15155512,"url":"https://github.com/salman0ansari/whatsapp-api-nodejs","last_synced_at":"2025-09-30T03:31:30.869Z","repository":{"id":37832640,"uuid":"390760759","full_name":"salman0ansari/whatsapp-api-nodejs","owner":"salman0ansari","description":"RESTful WhatsApp API with Multiple Device Support","archived":true,"fork":false,"pushed_at":"2024-07-17T12:46:50.000Z","size":1097,"stargazers_count":1332,"open_issues_count":48,"forks_count":619,"subscribers_count":53,"default_branch":"main","last_synced_at":"2025-09-28T21:02:57.494Z","etag":null,"topics":["api","baileys","baileys-rest","express","expressjs","hacktoberfest","node","nodejs","nodejs-bot","nodejs-wrapper","rest-api","restful","whatsapp","whatsapp-api","whatsapp-bot","whatsapp-rest","whatsapp-web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salman0ansari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"salman0ansari","custom":"https://www.buymeacoffee.com/salman0ansari"}},"created_at":"2021-07-29T15:00:56.000Z","updated_at":"2025-09-17T21:30:58.000Z","dependencies_parsed_at":"2025-01-19T20:42:49.797Z","dependency_job_id":null,"html_url":"https://github.com/salman0ansari/whatsapp-api-nodejs","commit_stats":{"total_commits":338,"total_committers":23,"mean_commits":"14.695652173913043","dds":"0.41124260355029585","last_synced_commit":"b6d23a18be15b0b3577cc88152c7b2bc9df59582"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/salman0ansari/whatsapp-api-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salman0ansari%2Fwhatsapp-api-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salman0ansari%2Fwhatsapp-api-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salman0ansari%2Fwhatsapp-api-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salman0ansari%2Fwhatsapp-api-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salman0ansari","download_url":"https://codeload.github.com/salman0ansari/whatsapp-api-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salman0ansari%2Fwhatsapp-api-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277626820,"owners_count":25849786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","baileys","baileys-rest","express","expressjs","hacktoberfest","node","nodejs","nodejs-bot","nodejs-wrapper","rest-api","restful","whatsapp","whatsapp-api","whatsapp-bot","whatsapp-rest","whatsapp-web"],"created_at":"2024-09-26T18:22:37.956Z","updated_at":"2025-09-30T03:31:30.591Z","avatar_url":"https://github.com/salman0ansari.png","language":"JavaScript","funding_links":["https://github.com/sponsors/salman0ansari","https://www.buymeacoffee.com/salman0ansari"],"categories":[],"sub_categories":[],"readme":"# Archive Notice 🔒\nAfter three years, I've decided to archive this open-source WhatsApp API project. Your support and contributions have been incredible!\n\nWhile I'm no longer actively maintaining this project, I've been working on something new and exciting. It's not open-source, but it's a powerful API that provides advanced features for those who need them. If you're interested in exploring this, feel free to reach out for more information.\n\nThank you once again for being a part of this journey. Keep building amazing things with technology!\n\nBest regards,\n\n@salman0ansari \n- mailto:salman0ansariii@gmail.com\n- https://telegram.dog/salman0ansari\n\n\n\n\n\n\u003ch1 align=\"center\"\u003e whatsapp-api-nodejs Multi Device\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\n\u003ca href=\"#\"\u003e\u003cimg title=\"skynet\" src=\"https://img.shields.io/badge/whatsapp api nodejs Multi Device-black?style=for-the-badge\" alt=\"\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"https://github.com/salman0ansari\"\u003e\u003cimg title=\"Author\" src=\"https://img.shields.io/badge/Author-Mohd Salman Ansari-black.svg?style=for-the-badge\u0026logo=github\" alt=\"\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003ca href=\"https://github.com/salman0ansari?tab=followers\"\u003e\u003cimg title=\"Followers\" src=\"https://img.shields.io/github/followers/salman0ansari?color=black\u0026style=flat-square\" alt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/salman0ansari/whatsapp-api-nodejs/stargazers\"\u003e\u003cimg title=\"Stars\" src=\"https://img.shields.io/github/stars/salman0ansari/whatsapp-api-nodejs?color=black\u0026style=flat-square\" alt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/salman0ansari/whatsapp-api-nodejs/network/members\"\u003e\u003cimg title=\"Forks\" src=\"https://img.shields.io/github/forks/salman0ansari/whatsapp-api-nodejs?color=black\u0026style=flat-square\" alt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/salman0ansari/whatsapp-api-nodejs/issues\"\u003e\u003cimg title=\"Issues\" src=\"https://img.shields.io/github/issues/salman0ansari/whatsapp-api-nodejs?color=black\u0026style=flat-square\" alt=\"\"\u003e\u003c/a\u003e\n\u003cp\u003e\n\n\u003ca href=\"http://github.com/salman0ansari/whatsapp-api-nodejs\"\u003e\u003cimg title=\"Hits\" src=\"http://hits.dwyl.com/salman0ansari/whatsapp-api-nodejs.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003ca href=\"https://t.me/salman0ansari\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Telegram-informational?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\" alt=\"Telegram Badge\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://join.skype.com/invite/rI5pLf9YIvTA\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Skype-00AFF0.svg?style=for-the-badge\u0026logo=Skype\u0026logoColor=white\" alt=\"Skype Badge\"/\u003e\n\u003c/a\u003e\n\u003cbr\u003e\n\n\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\nAn implementation of [Baileys](https://github.com/WhiskeySockets/Baileys) as a simple RESTful API service with multi device support just `download`, `install`, and `start` using, `simple` as that.\n\n# Libraries Used\n\n-   [Baileys](https://github.com/WhiskeySockets/Baileys)\n-   [Express](https://github.com/expressjs/express)\n\n# Installation\n\n1. Download or clone this repo.\n2. Enter to the project directory.\n3. Execute `yarn install` to install the dependencies.\n4. Copy `.env.example` to `.env` and set the environment variables.\n\n# Docker Compose\n\n1. Follow the [Installation](#installation) procedure.\n2. Update `.env` and set\n\n```\nMONGODB_ENABLED=true\nMONGODB_URL=mongodb://mongodb:27017/whatsapp_api\n```\n\n3. Set your `TOKEN=` to a random string.\n4. Execute\n\n```\ndocker-compose up -d\n```\n\n# Configuration\n\nEdit environment variables on `.env`\n\n```a\nImportant: You must set TOKEN= to a random string to protect the route.\n```\n\n```env\n# ==================================\n# SECURITY CONFIGURATION\n# ==================================\nTOKEN=RANDOM_STRING_HERE\n```\n\n# Usage\n\n1. `DEVELOPMENT:` Execute `yarn dev`\n2. `PRODUCTION:` Execute `yarn start`\n\n## Generate basic instance using random key.\n\nTo generate an Instance Key  \nUsing the route:\n\n```bash\ncurl --location --request GET 'localhost:3333/instance/init' \\\n--data-raw ''\n```\n\nResponse:\n\n```json\n{\n    \"error\": false,\n    \"message\": \"Initializing successfull\",\n    \"key\": \"d7e2abff-3ac8-44a9-a738-1b28e0fca8a5\"\n}\n```\n\n## WEBHOOK_ALLOWED_EVENTS\n\nYou can set which events you want to send to webhook by setting the environment variable `WEBHOOK_ALLOWED_EVENTS`\n\nSet a comma seperated list of events you want to get notified about.\n\nDefault value is `all` which will forward all events.\n\nAllowed values:\n\n-   `connection` - receive all connection events\n-   `connection:open` - receive open connection events\n-   `connection:close` - receive close connection events\n-   `presense` - receive presence events\n-   `messages` - receive all messages event\n-   `call` - receive all events related to calls\n-   `call:terminate` - receive call terminate events\n-   `call:offer` - receive call terminate event\n-   `groups` - receive all events related to groups\n-   `group_participants` - receive all events related to group participants\n\nYou can also use the Baileys event format example: `messages.upsert`\n\n## Generate custom instance with custom key and custom webhook.\n\nTo generate a Custom Instance  \nUsing the route:\n\n```bash\ncurl --location --request GET 'localhost:3333/instance/init?key=CUSTOM_INSTANCE_KEY_HERE\u0026webhook=true\u0026webhookUrl=https://webhook.site/d7114704-97f6-4562-9a47-dcf66b07266d' \\\n--data-raw ''\n```\n\nResponse:\n\n```json\n{\n    \"error\": false,\n    \"message\": \"Initializing successfull\",\n    \"key\": \"CUSTOM_INSTANCE_KEY_HERE\"\n}\n```\n\n# Using Key\n\nSave the value of the `key` from response. Then use this value to call all the routes.\n\n## Postman Docs\n\nAll routes are available as a postman collection.\n\n-   https://documenter.getpostman.com/view/12514774/UVsPQkBq\n\n## QR Code\n\nVisit [http://localhost:3333/instance/qr?key=INSTANCE_KEY_HERE](http://localhost:3333/instance/qr?key=INSTANCE_KEY_HERE) to view the QR Code and scan with your device. If you take too long to scan the QR Code, you will have to refresh the page.\n\n## Send Message\n\n```sh\n# /message/text?key=INSTANCE_KEY_HERE\u0026id=PHONE-NUMBER-WITH-COUNTRY-CODE\u0026message=MESSAGE\n\ncurl --location --request POST 'localhost:3333/message/text?key=INSTANCE_KEY_HERE' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'id=919999999999' \\\n--data-urlencode 'message=Hello World'\n```\n\n## Routes\n\n| Route                | Source File                                                                                                          |\n| -------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| Instance Routes      | [instance.route.js](https://github.com/salman0ansari/whatsapp-api-nodejs/blob/main/src/api/routes/instance.route.js) |\n| Message Routes       | [message.route.js](https://github.com/salman0ansari/whatsapp-api-nodejs/blob/main/src/api/routes/message.route.js)   |\n| Group Routes         | [group.route.js](https://github.com/salman0ansari/whatsapp-api-nodejs/blob/main/src/api/routes/group.route.js)       |\n| Miscellaneous Routes | [misc.route.js](https://github.com/salman0ansari/whatsapp-api-nodejs/blob/main/src/api/routes/misc.route.js)         |\n\nSee all routes here [src/api/routes](https://github.com/salman0ansari/whatsapp-api-nodejs/tree/main/src/api/routes)\n\n# Note\n\nI can't guarantee or can be held responsible if you get blocked or banned by using this software. WhatsApp does not allow bots using unofficial methods on their platform, so this shouldn't be considered totally safe.\n\n# Legal\n\n-   This code is in no way affiliated, authorized, maintained, sponsored or endorsed by WA (WhatsApp) or any of its affiliates or subsidiaries.\n-   The official WhatsApp website can be found at https://whatsapp.com. \"WhatsApp\" as well as related names, marks, emblems and images are registered trademarks of their respective owners.\n-   This is an independent and unofficial software Use at your own risk.\n-   Do not spam people with this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalman0ansari%2Fwhatsapp-api-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalman0ansari%2Fwhatsapp-api-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalman0ansari%2Fwhatsapp-api-nodejs/lists"}