Number Insight Standard

Effective February 4, 2027, Vonage will sunset Vonage Number Insights. To ensure uninterrupted support and to provide a more scalable and future-proof solution, we encourage you to migrate to our enhanced offering: Vonage Identity Insights API. The Vonage Identity Insights API consolidates multiple phone number-related datasets into a single, flexible API, allowing you to request real-time information about a phone number and retrieve any combination of insights - such as number formatting, carrier details, SIM Swap and Subscriber Match - in one call.

Please review the Number Insights Transition Guide, which provides detailed guidance on API differences, required changes, and best practices for a smooth transition.

The Number Insight Standard API provides all the information from the Number Insight Basic API together with the following additional data:

  • The line type (mobile/landline/virtual number/premium/toll-free)
  • The Mobile Country Code (MCC) and Mobile Network Code (MNC)
  • The name of the caller (USA only)

Use this information to determine the best type of communication for a number (SMS or voice) and block virtual numbers.

Before attempting to run the code examples, replace the variable placeholders:

KeyDescription
VONAGE_API_KEY

Your Vonage API key (see it on your dashboard).

VONAGE_API_SECRET

Your Vonage API secret (also available on your dashboard).

INSIGHT_NUMBER

The number you want to retrieve insight information for.

Write the code

Add the following to ni-standard.sh:

curl \
  -u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}" \
  "https://api.nexmo.com/ni/standard/json?number=$INSIGHT_NUMBER"

View full source

Run your code

Save this file to your machine and run it:

sh ni-standard.sh

Prerequisites

npm install @vonage/server-sdk

Create a file named ni-standard.js and add the following code:

const { Vonage } = require('@vonage/server-sdk');

const vonage = new Vonage({
  apiKey: VONAGE_API_KEY,
  apiSecret: VONAGE_API_SECRET,
});

View full source

Write the code

Add the following to ni-standard.js:

vonage.numberInsights.standardLookup(INSIGHT_NUMBER)
  .then((result) => console.log(result))
  .catch((error) => console.error(error));

View full source

Run your code

Save this file to your machine and run it:

node ni-standard.js

Prerequisites

Add the following to build.gradle:

implementation 'com.vonage:server-sdk-kotlin:2.1.1'

Create a file named StandardInsight and add the following code to the main method:

val client = Vonage {
    apiKey(VONAGE_API_KEY)
    apiSecret(VONAGE_API_SECRET)
}

View full source

Write the code

Add the following to the main method of the StandardInsight file:

val response = client.numberInsight.standard(INSIGHT_NUMBER)
println(response)

View full source

Run your code

We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:

apply plugin: 'application'
mainClassName = project.hasProperty('main') ? project.getProperty('main') : ''

Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.numberinsight with the package containing StandardInsight:

gradle run -Pmain=com.vonage.quickstart.kt.numberinsight.StandardInsight

Prerequisites

Add the following to build.gradle:

implementation 'com.vonage:server-sdk:9.3.1'

Create a file named StandardInsight and add the following code to the main method:

VonageClient client = VonageClient.builder()
        .apiKey(VONAGE_API_KEY)
        .apiSecret(VONAGE_API_SECRET)
        .build();

View full source

Write the code

Add the following to the main method of the StandardInsight file:

StandardInsightResponse response = client.getInsightClient().getStandardNumberInsight(INSIGHT_NUMBER);

System.out.println("BASIC INFO:");
System.out.println("International format: " + response.getInternationalFormatNumber());
System.out.println("National format: " + response.getNationalFormatNumber());
System.out.println("Country: " + response.getCountryName() +
        " (" + response.getCountryCodeIso3() + ", +" + response.getCountryPrefix() + ")"
);

System.out.println();
System.out.println("CARRIER INFO:");
System.out.println("Current carrier: " + response.getCurrentCarrier().getName());
System.out.println("Original carrier: " + response.getOriginalCarrier().getName());

View full source

Run your code

We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:

apply plugin: 'application'
mainClassName = project.hasProperty('main') ? project.getProperty('main') : ''

Run the following gradle command to execute your application, replacing com.vonage.quickstart.insight with the package containing StandardInsight:

gradle run -Pmain=com.vonage.quickstart.insight.StandardInsight

Prerequisites

Install-Package Vonage

Create a file named StandardInsights.cs and add the following code:

using Vonage;
using Vonage.NumberInsights;
using Vonage.Request;

View full source

Add the following to StandardInsights.cs:


var creds = Credentials.FromApiKeyAndSecret(VONAGE_API_KEY, VONAGE_API_SECRET);

View full source

Write the code

Add the following to StandardInsights.cs:


var request = new StandardNumberInsightRequest() { Number = INSIGHT_NUMBER};

View full source

Prerequisites

composer require vonage/client

Write the code

Add the following to standard.php:

$basic  = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
$client = new \Vonage\Client($basic);

$insights = $client->insights()->standard(INSIGHT_NUMBER);

View full source

Run your code

Save this file to your machine and run it:

php standard.php

Prerequisites

pip install vonage python-dotenv

Write the code

Add the following to ni-standard.py:

from vonage import Auth, Vonage
from vonage_number_insight import (StandardInsightRequest,
                                   StandardInsightResponse)

client = Vonage(Auth(api_key=VONAGE_API_KEY, api_secret=VONAGE_API_SECRET))

insight: StandardInsightResponse = client.number_insight.get_standard_info(
    StandardInsightRequest(number=INSIGHT_NUMBER)
)
pprint(insight)

View full source

Run your code

Save this file to your machine and run it:

python number-insight/ni-standard.py

Prerequisites

gem install vonage

Create a file named ni-standard.rb and add the following code:

client = Vonage::Client.new(
  api_key: VONAGE_API_KEY,
  api_secret: VONAGE_API_SECRET
)

View full source

Write the code

Add the following to ni-standard.rb:

insight = client.number_insight.standard(
  number: INSIGHT_NUMBER
)

puts insight.inspect

View full source

Run your code

Save this file to your machine and run it:

ruby ni-standard.rb

The response from the API contains the following data:

{
    "status": 0,
    "status_message": "Success",
    "request_id": "e98e0dfb-c485-491b-8d2a-283f35e21d04",
    "international_format_number": "447700900000",
    "national_format_number": "07700 900000",
    "country_code": "GB",
    "country_code_iso3": "GBR",
    "country_name": "United Kingdom",
    "country_prefix": "44",
    "request_price": "0.00500000",
    "remaining_balance": "10.000000",
    "current_carrier": {
        "network_code": "23420",
        "name": "Hutchison 3G Ltd",
        "country": "GB",
        "network_type": "mobile"
    },
    "original_carrier": {
        "network_code": "23410",
        "name": "Telefonica UK Limited",
        "country": "GB",
        "network_type": "mobile"
    },
    "ported": "assumed_ported",
    "roaming": { "status": "unknown" }
}

For a description of each returned field and to see all possible values, see the Number Insights API documentation