Before you Begin

What are Code Snippets?

Code snippets are short pieces of code you can reuse in your own applications. The code snippets use code from example repositories.

Please read this information carefully before attempting to use the code snippets.


  1. Create a Vonage account
  2. Rent a Vonage Number
  3. Install the Vonage Library for your programming language
  4. Set up Ngrok

Other resources:

The following resources will help you use the Number Insight Advanced Async code snippet:

Replaceable variables

Replace the following values in the code snippets with your own details:

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.


The Basic and Standard levels of the Number Insight API are synchronous and do not require webhooks.

The Advanced level of the Number Insight API enables you to optionally deliver an asynchronous POST response to a webhook when the data becomes available.

In the code snippets, the webhook is located at /webhooks/insight. If you are using Ngrok, the webhook you need to configure in your client is of the form Replace demo with the subdomain provided by Ngrok.