API Reference

REST endpoints for the Air of Americas demo platform.

GET/api/flights/airports

Typeahead airport search. Returns deduped airports matching the query by code or city.

Parameters

NameTypeRequiredDescription
qstringNoSearch term. Omit to return all airports.

Example request

curl "https://fly.airofamericas.com/api/flights/airports?q=bog"

Example response

[
  { "code": "BOG", "city": "Bogotá" }
]
GET/api/flights/search

Search flights on a route. Falls back to the 3 closest flights by date when no exact-day match exists. Never 500s.

Parameters

NameTypeRequiredDescription
originstringYesOrigin airport code (e.g. FLL).
destinationstringYesDestination airport code (e.g. BOG).
datestring (YYYY-MM-DD)YesRequested departure date.
passengersnumberYesSeats required (filters seatsAvailable).

Example request

curl "https://fly.airofamericas.com/api/flights/search?origin=FLL&destination=BOG&date=2028-02-02&passengers=1"

Example response

[
  {
    "id": "cmqh...",
    "flightNumber": "NK 100",
    "departureTime": "07:10",
    "arrivalTime": "10:45",
    "date": "2028-02-02T12:00:00.000Z",
    "basePrice": "157",
    "marketPrice": "259",
    "seatsAvailable": 175,
    "seatsTotal": 180,
    "aircraft": "A320",
    "durationMins": 215,
    "origin": "Fort Lauderdale",
    "destination": "Bogotá",
    "originCode": "FLL",
    "destCode": "BOG"
  }
]
POST/api/dashboard/flights

Create a new DemoFlight record. Returns the created flight (HTTP 201).

Parameters

NameTypeRequiredDescription
routeIdstringYesID of an existing DemoRoute.
datestring (YYYY-MM-DD)YesDeparture date.
departureTimestring (HH:MM)YesLocal departure time.
arrivalTimestring (HH:MM)YesLocal arrival time.
flightNumberstringYese.g. NK 200.
basePricenumberYesAOA base fare in USD.
marketPricenumberNoReference market fare in USD.
seatsTotalnumberNoCabin capacity (default 180).

Example request

curl -X POST https://fly.airofamericas.com/api/dashboard/flights \
  -H "content-type: application/json" \
  -d '{"routeId":"<id>","date":"2028-03-15","departureTime":"08:00","arrivalTime":"11:30","flightNumber":"NK 250","basePrice":169}'

Example response

{
  "id": "cmqh...",
  "flightNumber": "NK 250",
  "basePrice": "169",
  "seatsTotal": 180,
  "seatsAvailable": 180,
  "date": "2028-03-15T00:00:00.000Z"
}
GET/api/dashboard/flights/[id]

Fetch a single flight by ID. (Coming soon.)

Parameters

NameTypeRequiredDescription
idstringYesDemoFlight ID.

Example request

curl "https://fly.airofamericas.com/api/dashboard/flights/<id>"

Example response

{ "status": "coming_soon" }