{
    "openapi": "3.1.0",
    "info": {
        "title": "FerryFlight Public API",
        "description": "Read-only API for AI agents to generate ferry-flight price ESTIMATES and pull aircraft, airport, FAA-registry, live-flight, and route data. Estimates are non-binding; the final price is confirmed when a pilot accepts the booking. No auth; rate-limited.",
        "version": "1.0.0",
        "contact": {
            "url": "https://www.ferryflighthub.com/contact"
        }
    },
    "servers": [
        {
            "url": "https://www.ferryflighthub.com/api/v1"
        }
    ],
    "paths": {
        "/estimate": {
            "get": {
                "operationId": "getEstimate",
                "summary": "Get a ferry-flight price estimate between two airports for an aircraft.",
                "description": "Accepts human identifiers: airports as ICAO/IATA/local code; aircraft as an FAA model code (from /aircraft), an N-number, an ICAO type code, or \"make model\". Returns a full fee breakdown matching the website calculator.",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "Origin airport \u2014 ICAO (KJFK), IATA (JFK), or local code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Destination airport \u2014 ICAO/IATA/local code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "aircraft",
                        "in": "query",
                        "required": true,
                        "description": "FAA model code (preferred \u2014 from /aircraft), an N-number (N12345), an ICAO type (C172), or \"make model\".",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "Optional departure date YYYY-MM-DD. A sooner date may add an urgency surcharge.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Estimate with fee breakdown, route, aircraft, booking_url, and a non-binding disclaimer.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/aircraft": {
            "get": {
                "operationId": "searchAircraft",
                "summary": "Search aircraft models by manufacturer/model/type. Returns faa_code to use with /estimate.",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Search text, e.g. \"cessna 172\" or \"PA28\".",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching aircraft models with faa_code, manufacturer, model, seats, cruise_ktas, range_nm.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/aircraft/{faaCode}": {
            "get": {
                "operationId": "getAircraft",
                "summary": "Full specs for one aircraft model (performance, capacity, powerplant, capabilities).",
                "parameters": [
                    {
                        "name": "faaCode",
                        "in": "path",
                        "required": true,
                        "description": "FAA model code from /aircraft.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Aircraft model detail.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/airports": {
            "get": {
                "operationId": "searchAirports",
                "summary": "Search airports by code/name/city.",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Search text, e.g. \"teterboro\" or \"KTEB\".",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching airports with ICAO/IATA, name, city, coordinates.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/airports/{icao}": {
            "get": {
                "operationId": "getAirport",
                "summary": "Airport detail incl. runways and frequencies.",
                "parameters": [
                    {
                        "name": "icao",
                        "in": "path",
                        "required": true,
                        "description": "ICAO/IATA/local code.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Airport detail with runways[] and frequencies[].",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/registry": {
            "get": {
                "operationId": "searchRegistry",
                "summary": "Search the FAA aircraft registry (by N-number prefix or manufacturer/state/year).",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "N-number or prefix, e.g. N172 or 172.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "manufacturer",
                        "in": "query",
                        "required": false,
                        "description": "Manufacturer name filter.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "required": false,
                        "description": "US state code filter, e.g. NJ.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "required": false,
                        "description": "Year manufactured filter.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching FAA registrations.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/registry/{nNumber}": {
            "get": {
                "operationId": "getRegistration",
                "summary": "FAA registration detail for one N-number (FAA-public data).",
                "parameters": [
                    {
                        "name": "nNumber",
                        "in": "path",
                        "required": true,
                        "description": "US N-number, e.g. N12345.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Registration detail incl. model, engine, year, status.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/route": {
            "get": {
                "operationId": "getRoute",
                "summary": "Great-circle distance + FAA preferred route + optional ferry planning for an aircraft.",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "Origin airport code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Destination airport code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "aircraft",
                        "in": "query",
                        "required": false,
                        "description": "Optional aircraft for fuel-stop / flying-day planning.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Distance, preferred route, and ferry planning.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        },
        "/flights/live": {
            "get": {
                "operationId": "getLiveFlights",
                "summary": "Recently observed live ADS-B flights tracked by FerryFlight.",
                "responses": {
                    "200": {
                        "description": "Current airborne flights with position.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found."
                    },
                    "422": {
                        "description": "Missing/unresolvable parameters (the body explains what to fix)."
                    }
                }
            }
        }
    }
}