Country Calling Codes Phone formatting API

The Phone formatting API from Country Calling Codes — 1 operation(s) for phone formatting.

Operations 1

POST /api/phone/format Format a phone number using reviewed country rules #

Documentation

Specifications

Other Resources

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/country-calling-codes-phone-formatting-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

country-calling-codes-phone-formatting-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Country Calling Codes Phone formatting API
  version: 1.4.0
  description: Public read-only API for country calling codes, phone analysis, batch normalization, comparison, dialing guidance, input rules, and calling windows. Requests and responses use JSON. No authentication is required. Numbering metadata and reviewed evidence are distinct; neither establishes subscriber activity, reachability, ownership, or consent.
  contact:
    name: countrycalling.codes
    url: https://www.countrycalling.codes/contact
servers:
- url: https://www.countrycalling.codes
  description: Production
security: []
tags:
- name: Phone formatting
paths:
  /api/phone/format:
    post:
      tags:
      - Phone formatting
      operationId: format_international_phone_number
      summary: Format a phone number using reviewed country rules
      description: Normalizes an international number or converts a national-format number when a supported two-letter country code is supplied. Processing is ephemeral. This is formatting and plausibility guidance, not a live carrier, HLR/HSS, MNP, ownership, reachability, or consent check.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneFormatRequest'
      responses:
        '200':
          description: Formatting or ambiguity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneFormatResponse'
        '400':
          description: Invalid JSON, missing phone number, or unsupported country code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PhoneFormatRequest:
      type: object
      required:
      - phoneNumber
      additionalProperties: false
      properties:
        phoneNumber:
          type: string
          minLength: 1
          maxLength: 64
          description: Number to format. The value is processed ephemerally and is not stored.
          example: (020) 7946 0123
        countryCode:
          type: string
          pattern: ^[A-Za-z]{2}$
          description: Optional ISO 3166-1 alpha-2 context for national-format input.
          example: GB
    ErrorResponse:
      type: object
      required:
      - error
      - documentation
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              example: INVALID_REQUEST
            message:
              type: string
            details:
              type: array
              items:
                type: object
                required:
                - field
                - message
                properties:
                  field:
                    type: string
                  message:
                    type: string
        documentation:
          type: string
          format: uri
    PhoneFormatResponse:
      type: object
      required:
      - meta
      - input
      - result
      - limitations
      properties:
        meta:
          type: object
        input:
          type: object
        result:
          type: object
          required:
          - status
          - original
          - normalizedCharacters
          - extension
          - probableCountry
          - canonicalInternational
          - warnings
          - ambiguity
          properties:
            status:
              type: string
              enum:
              - formatted
              - needs-country
              - ambiguous
              - invalid
            original:
              type: string
            normalizedCharacters:
              type: string
            extension:
              type:
              - string
              - 'null'
            probableCountry:
              type:
              - object
              - 'null'
            canonicalInternational:
              type:
              - string
              - 'null'
            warnings:
              type: array
              items:
                type: string
            ambiguity:
              type:
              - string
              - 'null'
        limitations:
          type: array
          items:
            type: string
externalDocs:
  description: Interactive API and MCP documentation
  url: https://www.countrycalling.codes/developers