{
  "openapi": "3.0.3",
  "info": {
    "title": "Airline Fleet Monitor Read-Only REST API",
    "version": "1.0.0",
    "description": "High-performance read-only JSON API deployed globally on Cloudflare Workers edge nodes. Provides sub-50ms query access to commercial aircraft fleets, Mode S transponder telemetry, flight routes, and aircraft lessor portfolios.",
    "contact": {
      "name": "Airline Fleet Monitor Developer Support",
      "url": "https://airlinefleetmonitor.com/api-docs/"
    },
    "license": {
      "name": "Open Data Commons Open Database License (ODbL)",
      "url": "https://opendatacommons.org/licenses/odbl/1-0/"
    }
  },
  "servers": [
    {
      "url": "https://airlinefleetmonitor.com/api/v1",
      "description": "Production Cloudflare Edge Server"
    }
  ],
  "paths": {
    "/airlines/{slug}": {
      "get": {
        "summary": "Get Airline Profile and Fleet Counts",
        "description": "Look up an airline by URL slug, IATA code (2 characters), or ICAO code (3 characters).",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Airline slug (e.g., 'delta-air-lines'), IATA code ('DL'), or ICAO code ('DAL')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Airline profile retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AirlineResponse"
                }
              }
            }
          },
          "404": {
            "description": "Airline not found"
          }
        }
      }
    },
    "/aircraft/{slug}": {
      "get": {
        "summary": "Get Aircraft Type Specifications and Fleet Counts",
        "description": "Retrieve technical specifications, seats, range, and active counts by ICAO type or slug.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Aircraft type code (e.g., 'A20N') or slug ('a320neo')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Aircraft type specifications retrieved successfully"
          },
          "404": {
            "description": "Aircraft type not found"
          }
        }
      }
    },
    "/airframes/{tail}": {
      "get": {
        "summary": "Look up Airframe by Registration Tail or Mode S Hex",
        "description": "Resolve an individual airframe by tail number (e.g., 'N801DN') or 24-bit Mode S transponder hex code (e.g., 'AAE543').",
        "parameters": [
          {
            "name": "tail",
            "in": "path",
            "required": true,
            "description": "Aircraft tail registration mark or Mode S hex address",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Airframe telemetry record retrieved successfully"
          },
          "404": {
            "description": "Airframe not found"
          }
        }
      }
    },
    "/airports/{icao}": {
      "get": {
        "summary": "Get Airport Profile and Observed Influx",
        "description": "Query airport profile, elevation, runways, and last-seen airframes by ICAO (4 chars) or IATA (3 chars).",
        "parameters": [
          {
            "name": "icao",
            "in": "path",
            "required": true,
            "description": "Airport ICAO or IATA code (e.g., 'KJFK' or 'JFK')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Airport profile retrieved successfully"
          },
          "404": {
            "description": "Airport not found"
          }
        }
      }
    },
    "/lessors/{slug}": {
      "get": {
        "summary": "Get Aircraft Lessor Managed Portfolio",
        "description": "Retrieve aircraft leasing company fleet counts, client airline exposure, and asset valuations.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Lessor slug (e.g., 'aerCap' or 'air-lease-corporation')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lessor profile retrieved successfully"
          },
          "404": {
            "description": "Lessor not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AirlineResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "data": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "iata": { "type": "string" },
              "icao": { "type": "string" },
              "country": { "type": "string" },
              "status": { "type": "string" },
              "observed_fleet_count": { "type": "integer" },
              "active_count": { "type": "integer" },
              "stored_count": { "type": "integer" },
              "avg_age": { "type": "number" },
              "hubs": {
                "type": "array",
                "items": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }
}
