ORD Flight Schedule API: Chicago Departures as JSON
Your product needs a reliable JSON feed of Chicago O’Hare (ORD) departures you can drop into dashboards, mobile apps, or operations tools. By the end of this guide, you’ll be able to query the FlightLabs flight schedule endpoint for ORD departures, parse the status/timing fields that matter, and ship a production-ready flow with sensible polling, timezone handling, and fallback logic.
What you get from the ORD departures endpoint
FlightLabs exposes a schedule resource that returns the current departures board for a given airport. For Chicago O’Hare International Airport (ORD), use the departures query type:
- Endpoint: GET /flights-schedules
- Parameters: iataCode=ORD and type=departure
- Authentication: API key (access_key)
In practical terms, this gives you a list of upcoming or same-day flights leaving ORD, with each row including identifiers (like flight_iata), current status, and nested timing/terminal/gate data for departure and arrival. You’ll typically display a subset of fields on a board and store flight_iata and status for downstream updates or analytics.
If you’re new to FlightLabs, you can review the platform and product scope on www.goflightlabs.com, then follow the steps below to start making requests.
Get started in minutes
FlightLabs offers a Starter plan ($24.99/mo) with a 7‑day trial so you can test ORD departures against your app stack. To go live:
- Register for an API key — 7‑day trial included.
- Copy your access_key from the dashboard.
- Call GET /flights-schedules with iataCode=ORD and type=departure.
- Persist flight_iata and status for updates and cache invalidation.
You can explore endpoint details, parameters, and field semantics any time in the Documentation and try queries interactively in the MCP.
ORD departures: curl request
Use this request to retrieve Chicago O’Hare departures in JSON. Replace YOUR_API_KEY with your access_key:
curl "https://api.goflightlabs.com/flights-schedules?access_key=YOUR_ACCESS_KEY&iataCode=ORD&type=departure"
That request filters the board to departures at ORD. You’ll receive structured JSON suitable for rendering a live departures list or merging into analytics pipelines.
Response format and how it maps to O’Hare
The official sample below shows the response shape using data from a different airport (the sample contains dep_iata: JFK). At O’Hare, you’ll receive the same keys and structure, just with dep_iata: ORD and ORD-specific times, terminals, and gates. Do not treat rows with dep_iata: JFK as if they were ORD flights; use this sample strictly to understand the schema.
{
"success": true,
"type": "departure",
"data": [{"airline_iata": "TG", "flight_iata": "TG6173", "dep_iata": "JFK", "arr_iata": "BKK", "status": "scheduled"}]
}
Fields you will actually use
You’ll typically pull these keys per flight:
- flight_iata: Airline + number identifier (e.g., UA123). Store this as your primary key for display updates.
- status: Operational state string (e.g., “scheduled”, “active”, “landed”, “canceled”, “diverted”). Use this to color-code and filter your UI and to decide when to stop polling a flight.
- departure: Nested object covering departure details:
- airport / iata / icao: Airport identifiers (for ORD, iata should be “ORD”).
- scheduled / estimated / actual: Timestamps you’ll use to display the plan and any adjustments. Treat these timestamps as authoritative for ordering and delay calculations.
- terminal / gate: Human-facing routing in the airport. These are nullable when not assigned.
- delay: Minutes of delay, when available.
- arrival: The counterpart object for the destination airport, useful for trip tracking or gate/turn planning at the other end.
- codeshared (if present): When the row represents a codeshare, this object points to the operating carrier’s identifiers. For displays, you may prefer to show the marketing flight (flight_iata) while linking to the operating details.
Dates and times are provided in the JSON payload. For display and sorting, prefer the estimated time when it’s available, then fall back to scheduled. When actual is populated, the flight has departed.
JavaScript example: fetch ORD departures and normalize for a board
The example below calls the same endpoint and normalizes a few fields developers commonly render. Include your access_key as documented in the Documentation (the curl example above shows the exact pattern).
async function fetchOrdDepartures() {
const params = new URLSearchParams({
iataCode: 'ORD',
type: 'departure',
// Include your API key as documented (e.g., access_key)
// access_key: 'YOUR_API_KEY'
});
const res = await fetch('/flights-schedules?' + params.toString(), {
// If your integration uses headers for auth, add them here per docs
// headers: { Authorization: 'Bearer YOUR_API_KEY' }
});
if (!res.ok) {
throw new Error('Network error fetching ORD schedules: ' + res.status);
}
const data = await res.json();
// Defensive checks if the API uses success / error envelopes
if (data && data.success === false) {
const message = data.error?.info || 'API returned success=false';
throw new Error(message);
}
// Assume data is an array of flights or an envelope containing an array.
// Adapt this accessor based on the response container used by your account plan.
const flights = Array.isArray(data) ? data : (data?.data || []);
return flights.map((f) => {
// The schema shown in the official sample includes these fields
const d = f.departure || {};
const a = f.arrival || {};
const scheduled = d.scheduled || null;
const estimated = d.estimated || null;
const actual = d.actual || null;
// Choose the best display time: actual > estimated > scheduled
const displayTime = actual || estimated || scheduled;
return {
flight_iata: f.flight_iata || null,
status: f.status || 'unknown',
dep_airport_iata: d.iata || null, // Expect 'ORD' for this query
dep_terminal: d.terminal || null,
dep_gate: d.gate || null,
dep_display_time: displayTime,
delay_minutes: typeof d.delay === 'number' ? d.delay : null,
arr_airport_iata: a.iata || null,
codeshared: !!f.codeshared
};
});
}
// Example usage
fetchOrdDepartures()
.then((flights) => {
// Render your board; sort by dep_display_time ascending
flights.sort((x, y) => (new Date(x.dep_display_time)) - (new Date(y.dep_display_time)));
console.log('ORD departures:', flights.slice(0, 10));
})
.catch((err) => {
console.error('Failed to load ORD departures', err);
});
Which fields to cache and display
For a departures board, limiting to the essentials keeps your UI responsive and reduces re-renders:
- Primary key: flight_iata. Persist this across refreshes to diff incoming data and avoid flicker.
- Status: A top-level string that drives badging and hides canceled/diverted rows if your UX requires it.
- Departure time: Prefer actual, else estimated, else scheduled. Show local time at ORD for user-facing formatting.
- Terminal/Gate: Optional display that changes infrequently; cache and invalidate only when the flight row updates.
- Delay: Minutes if provided; otherwise compute from scheduled vs estimated when both exist.
- Codeshare: If the codeshared object exists, decide whether to surface the marketing or operating flight based on your UX.
Time zones, UTC, and ordering flights
Flight timing fields are timestamps that you must interpret consistently:
- Normalize to UTC for comparisons, sorting, and server-side logic.
- Format in ORD’s local time for display. If your UI supports multiple time zones, keep UTC internally and convert on render.
- Ordering strategy: actual (if present) is the true departure; otherwise use estimated; otherwise scheduled. This helps reflect gate holds and rolling delays accurately.
- When fields are missing (e.g., no estimated yet), do not guess. Keep scheduled as the placeholder and revisit on next poll.
Polling, caching, and when to stop refreshing
Live boards work best when you limit network overhead and UI churn:
- Polling frequency: choose a cadence aligned with your SLA and user needs. Five-minute intervals can be sufficient for schedule boards; tighten intervals near departure time windows if you need near-real-time updates.
- Conditional updates: compare incoming rows to cached rows by flight_iata; only re-render differences in status, times, or gate/terminal.
- Expiry: drop flights from the polling set once they reach a terminal state (e.g., departed or canceled), or after a grace window if your display includes recently departed flights.
- Backoff: if the API returns success=false or your network errors spike, back off and retry with jitter.
Handling canceled, diverted, and irregular operations
Irregular operations surface in status and timing fields:
- Canceled: status reflects cancellation; hide the row or move it to a “Canceled” section. Clear gate/terminal if your UX requires it.
- Diverted: display the diverted status prominently; downstream legs may no longer be valid. Do not attempt to infer a new destination unless explicitly provided.
- Delayed: use the delay field if present; otherwise compute a delta between scheduled and estimated. Keep both values visible in your UI to reduce confusion.
If you encounter success=false or partial data, fail gracefully. Display a stale timestamp label for cached rows and encourage a manual refresh button to supplement your polling loop.
Pagination and slicing your ORD board
The ORD departures set can be large. Engineering strategies that help without inventing parameters:
- Server-side windowing: query the endpoint and filter locally to a rolling time window (e.g., next N hours) while respecting the schedule fields you receive.
- Client-side pagination: segment your rendered list into pages by time buckets (e.g., 30-minute blocks) based on scheduled/estimated times.
- Cursoring: if your account or plan returns an envelope with paging fields, follow the documented approach in the Documentation to retrieve subsequent batches. Do not assume parameter names—use the docs.
Practical mapping for an ORD departures board
Here’s a concise mapping that many apps use to render a clean departures table for ORD:
| UI Column | FlightLabs Field(s) | Notes |
|---|---|---|
| Time | departure.actual or departure.estimated or departure.scheduled | Convert to ORD local time for display; keep UTC internally. |
| Flight | flight_iata | Use this as the stable row identifier. |
| To | arrival.airport (and arrival.iata) | City/airport name plus IATA in smaller text improves scannability. |
| Terminal | departure.terminal | Nullable; show “—” if missing. |
| Gate | departure.gate | Nullable and subject to late changes. |
| Status | status and/or departure.delay | Use color badges; if delay is present, append “+Xm”. |
| Operated by | codeshared (when present) | Show “Operated by <carrier>” for codeshares as needed. |
Error handling and missing values
Resilient clients handle both transport and application-level errors:
- HTTP errors: surface a non-blocking notice and reuse cached data. Log details for debugging.
- API envelope errors: if the payload includes success=false with an error object, extract and log error.info (or similar) for operators; display a generic message to users.
- Missing fields: terminals and gates can be missing; times can be partially known. Treat nulls as “TBD” in UI. Never synthesize values.
- Type safety: parse times once at the boundary and enforce non-nullable fields (like flight_iata) in your data model; mark optional fields accordingly.
Testing your integration
Use the MCP to try iataCode=ORD with type=departure to confirm shape and values. Validate these checks before shipping:
- All rows where departure.iata equals “ORD”.
- status transitions correctly update your UI without flicker (diff by flight_iata).
- Time ordering uses actual > estimated > scheduled and is stable across polls.
- Codeshared flights show intended marketing vs operating labeling.
For production deploys, document your polling interval, caching window, and data retention. Keep a feature flag to reduce polling during incidents.
Deployment notes and security
- Do not hardcode keys in client apps; route requests through a backend if you need to keep your access_key secret.
- Implement circuit breaking and exponential backoff on the server side to avoid cascading failures.
- Add lightweight observability: track request latency, error rate, and the count of rows per poll to detect anomalies.
If you need to evaluate additional endpoints (arrivals, real-time status across multiple airports, historical analytics), explore the FlightLabs homepage and the Documentation for a complete surface map.
Go live checklist for ORD departures
- Register and obtain your access_key (7‑day trial).
- Call GET /flights-schedules with iataCode=ORD and type=departure.
- Parse flight_iata, status, and departure/arrival timing fields.
- Render a board using actual/estimated/scheduled priority and ORD local time.
- Poll and cache intelligently; handle canceled/diverted gracefully.
- Persist flight_iata and last-seen status to eliminate UI jitter.
You can also “Read the ORD board →” via the same Register link after you’ve set up your key.
FAQ
Does the sample JSON show ORD data?
No. The official sample illustrates the response structure and includes dep_iata: JFK. When you query with iataCode=ORD&type=departure, you’ll receive the same keys populated for Chicago O’Hare.
Which time should I display for each flight?
Use departure.actual if present, else departure.estimated, else departure.scheduled. Convert to ORD local time for display and keep UTC internally for sorting.
How often should I poll the endpoint for a live board?
Choose a cadence that balances freshness and load. Many boards use multi-minute intervals and tighten the loop for flights departing soon. Always cache and diff by flight_iata.
How do I authenticate?
Use your access_key from the dashboard. Follow the exact placement (query parameter or header) shown in the curl request and the Documentation.
What about codeshares?
If a codeshared object is present, you can display the marketing flight number (flight_iata) and optionally annotate “Operated by …” based on the codeshare details. Avoid merging rows unless your UX explicitly requires it.
Is there a trial to test ORD departures?
Yes. The Starter plan includes a 7‑day trial. You can sign up and start calling the ORD departures endpoint today.
Start building your ORD departures board now. Sign up for the 7‑day trial and get your API key: Register. If you need deeper fields or additional endpoints, browse the Documentation and experiment in the MCP.