api-ninjas-com Validate Phone API

The Validate Phone API allows you to check whether a given phone number is valid and return its metadata.

Operations 1

GET /v1/validatephone Validate a phone number and get its metadata #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-validate-phone-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-validate-phone-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Validate Phone API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Validate Phone
  description: The Validate Phone API allows you to check whether a given phone number is valid and return its metadata.
paths:
  /v1/validatephone:
    get:
      tags:
      - Validate Phone
      summary: Validate a phone number and get its metadata
      description: Validates a phone `number` and returns its normalised format, country and location. For carrier and line type use /phonelookup.
      operationId: validatePhone
      parameters:
      - $ref: '#/components/parameters/ValidatePhoneOpenapi_number'
      - $ref: '#/components/parameters/ValidatePhoneOpenapi_country'
      responses:
        '200':
          description: Successful response with phone number metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidatePhoneResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidatePhoneOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidatePhoneOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidatePhoneOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
components:
  schemas:
    ValidatePhoneOpenapi_ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the failure.
    ValidatePhoneResponse:
      type: object
      properties:
        is_valid:
          type: boolean
          description: Indicates if the phone number is valid.
        is_formatted_properly:
          type: boolean
          description: Indicates if the phone number is formatted properly.
        country:
          type: string
          description: The country where the phone number is registered.
        location:
          type: string
          description: The specific location within the country.
        timezones:
          type: array
          items:
            type: string
          description: List of timezones applicable to the phone number.
        format_national:
          type: string
          description: The phone number formatted in national style.
        format_international:
          type: string
          description: The phone number formatted in international style.
        format_e164:
          type: string
          description: The phone number formatted according to E164 standard.
        country_code:
          type: integer
          description: The international country code of the phone number.
        line_type:
          type: string
          description: 'Line type of the number: mobile, landline, voip, toll_free, fixed_line_or_mobile, premium_rate, shared_cost, personal_number, pager, uan, voicemail, or unknown.'
        is_mobile:
          type: boolean
          description: Whether the number is a mobile (or fixed-line-or-mobile) number.
        format_rfc3966:
          type: string
          description: 'The phone number formatted as an RFC3966 tel: URI.'
        is_possible:
          type: boolean
          description: Whether the number is a possible number (valid length/pattern), even if not confirmed valid.
  parameters:
    ValidatePhoneOpenapi_number:
      name: number
      in: query
      description: Phone number to check. The leading '+' is optional. If country is not set, include the country code (e.g. 12065550100 or +12065550100).
      required: true
      schema:
        type: string
    ValidatePhoneOpenapi_country:
      name: country
      in: query
      description: 2-letter ISO-3166 country code the phone number belongs to.
      required: false
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api