API Reference
REST endpoints for the Air of Americas demo platform.
GET
/api/flights/airportsTypeahead airport search. Returns deduped airports matching the query by code or city.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | No | Search 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/searchSearch flights on a route. Falls back to the 3 closest flights by date when no exact-day match exists. Never 500s.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| origin | string | Yes | Origin airport code (e.g. FLL). |
| destination | string | Yes | Destination airport code (e.g. BOG). |
| date | string (YYYY-MM-DD) | Yes | Requested departure date. |
| passengers | number | Yes | Seats 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/flightsCreate a new DemoFlight record. Returns the created flight (HTTP 201).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| routeId | string | Yes | ID of an existing DemoRoute. |
| date | string (YYYY-MM-DD) | Yes | Departure date. |
| departureTime | string (HH:MM) | Yes | Local departure time. |
| arrivalTime | string (HH:MM) | Yes | Local arrival time. |
| flightNumber | string | Yes | e.g. NK 200. |
| basePrice | number | Yes | AOA base fare in USD. |
| marketPrice | number | No | Reference market fare in USD. |
| seatsTotal | number | No | Cabin 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
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | DemoFlight ID. |
Example request
curl "https://fly.airofamericas.com/api/dashboard/flights/<id>"
Example response
{ "status": "coming_soon" }