Number Insight Advanced (Synchronous)
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.
This code snippet shows you how to use Number Insight Advanced API synchronously.
Note: Vonage does not recommend this approach, because it can result in timeouts. In most cases, you should use an asynchronous call to the Number Insight API.
Before attempting to run the code examples, replace the variable placeholders:
| Key | Description |
|---|---|
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. |
REAL_TIME_DATA | An optional flag to determine if you want real time data back in the response. |
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named ni-advanced.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
Create a file named AdvancedInsightSync and add the following code to the main method:
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:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.numberinsight with the package containing AdvancedInsightSync:
Prerequisites
Add the following to build.gradle:
Create a file named AdvancedInsight and add the following code to the main method:
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:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.insight with the package containing AdvancedInsight:
Prerequisites
Create a file named AdvancedSync.cs and add the following code:
Add the following to AdvancedSync.cs:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named ni-advanced.rb and add the following code:
Run your code
Save this file to your machine and run it:
The response from the API contains the following data:
For a description of each returned field and to see all possible values, see the Number Insights API documentation