DEV Community

gransabi009-source
gransabi009-source

Posted on

How I Built a Phone Validator API for Africa (Where Twilio Fails)

Twilio and NumVerify are great. Until you try to validate an African phone number.

I found this out the hard way. Carrier detection fails. Number formats are wrong. Line types are inaccurate.

So I built my own.

The Problem

Most validation APIs were built for US and European numbers. When you try:

  • Vodacom Mozambique (84, 85)
  • Movitel Mozambique (86, 87)
  • Unitel Angola (923, 925)
  • Safaricom Kenya (71, 72, 79)

They often return wrong carriers or mark valid numbers as invalid.

The Solution

Phone Validator API — built specifically for Africa and Lusophone countries.

Features

  • ✅ 25 countries with full carrier detection
  • ✅ Mobile vs landline vs toll-free
  • ✅ Automatic country detection
  • ✅ E.164 normalization
  • ✅ Free tier available

Supported Countries (25)

Region Countries
Lusophone 🇲🇿 🇦🇴 🇧🇷 🇵🇹 🇨🇻 🇬🇼 🇸🇹 🇹🇱
Africa 🇿🇦 🇳🇬 🇰🇪 🇹🇿 🇬🇭 🇪🇹 🇿🇼 🇿🇲 🇺🇬 🇨🇮 🇸🇳 🇨🇲 🇷🇼 🇪🇬 🇲🇦 🇩🇿
Europe 🇮🇹

👉 Live Demo: Try it here

Top comments (0)