Number Insight Advanced Async

You can use Nexmo's Number Insight Async API to retrieve a user's landline or mobile number, including checking to see that it is registered to an operator. This can help you verify that a phone number is real and give you information on how to format the number.

Number Insight Advanced Async API is an asynchronous web service that returns data to a webhook. For any phone number you can:

  • Retrieve the international and local format.
  • Know the country where the number is registered.
  • Line type detection (mobile/landline/virtual number/premium/toll-free)
  • Detect mobile country code (MCC) and mobile network code (MNC)
  • Detect if number is ported
  • Identify caller name (USA only)
  • Identify network when roaming
  • Confirm user's IP address is in same location as their mobile phone

Users are advised that the Advanced API does not give any information about landlines that is not already given by the Standard API. For number insights about landlines, you should use the Standard API.

curl "https://api.nexmo.com/ni/advanced/async/json?api_key=API_KEY&api_secret=API_SECRET&number=447700900000&callback=CALLBACK_URL"
<?php 
require_once __DIR__ . '/../vendor/autoload.php';

$basic  = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
$client = new \Nexmo\Client($basic);

// Async requests do not return the standard payload. Instead, the information is sent 
// to a webhook at some point in the future
$response = $client->insights()->advancedAsync('447700900000', 'https://example.com/my-webhook');

The API will respond with an acknowledgment of the response:

{
    "request_id": "c510011c-d782-4f49-bfa9-38a2254884e4",
    "number": "447700900000",
    "remaining_balance": "10.000000",
    "request_price": "0.03000000",
    "status": 0
}
<?xml version="1.0" encoding="UTF-8"?>
<lookup>
  <requestId>c510011c-d782-4f49-bfa9-38a2254884e4</requestId>
  <number>447700900000</number>
  <remainingBalance>10.000000</remainingBalance>
  <requestPrice>0.03000000</requestPrice>
  <status>0</status>
</lookup>