{
  "openapi": "3.1.0",
  "info": {
    "title": "Airhex Aviation Data API",
    "version": "1.0.0",
    "description": "Airline, airport, city and country reference data, airline logos and recent airline content changes. Data endpoints use v3.7.10; updates use v3.7; logo URLs are unversioned. Request a demo dataset and test API key at https://airhex.com/getstarted/. Full access, exports and image formats depend on your license; contact sales@airhex.com. This is reference data, not a flight booking, live flight status, aircraft fleet, route or seat-map API. Keep API keys and logo signing code on your server. Legacy responses may contain numeric values as strings and absent values as null or empty strings. Check error bodies even on HTTP 200.",
    "termsOfService": "https://airhex.com/terms/",
    "contact": {
      "name": "Airhex Support",
      "email": "support@airhex.com",
      "url": "https://airhex.com/contact/"
    }
  },
  "servers": [
    {
      "url": "https://content.airhex.com",
      "description": "Production API and logo delivery"
    }
  ],
  "externalDocs": {
    "url": "https://airhex.com/api/",
    "description": "Airhex API documentation"
  },
  "tags": [
    {
      "name": "Airlines",
      "description": "Airlines reference data and bulk exports.",
      "externalDocs": {
        "url": "https://airhex.com/api/airlines/"
      }
    },
    {
      "name": "Airports",
      "description": "Airports reference data and bulk exports.",
      "externalDocs": {
        "url": "https://airhex.com/api/airports/"
      }
    },
    {
      "name": "Cities",
      "description": "Cities reference data and bulk exports.",
      "externalDocs": {
        "url": "https://airhex.com/api/cities/"
      }
    },
    {
      "name": "Countries",
      "description": "Countries reference data and bulk exports.",
      "externalDocs": {
        "url": "https://airhex.com/api/countries/"
      }
    },
    {
      "name": "Updates",
      "description": "Recent airline content changes.",
      "externalDocs": {
        "url": "https://airhex.com/api/updates/"
      }
    },
    {
      "name": "Logos",
      "description": "Signed airline logo URLs; raster demo access and licensed SVG.",
      "externalDocs": {
        "url": "https://airhex.com/api/logos/"
      }
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/api/v3.7.10/airlines/": {
      "get": {
        "operationId": "getAirlines",
        "tags": [
          "Airlines"
        ],
        "summary": "Look up or export airlines",
        "description": "Provide at least one of iata, icao, name, or dump=1. dump=1 overrides lookup selectors and requires a license allowing bulk export. onlyscheduled defaults to 1 and still applies to exports; use 0 for all airline types. Missing, expired or restricted keys may return demo/limited field values; inspect the response rather than assuming a 401 status.",
        "externalDocs": {
          "url": "https://airhex.com/api/airlines/"
        },
        "parameters": [
          {
            "name": "iata",
            "in": "query",
            "required": false,
            "description": "Two-character IATA airline code Provide at least one of iata, icao, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "WN"
          },
          {
            "name": "icao",
            "in": "query",
            "required": false,
            "description": "Three-letter ICAO airline code Provide at least one of iata, icao, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "SWA"
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Airline name or substring for partial matching Provide at least one of iata, icao, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "Southwest"
          },
          {
            "name": "dump",
            "in": "query",
            "required": false,
            "description": "Set to 1 to export the complete database. Overrides other conditional parameters above. Provide at least one of iata, icao, name, or dump=1.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "description": "Response format: JSON, XML, or CSV (CSV triggers file download)",
            "schema": {
              "type": "string",
              "enum": [
                "JSON",
                "XML",
                "CSV"
              ],
              "default": "JSON"
            }
          },
          {
            "name": "onlyscheduled",
            "in": "query",
            "required": false,
            "description": "Filter to include only scheduled airlines (1) or all airline types including cargo, private jets, etc (0)",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 1
            }
          },
          {
            "name": "logo_rectangle_width",
            "in": "query",
            "required": false,
            "description": "Width of rectangular logo images",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1400,
              "default": 700
            }
          },
          {
            "name": "logo_rectangle_height",
            "in": "query",
            "required": false,
            "description": "Height of rectangular logo images",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400,
              "default": 200
            }
          },
          {
            "name": "logo_square_width",
            "in": "query",
            "required": false,
            "description": "Width of square and tail logo images",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400,
              "default": 200
            }
          },
          {
            "name": "logo_square_height",
            "in": "query",
            "required": false,
            "description": "Height of square and tail logo images",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching records, or an error object. Even a single match is returned as an array. CSV is delivered as text/plain with an attachment filename; XML as text/xml. HTTP 200 does not guarantee licensed access or success.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Airline"
                      }
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "record": {
                    "summary": "Illustrative subset of fields; actual records include additional fields.",
                    "value": [
                      {
                        "iata": "WN",
                        "icao": "SWA",
                        "marketing_name": "Southwest Airlines"
                      }
                    ]
                  },
                  "error": {
                    "value": {
                      "error": "Database dump is not allowed for trial"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No matching records. Error is serialized in the requested response format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "No results found"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v3.7.10/airports/": {
      "get": {
        "operationId": "getAirports",
        "tags": [
          "Airports"
        ],
        "summary": "Look up or export airports",
        "description": "Provide at least one of iata, icao, city_code, country_code, name, or dump=1. dump=1 overrides lookup selectors and requires a license allowing bulk export. show_disabled and major_only still apply to exports. Use timezone with a date-aware library; utc is not a daylight-saving rule. Missing, expired or restricted keys may return demo/limited field values; inspect the response rather than assuming a 401 status.",
        "externalDocs": {
          "url": "https://airhex.com/api/airports/"
        },
        "parameters": [
          {
            "name": "iata",
            "in": "query",
            "required": false,
            "description": "Three-letter IATA airport code Provide at least one of iata, icao, city_code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "LHR"
          },
          {
            "name": "icao",
            "in": "query",
            "required": false,
            "description": "Four-letter ICAO airport code Provide at least one of iata, icao, city_code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "EGLL"
          },
          {
            "name": "city_code",
            "in": "query",
            "required": false,
            "description": "Three-letter IATA city code Provide at least one of iata, icao, city_code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "LON"
          },
          {
            "name": "country_code",
            "in": "query",
            "required": false,
            "description": "Two-letter ISO 3166-1 Alpha-2 country code Provide at least one of iata, icao, city_code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "GB"
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Airport name or partial match substring Provide at least one of iata, icao, city_code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "Heathrow"
          },
          {
            "name": "dump",
            "in": "query",
            "required": false,
            "description": "Set to 1 to export the complete database (ignores other conditional parameters above) Provide at least one of iata, icao, city_code, country_code, name, or dump=1.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "show_disabled",
            "in": "query",
            "required": false,
            "description": "Set to 1 to include inactive/disabled airports in the response. By default, only active airports are returned.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "description": "Response format: JSON, XML, or CSV (CSV initiates file download)",
            "schema": {
              "type": "string",
              "enum": [
                "JSON",
                "XML",
                "CSV"
              ],
              "default": "JSON"
            }
          },
          {
            "name": "major_only",
            "in": "query",
            "required": false,
            "description": "Set to 1 to include only airports with commercial flights (excludes seaplane bases, helipads, military bases, etc)",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching records, or an error object. Even a single match is returned as an array. CSV is delivered as text/plain with an attachment filename; XML as text/xml. HTTP 200 does not guarantee licensed access or success.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Airport"
                      }
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "record": {
                    "summary": "Illustrative subset of fields; actual records include additional fields.",
                    "value": [
                      {
                        "iata": "LHR",
                        "icao": "EGLL",
                        "name": "London Heathrow Airport",
                        "timezone": "Europe/London"
                      }
                    ]
                  },
                  "error": {
                    "value": {
                      "error": "Database dump is not allowed for trial"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No matching records. Error is serialized in the requested response format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "No results found"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v3.7.10/cities/": {
      "get": {
        "operationId": "getCities",
        "tags": [
          "Cities"
        ],
        "summary": "Look up or export cities",
        "description": "Provide at least one of code, country_code, name, or dump=1. dump=1 overrides lookup selectors and requires a license allowing bulk export. Missing, expired or restricted keys may return demo/limited field values; inspect the response rather than assuming a 401 status.",
        "externalDocs": {
          "url": "https://airhex.com/api/cities/"
        },
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "Three-letter IATA city code Provide at least one of code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "NYC"
          },
          {
            "name": "country_code",
            "in": "query",
            "required": false,
            "description": "Two-letter ISO 3166-1 Alpha-2 country code Provide at least one of code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "US"
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "City name or partial substring for search matching Provide at least one of code, country_code, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "New York"
          },
          {
            "name": "dump",
            "in": "query",
            "required": false,
            "description": "Set to 1 to export the complete database (ignores other conditional parameters above) Provide at least one of code, country_code, name, or dump=1.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "description": "Response format: JSON, XML, or CSV (CSV initiates file download)",
            "schema": {
              "type": "string",
              "enum": [
                "JSON",
                "XML",
                "CSV"
              ],
              "default": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching records, or an error object. Even a single match is returned as an array. CSV is delivered as text/plain with an attachment filename; XML as text/xml. HTTP 200 does not guarantee licensed access or success.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/City"
                      }
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "record": {
                    "summary": "Illustrative subset of fields; actual records include additional fields.",
                    "value": [
                      {
                        "code": "NYC",
                        "country_code": "US",
                        "name": "New York"
                      }
                    ]
                  },
                  "error": {
                    "value": {
                      "error": "Database dump is not allowed for trial"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No matching records. Error is serialized in the requested response format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "No results found"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v3.7.10/countries/": {
      "get": {
        "operationId": "getCountries",
        "tags": [
          "Countries"
        ],
        "summary": "Look up or export countries",
        "description": "Provide at least one of code2, code3, iso, name, or dump=1. dump=1 overrides lookup selectors and requires a license allowing bulk export. Missing, expired or restricted keys may return demo/limited field values; inspect the response rather than assuming a 401 status.",
        "externalDocs": {
          "url": "https://airhex.com/api/countries/"
        },
        "parameters": [
          {
            "name": "code2",
            "in": "query",
            "required": false,
            "description": "Two-letter ISO 3166-1 Alpha-2 country code Provide at least one of code2, code3, iso, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "US"
          },
          {
            "name": "code3",
            "in": "query",
            "required": false,
            "description": "Three-letter ISO 3166-1 Alpha-3 country code Provide at least one of code2, code3, iso, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "USA"
          },
          {
            "name": "iso",
            "in": "query",
            "required": false,
            "description": "Numeric ISO 3166-1 country code Provide at least one of code2, code3, iso, name, or dump=1.",
            "schema": {
              "type": "integer"
            },
            "example": 840
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Country name or partial substring for matching Provide at least one of code2, code3, iso, name, or dump=1.",
            "schema": {
              "type": "string"
            },
            "example": "United States"
          },
          {
            "name": "dump",
            "in": "query",
            "required": false,
            "description": "Set to 1 to export the complete database (ignores other conditional parameters above) Provide at least one of code2, code3, iso, name, or dump=1.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "description": "Response format: JSON, XML, or CSV (CSV initiates file download)",
            "schema": {
              "type": "string",
              "enum": [
                "JSON",
                "XML",
                "CSV"
              ],
              "default": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching records, or an error object. Even a single match is returned as an array. CSV is delivered as text/plain with an attachment filename; XML as text/xml. HTTP 200 does not guarantee licensed access or success.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Country"
                      }
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "record": {
                    "summary": "Illustrative subset of fields; actual records include additional fields.",
                    "value": [
                      {
                        "code2": "US",
                        "code3": "USA",
                        "name": "United States"
                      }
                    ]
                  },
                  "error": {
                    "value": {
                      "error": "Database dump is not allowed for trial"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No matching records. Error is serialized in the requested response format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "No results found"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v3.7/updates/": {
      "get": {
        "operationId": "getUpdates",
        "tags": [
          "Updates"
        ],
        "summary": "Retrieve recent airline content changes",
        "description": "Requires a currently active API key. Returns a JSON object keyed by change ID, ordered newest first. No pagination cursor is documented. Validation or authentication errors can return HTTP 200 with an error object. An empty result may be null.",
        "externalDocs": {
          "url": "https://airhex.com/api/updates/"
        },
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Filter changes. airline excludes logo changes.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "airline",
                "logo"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of changes.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1000
            },
            "example": 50
          }
        ],
        "responses": {
          "200": {
            "description": "Change records keyed by change ID, null for an empty result, or an error object.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "patternProperties": {
                        "^[0-9]+$": {
                          "$ref": "#/components/schemas/Change"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "examples": {
                  "changes": {
                    "value": {
                      "12345": {
                        "iata": "AA",
                        "icao": "AAL",
                        "changetype": "logo",
                        "updated": "2026-06-30 11:44:54"
                      }
                    }
                  },
                  "invalidKey": {
                    "value": {
                      "error": "API key is not set or incorrect or your subscription has expired"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/content/logos/airlines_{code}_{width}_{height}_{type}.{format}": {
      "get": {
        "operationId": "getAirlineLogoRaster",
        "tags": [
          "Logos"
        ],
        "summary": "Retrieve a raster airline logo",
        "description": "Sign CODE_WIDTH_HEIGHT_TYPE_APIKEY. Unsigned or demo requests may return watermarked, cached or outdated images. Generate the lowercase hexadecimal MD5 digest server-side and send it as md5apikey. Never send the raw API key in the logo URL. Theme, background, proportions and show_alliance do not change the signature. Missing or invalid signatures can return an error image rather than a JSON error; HTTP 200 alone does not prove licensed access.",
        "externalDocs": {
          "url": "https://airhex.com/api/logos/"
        },
        "security": [
          {
            "LogoSignature": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "Two-character IATA or three-character ICAO airline code. Codes are case-insensitive; sign the exact value used in the URL.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{2,3}$"
            },
            "example": "EY"
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "r rectangular, s square, t tail, f flipped tail, c circular.",
            "schema": {
              "type": "string",
              "enum": [
                "r",
                "s",
                "t",
                "f",
                "c"
              ]
            },
            "example": "r"
          },
          {
            "name": "width",
            "in": "path",
            "required": true,
            "description": "Raster width in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 350
          },
          {
            "name": "height",
            "in": "path",
            "required": true,
            "description": "Raster height in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "description": "Raster output format.",
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "gif",
                "jpg"
              ]
            },
            "example": "png"
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "description": "Logo theme.",
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark"
              ],
              "default": "light"
            }
          },
          {
            "name": "dark",
            "in": "query",
            "required": false,
            "description": "Legacy alias: dark=1 selects the dark theme.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            }
          },
          {
            "name": "proportions",
            "in": "query",
            "required": false,
            "description": "Use keep to preserve original logo proportions.",
            "schema": {
              "type": "string",
              "enum": [
                "keep"
              ]
            }
          },
          {
            "name": "background",
            "in": "query",
            "required": false,
            "description": "Six-digit hex background color, without #.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{6}$"
            },
            "example": "3399cc"
          },
          {
            "name": "show_alliance",
            "in": "query",
            "required": false,
            "description": "For rectangular logos, add the supported alliance logo. Ignored by other shapes; falls back to the standard airline logo if unavailable.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes. With missing or invalid credentials this can be a demo/watermarked/error image.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "Other delivery or licensing response; no stable JSON error contract is documented."
          }
        }
      }
    },
    "/content/logos/airlines_{code}_{type}.svg": {
      "get": {
        "operationId": "getAirlineLogoSvg",
        "tags": [
          "Logos"
        ],
        "summary": "Retrieve a licensed SVG airline logo",
        "description": "Requires an active SVG license. Sign CODE_TYPE_APIKEY. Generate the lowercase hexadecimal MD5 digest server-side and send it as md5apikey. Never send the raw API key in the logo URL. Theme, background, proportions and show_alliance do not change the signature. Missing or invalid signatures can return an error image rather than a JSON error; HTTP 200 alone does not prove licensed access.",
        "externalDocs": {
          "url": "https://airhex.com/api/logos/"
        },
        "security": [
          {
            "LogoSignature": []
          }
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "Two-character IATA or three-character ICAO airline code. Codes are case-insensitive; sign the exact value used in the URL.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{2,3}$"
            },
            "example": "EY"
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "r rectangular, s square, t tail, f flipped tail, c circular.",
            "schema": {
              "type": "string",
              "enum": [
                "r",
                "s",
                "t",
                "f",
                "c"
              ]
            },
            "example": "r"
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "description": "Logo theme.",
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark"
              ],
              "default": "light"
            }
          },
          {
            "name": "dark",
            "in": "query",
            "required": false,
            "description": "Legacy alias: dark=1 selects the dark theme.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            }
          },
          {
            "name": "proportions",
            "in": "query",
            "required": false,
            "description": "Use keep to preserve original logo proportions.",
            "schema": {
              "type": "string",
              "enum": [
                "keep"
              ]
            }
          },
          {
            "name": "background",
            "in": "query",
            "required": false,
            "description": "Six-digit hex background color, without #.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{6}$"
            },
            "example": "3399cc"
          },
          {
            "name": "show_alliance",
            "in": "query",
            "required": false,
            "description": "For rectangular logos, add the supported alliance logo. Ignored by other shapes; falls back to the standard airline logo if unavailable.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes. With missing or invalid credentials this can be a demo/watermarked/error image.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "Other delivery or licensing response; no stable JSON error contract is documented."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "query",
        "name": "apikey",
        "description": "Your assigned API key. Request a test key at https://airhex.com/getstarted/?api_key=1. Full data and bulk exports require the appropriate license."
      },
      "LogoSignature": {
        "type": "apiKey",
        "in": "query",
        "name": "md5apikey",
        "description": "Per-request MD5 signature, not the API key itself. Raster: md5(CODE_WIDTH_HEIGHT_TYPE_APIKEY). SVG: md5(CODE_TYPE_APIKEY). Compute server-side with the exact URL parameter values. Theme, background, proportions and show_alliance are not part of the signed string."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message. Legacy validation and access failures can use HTTP 200."
          }
        }
      },
      "Airline": {
        "type": "object",
        "description": "Fields may be empty, null or restricted by the assigned key. Numeric values can be serialized as strings.",
        "properties": {
          "airhex_id": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Unique permanent record identifier"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date and time the record was last updated"
          },
          "iata": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline's IATA code"
          },
          "icao": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline's ICAO code"
          },
          "parent_icao": {
            "type": [
              "string",
              "null"
            ],
            "description": "ICAO code of parent airline (if applicable)"
          },
          "marketing_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Commonly used airline name for marketing purposes"
          },
          "full_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline's registered legal name"
          },
          "status": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Operational status code. The current v3.7.10 implementation maps start-up status 2 to 0; do not use this field to distinguish start-ups from defunct airlines."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline category: Scheduled, Passenger/Charter, Cargo, ACMI, etc."
          },
          "type_code": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Numeric code indicating airline type. 1 - Scheduled, 2 - Passenger/Charter, 3 - Railway/Bus/Ferry, 4 - Helicopter/Charter, 5 - Jet/Charter, 6 - Tour, 7 - ACMI, 8 - Cargo, 9 - Others"
          },
          "alliance": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline alliance membership (if applicable)"
          },
          "ffp_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the airline's frequent flyer program"
          },
          "lowcost": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Indicates a low-cost carrier (1 if LCC, else 0)"
          },
          "country_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Country of the airline’s headquarters"
          },
          "country_code_alpha_2": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 Alpha-2 country code of airline HQ"
          },
          "country_code_alpha_3": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 Alpha-3 country code of airline HQ"
          },
          "founded": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Year the airline was established"
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "description": "Official airline website URL"
          },
          "web_checkin_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL for web-based passenger check-in"
          },
          "mobile_checkin_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL for mobile passenger check-in"
          },
          "baggage_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to airline’s baggage allowance policy"
          },
          "colorscheme": {
            "description": "Array detailing the airline's primary colors used in branding (RGB values, percentages, hex codes, darkness indicators) Missing palettes may be null or false.",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BrandColor"
                }
              },
              {
                "type": "null"
              },
              {
                "const": false
              }
            ]
          },
          "logo_rectangle": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the rectangular airline logo image with specified dimensions and secured API hash"
          },
          "logo_square": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the square airline logo image with specified dimensions and secured API hash"
          },
          "logo_tail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's tail logo image with specified dimensions and secured API hash"
          },
          "logo_tail_flipped": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's horizontally flipped tail logo image with specified dimensions and secured API hash"
          },
          "logo_rectangle_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the rectangular airline logo optimized for dark backgrounds with specified dimensions and secured API hash"
          },
          "logo_square_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the square airline logo optimized for dark backgrounds with specified dimensions and secured API hash"
          },
          "logo_tail_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's tail logo optimized for dark backgrounds with specified dimensions and secured API hash"
          },
          "logo_tail_flipped_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's horizontally flipped tail logo optimized for dark backgrounds with specified dimensions and secured API hash"
          },
          "logo_rectangle_svg": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the rectangular airline logo in SVG vector format with secured API hash"
          },
          "logo_square_svg": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the square airline logo in SVG vector format with secured API hash"
          },
          "logo_tail_svg": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's tail logo in SVG vector format with secured API hash"
          },
          "logo_tail_flipped_svg": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's horizontally flipped tail logo in SVG vector format with secured API hash"
          },
          "logo_rectangle_svg_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the rectangular airline logo in SVG vector format optimized for dark backgrounds with secured API hash"
          },
          "logo_square_svg_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the square airline logo in SVG vector format optimized for dark backgrounds with secured API hash"
          },
          "logo_tail_svg_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's tail logo in SVG vector format optimized for dark backgrounds with secured API hash"
          },
          "logo_tail_flipped_svg_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct URL to the airline's horizontally flipped tail logo in SVG vector format optimized for dark backgrounds with secured API hash"
          }
        }
      },
      "Airport": {
        "type": "object",
        "description": "Fields may be empty, null or restricted by the assigned key. Numeric values can be serialized as strings.",
        "properties": {
          "airhex_id": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Unique permanent record identifier"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date and time the record was last updated"
          },
          "iata": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airport's three-letter IATA code"
          },
          "icao": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airport's four-letter ICAO code"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airport name"
          },
          "city_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Three-letter IATA city code of the airport's location"
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 Alpha-2 country code of the airport location"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airport's time zone identifier"
          },
          "utc": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Airport's time offset from UTC"
          },
          "latitude": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Geographic latitude of the airport"
          },
          "longitude": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Geographic longitude of the airport"
          },
          "major_airport": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Indicates if the airport has scheduled commercial flights: 1 – Airport with scheduled flights 0 – Airport with no scheduled flights or other location types (rail/bus stations, helipads, etc.)"
          },
          "sub_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Facility subtype (if not an airport), e.g., Rail, Bus/Limo, Ferry/Port, or Border/Customs"
          },
          "active": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Operational status: 1 active; 0 inactive"
          },
          "avg_weekly_flights": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Average weekly scheduled flight count"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Physical address of the airport"
          },
          "phone_local": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local phone contact for the airport"
          },
          "phone_intl": {
            "type": [
              "string",
              "null"
            ],
            "description": "International phone contact including country code"
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "description": "Official airport website URL"
          }
        }
      },
      "City": {
        "type": "object",
        "description": "Fields may be empty, null or restricted by the assigned key. Numeric values can be serialized as strings.",
        "properties": {
          "airhex_id": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Unique permanent record identifier"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date and time the record was last updated"
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "City’s three-letter IATA code"
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 Alpha-2 country code"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "City’s name"
          },
          "state_short": {
            "type": [
              "string",
              "null"
            ],
            "description": "State/province abbreviation (US, CA, AU cities only)"
          },
          "state_full": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full state/province name (US, CA, AU cities only)"
          },
          "latitude": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Geographic latitude of the city center"
          },
          "longitude": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Geographic longitude of the city center"
          },
          "city_photo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Licensed, commercially usable city image URL"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "City's timezone identifier"
          },
          "gmt": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "City's time offset from GMT"
          },
          "population": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Population count of the city"
          },
          "popularity": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Relative popularity index (higher value indicates higher destination popularity)"
          }
        }
      },
      "Country": {
        "type": "object",
        "description": "Fields may be empty, null or restricted by the assigned key. Numeric values can be serialized as strings.",
        "properties": {
          "airhex_id": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Unique permanent record identifier"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date and time the record was last updated"
          },
          "iso": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "ISO 3166-1 numeric country code"
          },
          "code2": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 Alpha-2 two-letter country code"
          },
          "code3": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 Alpha-3 three-letter country code"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Country name"
          },
          "capital_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Three-letter IATA code for the country's capital city"
          },
          "currency_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Three-letter ISO currency code"
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Geographical region of the country"
          },
          "continent_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Two-letter continent code"
          },
          "population": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Country’s population count"
          },
          "phone_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "International country dialing code"
          }
        }
      },
      "BrandColor": {
        "type": "object",
        "properties": {
          "color": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 255
            },
            "description": "RGB components."
          },
          "percent": {
            "type": "number"
          },
          "hex": {
            "type": "string",
            "example": "#1414D4"
          },
          "dark": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Darkness indicator, not an accessibility contrast score."
          }
        }
      },
      "Change": {
        "type": "object",
        "properties": {
          "iata": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline IATA code."
          },
          "icao": {
            "type": [
              "string",
              "null"
            ],
            "description": "Airline ICAO code."
          },
          "changetype": {
            "type": [
              "string",
              "null"
            ],
            "description": "logo, NEW, DEL, status or another changed field name."
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "description": "Change timestamp, YYYY-MM-DD HH:MM:SS. No timezone is specified."
          }
        }
      }
    }
  }
}
