{
  "openapi": "3.1.0",
  "info": {
    "title": "Country Flags API",
    "version": "1.0.0",
    "description": "ISO 3166 codes, localized country names, flag emoji and SVG flag URLs for every country.\n\nFlags and identity data for every country: ISO 3166-1 codes (alpha-2, alpha-3, numeric), localized country name, the flag emoji, and an SVG flag image URL. Filter by region and localize names with a single query param.",
    "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/country-flags.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/country-flags"
  },
  "servers": [
    {
      "url": "https://api-country-flags.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Data",
      "description": "Country Flags API belongs to the Data category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/flags/{code}": {
      "get": {
        "operationId": "getFlagByCode",
        "summary": "Get Flag By Code",
        "description": "Get Flag By Code endpoint of the Country Flags API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/country-flags/get-flag-by-code"
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "US"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "fr"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "name": "United States",
                  "code": "US",
                  "alpha3": "USA",
                  "numeric": "840",
                  "region": "Americas",
                  "emoji": "🇺🇸",
                  "flag_svg": "https://dataandapis.com/flags/us.svg"
                }
              }
            }
          },
          "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": []
          }
        ]
      }
    },
    "/v1/flags": {
      "get": {
        "operationId": "listFlags",
        "summary": "List Flags",
        "description": "List Flags endpoint of the Country Flags API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/country-flags/list-flags"
        },
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "en"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Europe"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "count": 250,
                  "countries": [
                    {
                      "name": "United States",
                      "code": "US",
                      "alpha3": "USA",
                      "numeric": "840",
                      "region": "Americas",
                      "emoji": "🇺🇸",
                      "flag_svg": "https://dataandapis.com/flags/us.svg"
                    },
                    {
                      "name": "United Kingdom",
                      "code": "GB",
                      "alpha3": "GBR",
                      "numeric": "826",
                      "region": "Europe",
                      "emoji": "🇬🇧",
                      "flag_svg": "https://dataandapis.com/flags/gb.svg"
                    }
                  ]
                }
              }
            }
          },
          "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": []
    }
  ]
}