READING Phone Number Validation & Lookup JSON API
On This Page

    Phone Number Validation & Lookup JSON API

    Phone Number Validation & Lookup JSON API

    Managing phone numbers in web and mobile applications is often more complex than it appears. Users frequently enter numbers in different formats, make typing errors, or use invalid and temporary numbers. This can lead to failed SMS deliveries, incorrect user data, increased operational costs, and a higher risk of spam and fraud.

    For businesses that rely on web scraping and automated data validation workflows, such as those built with platforms like ScrapeInsight, ensuring phone number accuracy is critical. Validating phone numbers before storing or using them helps maintain clean databases, improves communication success rates, and reduces security risks.

    What Is NumVerify?

    NumVerify is a phone number validation and lookup API that helps web and application developers verify national and international phone numbers. It provides a simple RESTful API that allows users to validate phone numbers easily and efficiently. NumVerify supports phone numbers from around 232 countries worldwide.

    When a phone number is passed to the API, it is checked in real time and cross-verified against an up-to-date database of international landline and mobile numbers. The API returns a JSON response containing detailed information such as the phone number’s validity, local and international formats, country details, geographical location, carrier information, and line type.

    In short, NumVerify allows developers to retrieve accurate details behind any phone number, identify local-friendly formats, reduce undelivered messages, and protect applications from spam, fake users, and fraud.

    Find Local Format:

    • Systematically find and adapt international phone numbers into an identifiable local format. Numbers can be written in many formats. eg. 66-226636-7436 also can be written as (22)6636-7436 (national format) or +662266367436 (E.164 format).
    • This makes sure that the number chosen will be mostly identified by the locals by looking up the national format.

    Check Number Format:

    To err is human. People are prone to make mistakes, so it is advisable to check and validate every number before entering it into the database. This avoids junk entries and makes our database fully correct.

    Identify Carrier:

    You can identify the carrier behind the phone number. It is very easy to acquire phone numbers from some carriers. Anyone can get multiple phone numbers from a free online provider, enabling them to create fake profiles to defraud or spam a business. So you can make an additional identity check for a carrier associated with higher fraud instances.

    Check Number Type:

    You can check the number type, like whether the number isa landline or a mobile. Some number types don’t accept all communication. For example, VoIP numbers and land-line numbers don’t accept text messages. Based on the number type, you can communicate.

    The API will return the following type of JSON string as output
    {
      "valid": true,
      "number": "14158586273",
      "local_format": "4158586273",
      "international_format": "+14158586273",
      "country_prefix": "+1",
      "country_code": "US",
      "country_name": "United States of America",
      "location": "Novato",
      "carrier": "AT&T Mobility LLC",
      "line_type": "mobile"
    }


    SAMPLE PHP SCRIPT:

    <?php
    // set API Access Key
    $access_key = 'YOUR_ACCESS_KEY';
    
    // set phone number
    $phone_number = '25269697384';
    
    // Initialize CURL:
    $ch = curl_init('http://apilayer.net/api/validate?access_key='.$access_key.'&number='.$phone_number.'');  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    // call the URL and get the response
    $json = curl_exec($ch);
    curl_close($ch);
    
    // Decode JSON response:
    $response = json_decode($json, true);
    
    // print the response
    var_dump($repsone);
    
    // Access and use your preferred validation result properties
    echo $response['valid'];
    echo $response['local_format'];
    echo $response['international_format'];
    
    ?>
    Keval Kothari

    Keval Kothari

    Founder and CEO