{
  "openapi": "3.1.0",
  "info": {
    "title": "Telvio public data API",
    "version": "1.0.0",
    "summary": "International calling rates and dialling reference data, as JSON.",
    "description": "A read-only, keyless, CORS-open API over the two datasets this site publishes: the calling rates the Telvio app charges, and a dialling reference for every country it covers. No authentication, no rate limit beyond ordinary CDN fair use, and the same numbers the human-readable pages render. Reuse is licensed CC BY 4.0 with a link back.",
    "contact": {
      "name": "Telvio support",
      "email": "support@telvio.app",
      "url": "https://telvio.app/contacts/"
    },
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "termsOfService": "https://telvio.app/terms/"
  },
  "servers": [
    {
      "url": "https://telvio.app/api/v1",
      "description": "Static origin behind Cloudflare"
    }
  ],
  "paths": {
    "/rates.json": {
      "get": {
        "operationId": "getRates",
        "summary": "Per-minute calling rates for every destination",
        "description": "Returns every destination with a published rate. `available:false` marks a destination whose historical rate is kept for reference but which the carrier will not connect today.",
        "responses": {
          "200": {
            "description": "The rate sheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateSheet"
                }
              }
            }
          }
        }
      }
    },
    "/countries.json": {
      "get": {
        "operationId": "getCountries",
        "summary": "Dialling reference for every country",
        "responses": {
          "200": {
            "description": "The dialling reference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountryList"
                }
              }
            }
          }
        }
      }
    },
    "/area-codes.json": {
      "get": {
        "operationId": "getAreaCodes",
        "summary": "City and area codes by country",
        "responses": {
          "200": {
            "description": "Area codes",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/status.json": {
      "get": {
        "operationId": "getStatus",
        "summary": "Freshness of the published datasets",
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RateSheet": {
        "type": "object",
        "required": [
          "currency",
          "destinations"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "cheapest_available_usd_per_min": {
            "type": "number"
          },
          "updated": {
            "type": "string",
            "format": "date"
          },
          "destinations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Destination"
            }
          }
        }
      },
      "Destination": {
        "type": "object",
        "required": [
          "country",
          "landline_usd_per_min",
          "mobile_usd_per_min",
          "available"
        ],
        "properties": {
          "country": {
            "type": "string",
            "examples": [
              "India"
            ]
          },
          "iso2": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "IN"
            ]
          },
          "dial_code": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "+91"
            ]
          },
          "landline_usd_per_min": {
            "type": "number",
            "examples": [
              0.06
            ]
          },
          "mobile_usd_per_min": {
            "type": "number",
            "examples": [
              0.06
            ]
          },
          "available": {
            "type": "boolean",
            "description": "False means the carrier will not terminate a call there today."
          },
          "quoted_via": {
            "type": "string",
            "description": "Set when the price comes from a prefix another destination owns."
          },
          "page": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "CountryList": {
        "type": "object",
        "properties": {
          "countries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Country"
            }
          }
        }
      },
      "Country": {
        "type": "object",
        "required": [
          "country",
          "iso2",
          "dial_code",
          "exit_codes"
        ],
        "properties": {
          "country": {
            "type": "string"
          },
          "iso2": {
            "type": "string"
          },
          "dial_code": {
            "type": "string",
            "examples": [
              "+91"
            ]
          },
          "exit_codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What you dial from THIS country to reach abroad.",
            "examples": [
              [
                "00"
              ]
            ]
          },
          "trunk_prefix": {
            "type": "string",
            "description": "Dropped when calling from abroad."
          },
          "example": {
            "type": "string",
            "examples": [
              "+91 98765 43210"
            ]
          },
          "timezone": {
            "type": "string",
            "examples": [
              "Asia/Kolkata"
            ]
          },
          "mobile_prefixes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "landline_prefixes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Human-readable API documentation",
    "url": "https://telvio.app/api/"
  }
}
