DEV Community

Cover image for Source code of the WhatsApp Number Checker
WhatsApp API for developers
WhatsApp API for developers

Posted on • Edited on

Source code of the WhatsApp Number Checker

Check if a number is on WhatsApp

UPD November 10, 2024

Important Update! 🚀

We’ve listened to your feedback and expanded our offerings to make WhatsApp number checking even easier. Now you can:

  • Use our open API for seamless bulk checks.
  • Try our no-code tool with a simple, user-friendly interface to check numbers from a .csv file — no programming required.
  • Let us handle it for you! Send us your database of numbers, and we’ll quickly return a filtered list. It’s fast, hassle-free, and cost-effective. Plus, we guarantee complete confidentiality! đź“– Learn more about these options in our latest Medium article: Read here

Determine which phone numbers are active and which cannot receive Whatsapp messages. The phone user will not know about it!

This tool was created using our public API that you can access too with your Whapi.Cloud account.

  • Clear your database of unnecessary numbers.
  • Optimize your resources and save time and money.
  • Integrate into your application or program.

GitHub

How to use

  1. Make sure you have Node.js installed.
  2. Clone the repository or download the source files of the script: https://github.com/Whapi-Cloud/whatsapp-checker

Customization

  1. open the phones.json file.
  2. In the check_phones array, add the phone numbers you want to check. For example: { "check_phones: [ "number1", "number2".] }

Requirements
This tool was created using our public API that you can access too with your Whapi.Cloud account. It takes 3 steps to get started to use WhatsApp API with Whapi.Cloud. You will need a phone with WhatsApp Business or regular WhatsApp. Access is granted for 5 days free of charge. Pair your number via QR code in your account.

In the file checker_data.json you need to insert the token from your personal account Whapi.Cloud, as well as the number you want to check. It also shows the limits we recommend to use. daily_limit is how many checks are left, and refreshed_limit is how much of the limit is set on refresh.

Running the script
Open a terminal or command prompt in the folder with the script. Run the following commands to install the necessary dependencies and compile the script: npm i npx tsc

Run the script with the command: node checker.js

Getting Started
Help to get started with API

How to Connect to Whapi.Cloud
Registration. The first step is to register on the Whapi.Cloud website and create an account. It's free and doesn't require you to enter a credit card. After registration you will immediately have access to a test channel with a small limitation. Wait for it to start (it usually takes about a minute). You will need to connect any phone for Whatsapp automation.

To connect your phone, use the QR code available when you click on your trial channel in your personal account. Then open WhatsApp on your mobile device, go to Settings -> Connected devices -> Connect device -> Scan QR code.

In the second and third steps, the service will ask you to customize the channel: write its name for your convenience, set webhooks, change settings. All these steps can be skipped, and we will come back to webhooks a little later. After launching, you will find in the center block under the information about limits, your API KEY, that is Token.
This token will be used to authenticate your API requests. Generally, it's added to the request headers as a Bearer Token or simply as a request parameter, depending on the API method you're using.

Image description

Happy coding! If you have any questions, feel free to write :)

Top comments (2)

Collapse
 
whapicloud profile image
WhatsApp API for developers

Made by developers for developers <3
WhatsApp API Platform

For DEV Community members we will be ready to make a discount :)
While we are developing a system of promo codes, but if someone is interested, just write in the support chat that you are from here (dev.to) and you will get a 20% discount on the first payment

Collapse
 
whapicloud profile image
WhatsApp API for developers

Hello! We have updated the information in the article: now besides api, it is possible to use interface no-code tool and order us to check your base number.