{
  "openapi": "3.1.0",
  "info": {
    "title": "FlyCodes airport and airline code API",
    "version": "1.1",
    "summary": "Free, keyless JSON lookup for IATA and ICAO codes.",
    "description": "Every airport and airline is a static JSON file. No API key, no rate limit, no sign up, CORS open. Data from OurAirports (public domain) and OpenFlights, regenerated on 2026-07-03. Not affiliated with IATA or ICAO.",
    "license": {
      "name": "CC0 1.0 (airports) and ODbL 1.0 (airlines and routes)",
      "url": "https://flycodes.net/data#license"
    },
    "contact": {
      "url": "https://flycodes.net/contact"
    }
  },
  "servers": [
    {
      "url": "https://flycodes.net"
    }
  ],
  "paths": {
    "/api/airport/{iata}.json": {
      "get": {
        "summary": "One airport by IATA code",
        "description": "Uppercase three-letter code. Four codes collide with Windows reserved filenames and take a trailing underscore: AUX_, CON_, NUL_, PRN_.",
        "parameters": [
          {
            "name": "iata",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z0-9]{3}_?$"
            },
            "example": "AMS"
          }
        ],
        "responses": {
          "200": {
            "description": "The airport record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Airport"
                }
              }
            }
          },
          "404": {
            "description": "No airport with that code"
          }
        }
      }
    },
    "/api/airline/{iata}.json": {
      "get": {
        "summary": "One airline by IATA code",
        "parameters": [
          {
            "name": "iata",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z0-9]{2}$"
            },
            "example": "KL"
          }
        ],
        "responses": {
          "200": {
            "description": "The airline record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Airline"
                }
              }
            }
          },
          "404": {
            "description": "No airline with that code"
          }
        }
      }
    },
    "/api/airports.json": {
      "get": {
        "summary": "Every airport code",
        "responses": {
          "200": {
            "description": "Code list"
          }
        }
      }
    },
    "/api/airlines.json": {
      "get": {
        "summary": "Every airline code",
        "responses": {
          "200": {
            "description": "Code list"
          }
        }
      }
    },
    "/api/routes.json": {
      "get": {
        "summary": "Every airport pair that has a route page",
        "responses": {
          "200": {
            "description": "Pair list, each as AAA-BBB"
          }
        }
      }
    },
    "/api/changelog.json": {
      "get": {
        "summary": "Dataset version history",
        "responses": {
          "200": {
            "description": "Versions, dates and what changed"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Airport": {
        "type": "object",
        "required": [
          "iata",
          "name",
          "country"
        ],
        "properties": {
          "iata": {
            "type": "string",
            "example": "AMS"
          },
          "icao": {
            "type": [
              "string",
              "null"
            ],
            "example": "EHAM"
          },
          "name": {
            "type": "string"
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2"
          },
          "countryName": {
            "type": "string"
          },
          "continent": {
            "type": [
              "string",
              "null"
            ]
          },
          "lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "lon": {
            "type": [
              "number",
              "null"
            ]
          },
          "elevationFt": {
            "type": [
              "number",
              "null"
            ]
          },
          "type": {
            "type": "string"
          },
          "scheduledService": {
            "type": "boolean"
          },
          "runways": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Runway"
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "Runway": {
        "type": "object",
        "properties": {
          "designation": {
            "type": [
              "string",
              "null"
            ]
          },
          "lengthFt": {
            "type": "number"
          },
          "surface": {
            "type": [
              "string",
              "null"
            ]
          },
          "lighted": {
            "type": "boolean"
          }
        }
      },
      "Airline": {
        "type": "object",
        "required": [
          "iata",
          "name"
        ],
        "properties": {
          "iata": {
            "type": "string",
            "example": "KL"
          },
          "icao": {
            "type": [
              "string",
              "null"
            ],
            "example": "KLM"
          },
          "name": {
            "type": "string"
          },
          "callsign": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "source": {
            "type": "string"
          }
        }
      }
    }
  }
}