Introduction

Nexmo is now called Vonage, but there are still references to Nexmo in our URLs, code snippets and message templates.

The Number Insight API provides details about the validity, reachability and roaming status of a phone number, as well as details on how to format the number properly in your application.


API specification

Test the API on SwaggerHub


Base URL

https://api-prd.kpn.com/communication/nexmo/number-insight


Conceptual model

Conceptual model


Definitions

Callback (WebHook)

A Callback or WebHook is an HTTP POST callback implemented by you, that can be called by another system when an event is triggered on that system to notify you. You will need to make the address of your webhook/callback known on the other system to make it work.


API workflow

API workflow


Features and constraints

Features

Feature   Basic   Standard   Advanced
Number format and origin   Y   Y   Y
Number type   N   Y   Y
Carrier and country   N   Y   Y
Ported   N   N   Y
IP match   N   N   Y
Validity   N   N   Y
Reachability   N   N   Y
Roaming status   N   N   Y
Roaming carrier and country   N   N   Y
US number caller name and type   N   Y   Y

Check the legislation in your country to ensure that you are allowed to save user roaming information.

Constraints

  • Only 1 phone number can be checked with each request.
  • Phone numbers are in E.164 format.


Getting started

Make sure you've read Getting Started for more info on how to register your application and start trying out our APIs.

Authentication

The API follows the KPN Store API Authentication Standard to secure the API. It includes the use of OAuth 2.0 client_id and client_secret to receive an access token.

Go to the Authentication tab on top of this page to find out how to:

  • Authenticate to an API using cURL.
  • Authenticate to an API on Swaggerhub.
  • Import Open API Specifications (OAS), also called Swagger files into Postman.


How to...

Use Number Insight Basic

You can use Vonage's Number Insight Basic API to retrieve local and international representations of a phone number by doing semantic checks on the number you submit. This can help you normalize and consistently print numbers in your user interface and give you information to help you decide whether you accept the phone number entered by your user, or ask them to check and correct it.

The Number Insight Basic API is a free synchronous, easy-to-use RESTful web service. For any phone number you can:

  • Retrieve the international and local format.
  • Know the country where the number is registered.

SwaggerHub:

  1. Select POST /{level}.
  2. Click 'Try it out'.
  3. In the drop-down box level, select basic.
  4. In the number field, fill out the phone number.
  5. Click 'Execute'.
  6. Check the response code and message.

Postman:

  1. Select (POST) Number Insight - Basic.
  2. Click the Body section of the request and provide value for the number key.
  3. Click 'Send'.
  4. Check the response code and message.

Use Number Insight Standard

You can use Vonage's Number Insight Standard API to retrieve a user's landline or mobile number, including checking to see if it's 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.

The Number Insight Standard API is a synchronous, easy-to-use RESTful web service. For any phone number you can:

  • Retrieve the international and local format.
  • Know the country where the number is registered.
  • Detect the line type (mobile/landline/virtual number/premium/toll-free).
  • Detect mobile country code (MCC) and mobile network code (MNC).
  • Detect if the number is ported.
  • Identify caller name (USA only).
  • Check if the phone number is reachable.

SwaggerHub:

  1. Select POST /{level}.
  2. Click 'Try it out'.
  3. In the drop-down box level, select standard.
  4. In the number field, fill out the phone number.
  5. Click 'Execute'.
  6. Check the response code and message.

Postman:

  1. Select (POST) Number Insight - Standard.
  2. Click the Body section of the request and provide value for the number key.
  3. Click 'Send'.
  4. Check the response code and message.

Use Number Insight Advanced

You can use Vonage's Number Insight Advanced API to retrieve a user's landline or mobile number, including checking to see if it's 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.

The Number Insight Advanced Async API is a synchronous, easy-to-use RESTful web service. For any phone number you can:

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

Be aware that the Advanced API does not give any information about landlines that have not already been given by the Standard API. For number insights about landlines, you should use the Standard API.

SwaggerHub:

  1. Select POST /{level}.
  2. Click 'Try it out'.
  3. In the drop-down box level, select advanced
  4. In the number field, fill out the phone number.
  5. Click 'Execute'.
  6. Check the response code and message.

Postman:

  1. Select (POST) Number Insight - Advanced.
  2. Click the Body section of the request and provide value for the number key.
  3. Click 'Send'.
  4. Check the response code and message.

Use Number Insight Advanced Async

You can use Vonage's Number Insight Async API to retrieve a user's landline or mobile number, including checking to see if it's 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.

The 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 the number is ported.
  • Identify caller name (USA only).
  • Identify network when roaming.
  • Confirm that user's IP address is in the same location as their mobile phone.

Be aware that the Advanced API does not give any information about landlines that have not already been given by the Standard API. For number insights about landlines, you should use the Standard API.

SwaggerHub:

  1. Select POST /advanced/async.
  2. Click 'Try it out'.
  3. In the number field, fill out the phone number.
  4. In the callback field, provide the URL of your webhook.
  5. Click 'Execute'.
  6. Check the response code and message.

Postman:

  1. Select (POST) Number Insight Advanced - Async.
  2. Click the Body section of the request and provide values for the number and callback key.
  3. Click 'Send'.
  4. Check the response code and message.
^^Response example^^
{
  "status": 0,
  "status_message": "Success",
  "lookup_outcome": 0,
  "lookup_outcome_message": "Success",
  "request_id": "55a7ed8e-ba3f-4730-8b5e-c2e787cbb2b2",
  "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.03000000",
  "remaining_balance": "1.97",
  "current_carrier": {
    "network_code": "23410",
    "name": "Telefonica UK Limited",
    "country": "GB",
    "network_type": "mobile"
  },
  "original_carrier": {
    "network_code": "23410",
    "name": "Telefonica UK Limited",
    "country": "GB",
    "network_type": "mobile"
  },
  "valid_number": "valid",
  "reachable": "reachable",
  "ported": "not_ported",
  "roaming": {
    "status": "not_roaming"
  }
}


Return codes

Code Description
200 Success.
201 Created.
202 Accepted.
302 Found. Link in location header.
400 Bad request.
401 Unauthorized.
403 Forbidden.
404 Not found.
405 Method not allowed.
412 Precondition failed.
429 Too many requests.
500 Internal server error.
502 Bad gateway.
503 Service unavailable.


HTTP response headers

The following tables display the standard response headers that are returned with each API response:

Standard response field name Description
sunset This field will be populated with the deprecation details. By default the value is n/a.
api-version Indicates the API version you have used.
quota-interval Used to specify an integer (for example, 1, 2, 5, 60, and so on) that will be paired with the quota-time-unit you specify (minute, hour, day, week, or month) to determine a time period during which the quota use is calculated.
For example, an interval of 24 with a quota-time-unit of hour means that the quota will be calculated over the course of 24 hours.
quota-limit Number of API calls an user can make within a given time period.
If this limit is exceeded, the user will be throttled and API requests will fail.
quota-reset-UTC All quota times are set to the Coordinated Universal Time (UTC) time zone.
quota-time-unit Used to specify the unit of time applicable to the quota.
For example, an interval of 24 with a quota-time-unit of hour means that the quota will be calculated over the course of 24 hours.
quota-used Number of API calls made within the quota.
strict-transport-security The HTTP Strict-Transport-Security (HSTS) response header lets a web site tell browsers that it should only be accessed using HTTPS, instead of using HTTP. All present and future subdomains will be HTTPS for a maximum of 1 year and access is blocked to pages or sub domains that can only be served over HTTP including HSTS preload lists of web browsers.
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload.
Access control field name Description
access-control-allow-credentials Tells browsers whether to expose the response to frontend JavaScript samp when the request's credentials mode (Request.credentials) is include.
When a request's credentials mode (Request.credentials) is include, browsers will only expose the response to frontend JavaScript samp if the Access-Control-Allow-Credentials value is true. Boolean.
access-control-allow-origin Indicates whether the response can be shared with requesting samp from the given origin.
access-control-allow-headers Used in response to a pre-flight request which includes the Access-Control-Request-Headers to indicate which HTTP headers can be used during the actual request.
access-control-max-age Indicates how long the results of a pre-flight request (that is the information contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers) can be cached.
access-control-allow-methods Indicates which HTTP methods are allowed on a particular endpoint for cross-origin requests.
For example: GET, PUT, POST, DELETE.
content-length The Content-Length entity header indicates the size of the entity-body, in bytes, sent to the recipient.
content-type The Content-Type entity header the client what the content type of the returned content actually is.

Mopinion feedback