API for Flights from Chicago O'Hare International Airport (ORD) — Flight Status and Delay Codes
Building a reliable departure board or delay alert for Chicago O’Hare International Airport means keeping scheduled information separate from live status. O’Hare is in Chicago, Illinois; its IATA code is ORD and its ICAO code is KORD. This guide shows how to retrieve ORD departures with FlightLabs, interpret the available fields, and design an integration that handles changing flight information.
Request ORD departure schedules
FlightLabs provides a schedule endpoint at https://api.goflightlabs.com/flights-schedules. Set iataCode to ORD and use the documented departure value for type to select departures. Authenticate with your API key using the method described in the Documentation.
The following Python function calls that endpoint using a requests.Session supplied by the application. Configure the session with your API key before calling the function, and pass the documented departure value as departure_type.
import requests
SCHEDULES_URL = "https://api.goflightlabs.com/flights-schedules"
def get_ord_departures(session, departure_type):
response = session.get(
SCHEDULES_URL,
params=dict(iataCode="ORD", type=departure_type),
timeout=30,
)
response.raise_for_status()
payload = response.json()
if payload.get("success") is not True:
raise RuntimeError("FlightLabs did not return a successful result")
data = payload.get("data") or dict()
schedules = data.get("schedules") or []
for schedule in schedules:
departure = schedule.get("departure") or dict()
arrival = schedule.get("arrival") or dict()
airline = schedule.get("airline") or dict()
print("Flight:", schedule.get("flight_number") or "Unavailable")
print("Airline:", airline.get("name") or "Unavailable")
print("Airline IATA:", airline.get("iata") or "Unavailable")
print("Departure airport:", departure.get("airport") or "Unavailable")
print("Scheduled departure:", departure.get("scheduled") or "Unavailable")
print("Departure terminal:", departure.get("terminal") or "Unavailable")
print("Arrival airport:", arrival.get("airport") or "Unavailable")
print("Scheduled arrival:", arrival.get("scheduled") or "Unavailable")
print()
return schedules
The function checks the HTTP response and the top-level success value before reading data.schedules. It also tolerates missing optional information when displaying a schedule. In a production application, log a failed request separately from a successful request that returns no schedules.
This function processes the schedules returned in one response. If your schedule query requires pagination, extend the integration using the pagination instructions in the documentation; do not treat the first response as the complete departure board until you have confirmed how to retrieve all applicable results.
Read the schedule and live-flight fields
The schedule response groups records under data.schedules. For an ORD departure board, the most useful schedule fields identify the flight, its airline, the departure time and terminal, and its destination. Live-flight information serves a different purpose: it can add status, actual or estimated times, and gate information when those fields are available.
| Field | Use for an ORD departure | Handling consideration |
|---|---|---|
flight_number |
Label the scheduled flight. | Keep the flight identifier alongside the scheduled departure when matching updates. |
airline.name and airline.iata |
Display the airline name and code. | Do not assume these fields explain every codeshare relationship. |
departure.airport and departure.scheduled |
Identify the origin and scheduled departure time. | Check that the origin is ORD before presenting a record as an ORD departure. |
departure.terminal |
Show the departure terminal when supplied. | Treat an absent value as unknown, not as a terminal assignment. |
arrival.airport and arrival.scheduled |
Show the destination and scheduled arrival. | Label arrival times clearly so they are not confused with the ORD departure time. |
flight.status |
Display a live-flight status when available. | Preserve unrecognized values rather than forcing them into an inaccurate label. |
departure.actual and arrival.estimated |
Compare actual departure or estimated arrival with the corresponding scheduled time. | Use only comparable timestamps for the same flight event. |
departure.gate and arrival.gate |
Display a gate when supplied by live-flight data. | Gates can change; retain a last-updated time in your application. |
The provided schedule example includes aircraft.type and aircraft.registration, but those fields are not required to build a departure board. Keep aircraft details optional: an absent registration should not prevent the flight from appearing.
The live-flight example uses flight.iata, flight.icao, and flight.number for flight identifiers. Those are distinct from the schedule example’s flight_number field. When joining schedule and live data, verify that the identifiers refer to the same service and departure rather than assuming similarly named fields are interchangeable.
Status, delays, and codeshares
A schedule is a plan, not proof that a flight has departed. The live-flight example includes a status such as en-route, while the schedule example does not include a status field. Show “status unavailable” when you have only schedule data rather than inferring a current state from the scheduled time.
For an actual departure delay, compare departure.actual with departure.scheduled when both are present. An estimated arrival can be compared with the scheduled arrival, but that difference is an arrival estimate, not necessarily the departure delay. The examples do not establish a delay-reason code or its meaning, so a calculated time difference should not be presented as an official delay code or cause.
Codeshares need similar care. The examples identify a flight and an airline, but they do not show a codeshare relationship or establish which carrier operates a service. Keep the identifiers returned by each source and avoid merging records solely because their times or destinations match.
Build useful products around ORD departures
Departure board
Use flight_number, airline.name, arrival.airport, departure.scheduled, and departure.terminal to construct the scheduled portion of a board. Add flight.status and departure.gate only when you have corresponding live-flight data for the same service.
Keep the scheduled time visible even when a newer operational time is available. If a terminal or gate is absent, display it as unavailable rather than leaving an old assignment on the board without qualification. A visible last-updated indicator helps users distinguish a recently refreshed board from cached data.
Departure-change alerts
Store the previous state of each tracked departure and compare it with the next successful update. Relevant changes can include flight.status, departure.actual, departure.terminal, or departure.gate, provided the fields are available for that flight.
Send an alert when a meaningful value changes, not every time you poll. Treat a missing field carefully: it may mean the latest response lacks that detail, not that an existing terminal or gate assignment has been deliberately removed. Keep the source and observation time with each stored value so the application can explain what changed.
Schedule synchronization
A corporate travel or logistics tool can use flight_number, departure.scheduled, and arrival.scheduled to associate an ORD departure with an itinerary. Preserve the airport codes as well, particularly departure.airport and arrival.airport, so an unrelated service with a similar identifier is not matched accidentally.
Refresh schedule records separately from more frequent live updates. A schedule change and an operational status change are different events: retain the previous scheduled value when auditing changes, and do not overwrite it with an actual departure time.
Handle time, changes, and incomplete results
The example timestamps use the Z suffix, which indicates UTC. Parse timestamps as timezone-aware values, store the original value or its UTC equivalent, and convert to Chicago local time for an ORD-facing display. Chicago observes daylight saving time, so use a timezone-aware conversion rather than a fixed offset.
For an itinerary, label each displayed time with its relevant timezone. A departure from ORD and an arrival elsewhere can have different local offsets; subtract the underlying UTC instants when calculating elapsed time or a delay. Never calculate a delay by subtracting formatted local clock strings.
For cancelled flights, retain the scheduled record and display the cancellation when the live source reports it. Suppress misleading countdowns or alerts that imply a normal departure. For diverted flights, avoid claiming the originally scheduled destination has been reached; preserve the scheduled destination separately from any updated operational information available to your application.
The examples do not define every possible status value or diversion detail. Build a fallback for values your application does not recognize, and avoid silently mapping them to “on time.” Missing status, a failed request, and a confirmed cancellation are three different conditions and should produce different application behavior.
Poll and cache without hiding stale data
Choose a polling frequency based on the product’s need for freshness. A public departure board or a flight approaching departure may need more frequent live checks than a background schedule synchronization. Review the applicable account limits and current documentation before selecting intervals; avoid requesting the same flight independently for every user viewing it.
Cache shared ORD schedule results and deduplicate concurrent refreshes. Cache live-flight results separately, because their status and gate information may change more quickly than the schedule. Record when each cache entry was fetched, and expose that age where a stale value could affect a traveler’s decision.
If a refresh fails, you can temporarily serve the last successful result with a clear stale-data indicator. Do not update the displayed freshness time just because a failed request was attempted. Retry according to your application’s error-handling policy, and distinguish authentication failures from temporary request failures so a bad key does not trigger an endless retry loop.
For schedules, follow the documented pagination mechanism until the relevant result set is complete. Track whether every requested page succeeded; a partially refreshed board should not silently replace a complete cached board. An empty successful result is also different from a page that could not be retrieved.
FAQ
Can I get ORD departures without requesting arrivals?
Use the schedule endpoint with iataCode set to ORD and type set to the documented departure value. Check departure.airport on returned records before using them in an ORD departure workflow.
Does a scheduled time tell me whether a flight is delayed?
No. It is the planned time. Compare it with an actual or estimated time for the same event when live data supplies one, and label the comparison as an actual delay or an estimate as appropriate.
What should I do when a gate or status is missing?
Show the field as unavailable and retain the last successful observation time if you display cached information. Do not infer a gate or operational status from the schedule alone.
How should I handle codeshares?
Keep the returned flight and airline identifiers, but do not assume the examples identify operating-carrier or codeshare relationships. Confirm the available fields and matching rules before combining services in an itinerary or alert.
To start building an ORD departure integration, Register for an API key. You can also explore the FlightLabs MCP service for an additional way to work with FlightLabs data.