DEV Community

Cover image for Introducing WhatsUsernames.link: The Free Developer API & Privacy-First WhatsApp Username Link Generator
Ruben
Ruben

Posted on • Originally published at whatsusernames.link

Introducing WhatsUsernames.link: The Free Developer API & Privacy-First WhatsApp Username Link Generator

πŸš€ The WhatsApp @Username Era & The Developer Gap

With WhatsApp rolling out @Usernames worldwide, sharing your contact without broadcasting your private phone number is finally a reality. However, for web developers, marketers, and SaaS builders, turning a WhatsApp username into a clean, clickable, shareable linkβ€”or generating instant QR codes for print and webβ€”has remained surprisingly fragmented.

Enter WhatsUsernames.link: a free, stateless web tool and public REST API designed to generate WhatsApp username links, phone click-to-chat URLs, and dynamic vector/PNG QR codes in milliseconds.


✨ Why WhatsUsernames.link?

  • πŸ”’ 100% Stateless & Privacy-First: Zero databases storing usernames, phone numbers, or messages. Everything processes in-memory or directly in browser.
  • ⚑ Sub-Second Performance: Powered by Next.js 15, Turbopack, and Edge API routes.
  • 🎨 Multi-Format QR Codes: Downloadable vector SVG, PNG, JPEG, or PDF QR codes with custom styling.
  • 🌐 Global i18n & GEO Optimization: Full multi-language support (English, Portuguese, Spanish).
  • πŸ› οΈ Developer-First REST API: Free CORS-enabled endpoints with zero API keys required.

πŸ› οΈ How Developers Can Use the API

Whether you are building an e-commerce checkout, a CRM integration, or a digital business card app, you can use our public REST API directly from your client or server applications.

1. Generate a WhatsApp Username Link

curl -X GET "https://whatsusernames.link/api/v1/username-link?username=john.doe&key=4821&text=Hello%20John"
Enter fullscreen mode Exit fullscreen mode

JSON Response:

{
  "username": "john.doe",
  "key": "4821",
  "link": "https://wa.me/john.doe?text=Hello%20John",
  "shortLink": "https://whatsusernames.link/john.doe",
  "notice": "Phased regional rollout verification notice"
}
Enter fullscreen mode Exit fullscreen mode

2. Generate a Phone Click-to-Chat Link

curl -X GET "https://whatsusernames.link/api/v1/phone-link?phone=14155552671&text=Interested%20in%20your%20product"
Enter fullscreen mode Exit fullscreen mode

JSON Response:

{
  "phone": "14155552671",
  "link": "https://wa.me/14155552671?text=Interested%20in%20your%20product"
}
Enter fullscreen mode Exit fullscreen mode

3. Generate Dynamic Vector SVG or High-Res PNG QR Codes

# Get an SVG QR code with custom brand colors
curl -X GET "https://whatsusernames.link/api/v1/qr?username=john.doe&format=svg&color=25d366"
Enter fullscreen mode Exit fullscreen mode

πŸ’» Code Snippet: JavaScript / TypeScript Integration

async function getWhatsAppLink(phone: string, message: string) {
  const response = await fetch(
    `https://whatsusernames.link/api/v1/phone-link?phone=${encodeURIComponent(phone)}&text=${encodeURIComponent(message)}`
  );

  if (!response.ok) throw new Error("Failed to generate WhatsApp link");
  const data = await response.json();
  return data.link; // Returns "https://wa.me/..."
}

// Example usage:
getWhatsAppLink("351912345678", "Hello from DEV.to!")
  .then((link) => console.log("Generated WhatsApp Link:", link));
Enter fullscreen mode Exit fullscreen mode

πŸ”’ Privacy & Architecture Protocol

Unlike traditional link shorteners that track users, capture IP logs, or redirect through intermediate ad portals, WhatsUsernames.link enforces strict privacy principles:

  1. Zero Tracking Headers: referrer-policy: strict-origin-when-cross-origin and strict CSP security headers.
  2. Stateless Edge Execution: Requests are evaluated in-memory without persistent user tracking.
  3. Open OpenAPI Specs: Fully documented OpenAPI 3.0 schema available at /api/v1/openapi.json.

πŸ”— Try It Out & Explore

Feel free to test out the endpoints, integrate them into your apps, or share your feedback in the comments below! πŸš€

Top comments (0)