{
  "openapi": "3.1.0",
  "info": {
    "title": "Phone Number Validation API",
    "version": "1.0.0",
    "description": "Validate, type and format phone numbers for every country in E.164, international and national forms.\n\nValidate and parse phone numbers for every country: validity, country, line type (mobile, fixed line, VoIP), and E.164, international, and national formats. Accepts international input or national format plus a default country.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/phone-validation.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/phone-validation"
  },
  "servers": [
    {
      "url": "https://api-phone-validation.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Tools",
      "description": "Phone Number Validation API belongs to the Tools category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/phone": {
      "get": {
        "operationId": "validatePhone",
        "summary": "Validate Phone",
        "description": "Validate Phone endpoint of the Phone Number Validation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/phone-validation/validate-phone"
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "US"
          },
          {
            "name": "number",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "+14155552671"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "input": "+14155552671",
                  "valid": true,
                  "possible": true,
                  "country": "US",
                  "country_calling_code": "+1",
                  "type": "FIXED_LINE_OR_MOBILE",
                  "e164": "+14155552671",
                  "international": "+1 415 555 2671",
                  "national": "(415) 555-2671",
                  "uri": "tel:+14155552671"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}