WhatsAppNumberChecker 1.0.1
dotnet add package WhatsAppNumberChecker --version 1.0.1
NuGet\Install-Package WhatsAppNumberChecker -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WhatsAppNumberChecker" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WhatsAppNumberChecker" Version="1.0.1" />
<PackageReference Include="WhatsAppNumberChecker" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WhatsAppNumberChecker --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WhatsAppNumberChecker, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WhatsAppNumberChecker@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WhatsAppNumberChecker&version=1.0.1
#tool nuget:?package=WhatsAppNumberChecker&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WhatsAppNumberChecker
A high-performance, in-process .NET Standard 2.0 / .NET 8.0 library for verifying whether phone numbers have active, registered WhatsApp accounts.
Rate Limits, Anti-Ban & Terms of Service Notice
- Unofficial Integration: This library interacts with the WhatsApp Web interface. It is not endorsed by or affiliated with Meta Platforms, Inc. or WhatsApp LLC.
- Terms of Service: Automated bulk phone number enumeration or sending unsolicited messages violates the WhatsApp Terms of Service.
- Account Risk: Rapid or concurrent verification of phone numbers can result in temporary or permanent WhatsApp account restrictions.
- Operational Guidelines:
- Always use the built-in batch throttling delays (recommended: 750ms to 1500ms between lookups).
- Keep jitter enabled so request intervals simulate natural human behavior.
- Use a dedicated WhatsApp account for lookup operations.
- Avoid validating thousands of phone numbers in rapid bursts.
Architecture and Features
- In-Process Execution: Runs directly within your .NET process. No Docker containers or external sidecars required.
- Session Persistence: Preserves paired session credentials across application restarts in the configured storage directory.
- Automatic Recovery: Cleans stale lock files and recovers orphan processes on unexpected terminations.
- Anti-Ban Batch Throttling: Sequential batch processor with configurable delays, random jitter, and live progress reporting.
- Dependency Injection: First-class integration via
services.AddWhatsAppChecker().
+----------------------------------------------------------+
| .NET Application |
| (ASP.NET Core / Worker / Console / .NET Framework 4.6+) |
+----------------------------+-----------------------------+
|
+---------------------------+-----------------------------+
| WhatsAppNumberChecker (.NET Engine) |
| |
| |-- In-Process Browser Runtime |
| |-- Dynamic QR Code Scanner and Renderer |
| |-- Native Contact Verification Pipeline |
| |-- Persistent Authentication Store |
| `-- Anti-Ban Batch Rate Limiter and Progress Reporter |
+---------------------------+-----------------------------+
|
v
+---------------------------------------------------------+
| Official WhatsApp Network |
+---------------------------------------------------------+
Installation
Install the package via the .NET CLI:
dotnet add package WhatsAppNumberChecker
Or via the Package Manager Console in Visual Studio:
Install-Package WhatsAppNumberChecker
Quick Start
1. In-Process Console Example
using System;
using System.Threading.Tasks;
using WhatsAppNumberChecker.Auth;
using WhatsAppNumberChecker.Internal;
using WhatsAppNumberChecker.Options;
class Program
{
static async Task Main(string[] args)
{
// 1. Initialize in-process engine
var checker = new WhatsAppCheckerEngine(new WhatsAppCheckerOptions
{
AuthDirectory = "./whatsapp_session" // Persists session to disk
});
// 2. Listen for QR Code on first-time login
checker.QrCodeReceived += (sender, qrCodeString) =>
{
QrCodeRenderer.RenderToConsole(qrCodeString);
};
// 3. Connect to WhatsApp Web
Console.WriteLine("Connecting to WhatsApp...");
await checker.ConnectAsync();
// 4. Verify a phone number
var result = await checker.CheckNumberAsync("+1 (555) 123-4567");
Console.WriteLine($"Number: {result.NormalizedNumber}");
Console.WriteLine($"Exists: {result.Exists}");
Console.WriteLine($"JID: {result.Jid}");
}
}
2. Dependency Injection Setup (ASP.NET Core / Generic Host)
In your Program.cs:
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
// Register WhatsApp Number Checker
builder.Services.AddWhatsAppChecker(options =>
{
options.AuthDirectory = "./whatsapp_session";
options.DefaultBatchDelay = TimeSpan.FromMilliseconds(750);
options.ConnectTimeout = TimeSpan.FromSeconds(30);
options.Headless = true;
});
var app = builder.Build();
3. Checking Single Numbers
public class UserVerificationService
{
private readonly IWhatsAppChecker _whatsAppChecker;
private readonly ILogger<UserVerificationService> _logger;
public UserVerificationService(IWhatsAppChecker whatsAppChecker, ILogger<UserVerificationService> logger)
{
_whatsAppChecker = whatsAppChecker;
_logger = logger;
}
public async Task<bool> IsUserOnWhatsAppAsync(string rawPhoneNumber)
{
try
{
var result = await _whatsAppChecker.CheckNumberAsync(rawPhoneNumber);
return result.Exists;
}
catch (WhatsAppNotAuthenticatedException)
{
_logger.LogWarning("WhatsApp session requires QR code scan.");
throw;
}
catch (WhatsAppCheckerException ex)
{
_logger.LogError(ex, "Lookup failed for {Number}", rawPhoneNumber);
throw;
}
}
}
4. Throttled Batch Number Verification with Progress
var numbers = new[]
{
"+15551234567",
"+447911123456",
"+971501234567",
"+33612345678"
};
var progress = new Progress<WhatsAppBatchProgress>(p =>
{
Console.WriteLine($"Progress: {p.Percentage:F1}% ({p.Processed}/{p.Total}) - Latest: {p.LatestResult.NormalizedNumber} -> Active: {p.LatestResult.Exists}");
});
var batchResult = await _whatsAppChecker.CheckBatchAsync(numbers, new WhatsAppBatchOptions
{
DelayBetweenChecks = TimeSpan.FromMilliseconds(750), // Delay between lookups
Jitter = TimeSpan.FromMilliseconds(200), // Random jitter (+/- 200ms)
ContinueOnError = true,
Progress = progress
});
Console.WriteLine($"Checked {batchResult.TotalProcessed} numbers in {batchResult.Duration.TotalSeconds:F2}s.");
Console.WriteLine($"Active WhatsApp accounts found: {batchResult.ExistingCount}");
Session Persistence & Authentication
- On initial startup, the
QrCodeReceivedevent is raised with the pairing string. - Scan the rendered QR code with your mobile app (Settings > Linked Devices > Link a Device).
- Session state is saved to
options.AuthDirectory(./whatsapp_session). - Subsequent application runs automatically resume the active session without prompting for a QR scan.
Exception Handling Reference
All library exceptions derive from WhatsAppCheckerException:
| Exception Type | Condition |
|---|---|
WhatsAppNotAuthenticatedException |
Client is not authenticated (QR code scan required). |
WhatsAppConnectionException |
Connection error or browser launch failure. |
WhatsAppRateLimitedException |
WhatsApp rate limit triggered. |
WhatsAppValidationException |
Input string fails phone number normalization or E.164 constraints. |
WhatsAppCheckerException |
Base exception for all library errors. |
Testing
Run the automated test suite with the .NET CLI:
dotnet test
Packaging
To create a release NuGet package:
dotnet pack src/WhatsAppNumberChecker/WhatsAppNumberChecker.csproj -c Release -o ./artifacts
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- BouncyCastle.Cryptography (>= 2.4.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- PuppeteerSharp (>= 25.8.0)
- QRCoder (>= 1.6.0)
- System.Text.Json (>= 10.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.