Country.io Phone API

International dialing codes by ISO2 country code.

OpenAPI Specification

country-io-phone-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Country.io Data Capitals Phone API
  description: Country.io publishes a small set of static JSON files that map ISO 3166-1 alpha-2 country codes to common reference data (country names, capital cities, continent codes, ISO 3166-1 alpha-3 codes, telephone dialing codes, and currency codes). Each endpoint returns a flat JSON object keyed by the two-letter country code.
  version: '1.0'
  contact:
    name: Country.io
    url: https://country.io/contact/
  license:
    name: Country.io Data
    url: https://country.io/
servers:
- url: https://country.io
  description: Country.io static JSON host
tags:
- name: Phone
  description: International dialing codes by ISO2 country code.
paths:
  /phone.json:
    get:
      operationId: getPhoneCodes
      summary: Get international dialing codes keyed by ISO2 country code
      tags:
      - Phone
      responses:
        '200':
          description: A JSON object mapping ISO2 country codes to international dialing prefixes.
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                example:
                  US: '1'
                  GB: '44'
                  FR: '33'
externalDocs:
  description: Country.io Data Index
  url: https://country.io/data/