Effortlessly capture, verify, and identify phone numbers within your applications, transforming user interactions.

Easily integrate phone number validation into your application

Pass a phone number with a country calling code. For numbers known to be in the North American dialing plan set NA hint to true. The NA hint will assume a country code of '1' and attempt an NA match before matching to any other country.

from pprint import pprint
import requests

phone_number = "254 0753 300401"

url = "https://fonfon-phone-api.phone.rapidapi.com/v1/phone/"

headers = {
  "X-RapidAPI-Key": "test",
  "X-RapidAPI-Host": "fonfon-phone-api.phone.rapidapi.com"
}

response = requests.get(url+phone, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print("Request failed with status code:", response.status_code)

{
  "success": true,
  "message": "phone details located",
  "raw_phone": "254 0753 300400",
  "phone": "2540753300400",
  "e164": "+2540753300400",
  "country_calling_code_data": [
    {
      "alpha2": "KE",
      "alpha3": "KEN",
      "name": "Kenya",
      "calling_code": "254"
    }
  ],
  "na_data": null
}
import requests

url = "https://fonfon-phone-api.p.rapidapi.com/v1/phone/"

phone_number = "(402) 727-0440"

params = {"hint_na":True}

headers = {
  "X-RapidAPI-Key": "test",
  "X-RapidAPI-Host": "fonfon-phone-api.p.rapidapi.com"
}

response = requests.get(url+phone_number, headers=headers,
                        params=params)

if response.status_code == 200:
    print(response.json())
else:
    print("Request failed with status code:", response.status_code)
{
  "success": true,
  "message": "phone details located",
  "raw_phone": "(402) 727-0440",
  "phone": "14027270440",
  "e164": "+14027270440",
  "country_calling_code_data": [
    {
      "alpha2": "US",
      "alpha3": "USA",
      "name": "United States",
      "calling_code": "1"
    }
  ],
  "na_data": {
    "npa": "402",
    "nxx": "727",
    "npanxx": "402-727",
    "type": "General Purpose Code",
    "company": "QWEST CORPORATION",
    "rate_center": "FREMONT",
    "in_service": "Y",
    "time_zone": "Central",
    "state": "Nebraska",
    "country": "United States",
    "alpha2": "US",
    "location": "NE"
  }
}

© 2023 Fonfon