What number format is acceptable for the Number Insight API? What number format is acceptable for the Number Insight API?

What number format is acceptable for the Number Insight API?

Nexmo Support

Question

How should I format numbers when using the Number Insight API?

Applies To

  • Number Insight API
  • Number Format

Answer

The phone number provided to the Number Insights API can be either in the international format or in a local format, accompanied by a country code (parametrized additionally as "&country=<CC>", where <CC> is the two character country code for the country that the number is from). The API takes care of numbers in different formats, accommodating for symbols such as +, -, (, ), and spaces. Additionally, Number Insights also understands Phonewords so alphanumeric special numbers are also accepted.

Examples of acceptable numbers:

  • number=+99 (999) 999-9999
  • number=+999999999999
  • number=+9999999NEXMO
  • number=9999999999&country=GB
  • number=0999999999&country=GB

If a number is not in any acceptable format, or violates the standard E.164 rules, the API will reject it.