{
  "openapi": "3.1.0",
  "info": {
    "title": "Flagdex Country API",
    "version": "1.0.0",
    "description": "Free, static JSON country data for 250 countries and territories. No API key, no rate limit, no sign up. Data under ODbL 1.0 and CC BY 4.0.",
    "license": {
      "name": "ODbL 1.0",
      "url": "https://opendatacommons.org/licenses/odbl/1-0/"
    },
    "contact": {
      "name": "Flagdex",
      "url": "https://flagdex.net/contact"
    }
  },
  "servers": [
    {
      "url": "https://flagdex.net"
    }
  ],
  "paths": {
    "/api/v1/countries.json": {
      "get": {
        "summary": "Every country and territory, all fields",
        "responses": {
          "200": {
            "description": "Dataset metadata plus the full country array"
          }
        }
      }
    },
    "/api/v1/countries-lite.json": {
      "get": {
        "summary": "Compact array: name, ISO codes, capital, region, flag",
        "responses": {
          "200": {
            "description": "Compact country array"
          }
        }
      }
    },
    "/api/v1/country/{iso2}.json": {
      "get": {
        "summary": "One country by lowercase ISO 3166-1 alpha-2 code",
        "parameters": [
          {
            "name": "iso2",
            "in": "path",
            "required": true,
            "description": "Lowercase ISO 3166-1 alpha-2 code, for example fr",
            "schema": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One country record"
          },
          "404": {
            "description": "No such code"
          }
        }
      }
    },
    "/api/v1/meta.json": {
      "get": {
        "summary": "Dataset vintage, endpoint list, licence and stability policy",
        "responses": {
          "200": {
            "description": "Metadata"
          }
        }
      }
    },
    "/flags/{iso2}.svg": {
      "get": {
        "summary": "Public-domain flag SVG",
        "parameters": [
          {
            "name": "iso2",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SVG image"
          }
        }
      }
    }
  }
}