Denver International Airport (DEN) Flight Delays API - Rate Limits and Pagination
Denver International Airport (DEN) flight boards and delay alerts need more than a scheduled time: they need a way to distinguish a current estimate from a stale one. Denver International Airport is in Colorado, and its ICAO code is KDEN. This guide shows how to retrieve DEN schedules, interpret the available timing fields, and design polling and pagination around the information FlightLabs provides.
Start with DEN schedules
FlightLabs exposes schedules at GET https://api.goflightlabs.com/flights-schedules. The documented query parameters are iataCode and type; use DEN for the airport code and select the appropriate schedule type for the board you are building.
The schedule response example has a success flag and a data.schedules list. Each schedule can include flight_number, departure and arrival airport codes and scheduled times, terminal information, airline details, and aircraft details. A schedule is a planning record: the example does not establish that every schedule includes a current status, delay, gate, or updated arrival estimate.
Before making a request, check the Documentation for the accepted type values and the API-key authentication format. Configure both explicitly rather than assuming that an arrivals value, departures value, or key parameter from another API will work here.
Read a schedule response in Python
The following example calls the schedules endpoint using a fully configured request URL from the DEN_SCHEDULES_URL environment variable. Set that variable to the FlightLabs schedules URL with iataCode=DEN, the appropriate documented type, and the documented authentication details. If your authentication setup requires a header rather than a URL value, add it to the request according to the documentation.
import json
import os
from urllib.request import urlopen
url = os.environ["DEN_SCHEDULES_URL"]
with urlopen(url) as response:
payload = json.load(response)
if not payload.get("success"):
raise RuntimeError("FlightLabs did not return a successful response")
for flight in payload.get("data", {}).get("schedules", []):
departure = flight.get("departure") or {}
arrival = flight.get("arrival") or {}
airline = flight.get("airline") or {}
print(
flight.get("flight_number"),
airline.get("iata"),
departure.get("airport"),
departure.get("scheduled"),
departure.get("terminal"),
arrival.get("airport"),
arrival.get("scheduled"),
arrival.get("terminal"),
)
The code reads the fields shown in the schedule response example and tolerates missing optional objects. It does not calculate delays, because the schedule example provides scheduled times but no corresponding live estimate. For a production service, add request timeouts and error handling, and keep the authenticated URL out of logs.
Check both departure.airport and arrival.airport when processing records: they tell your application which side of the journey relates to DEN. Use flight_number and airline.iata for display and matching, but do not assume that a flight number alone uniquely identifies an operation across dates or codeshares.
Turn flight updates into useful delay information
The real-time response example uses a different shape from the schedules response: a flight is under data.flight, with a status and nested departure and arrival objects. In that example, departure includes scheduled and actual times, while arrival includes scheduled and estimated times. Both sides can include a terminal and gate.
When a DEN flight has both a scheduled arrival and a current estimated arrival, subtract the scheduled instant from the estimated instant to derive an arrival difference. An estimate later than the schedule indicates a potential delay; label it as an estimate, not a confirmed actual arrival. Likewise, a scheduled departure and an actual departure can establish how late the flight left, but they do not by themselves establish its final arrival delay.
Keep missing values distinct from zero. If the estimate or actual time is absent, show the delay as unavailable rather than displaying an on-time result. If a gate or terminal is absent, show it as unassigned or unavailable rather than retaining an older value without a freshness indication.
| Field | Use for a DEN display | Important distinction |
|---|---|---|
status |
Show the current state when a real-time flight record supplies it. | The schedule example does not include this field. |
scheduled |
Display the planned departure or arrival time. | A schedule is not proof that a flight operated as planned. |
estimated |
Compare an available arrival estimate with the scheduled arrival. | An estimate can change and is not an actual arrival time. |
actual |
Compare an available actual departure with its schedule. | Do not substitute it for an arrival estimate. |
terminal and gate |
Direct passengers to the latest available location. | These values may be missing or change between updates. |
For codeshares, avoid assuming that every displayed flight number represents a separate aircraft movement. The examples include flight and airline identifiers but do not show a codeshare relationship field. Preserve the identifiers returned for each record, and verify the available relationship data before merging records or suppressing duplicate alerts.
Build three DEN workflows
Arrival and departure boards
Start with the relevant DEN schedule type and render flight_number, the airline’s iata code, the scheduled time, and the terminal when present. Use the departure and arrival airport fields to distinguish flights leaving DEN from flights arriving there. Do not infer a gate from a terminal: they are separate fields in the real-time example.
Where a matching live record is available, add its status, estimated arrival, and gate. Show when the live information was last refreshed, and keep the scheduled time visible so users can understand what changed. If the live record cannot be matched confidently, leave it separate rather than attaching another flight’s status to the board.
Delay and disruption alerts
Store the last observed scheduled and estimated times for a DEN flight. When a new estimate changes, calculate the difference using the timestamp instants and apply your product’s alert threshold. Record the previous value so repeated polls with the same estimate do not produce repeated notifications.
Treat a cancellation or diversion as an operational state, not merely a large delay. If the status information indicates either event, surface it prominently and stop presenting an old estimate as a reliable arrival promise. The supplied example shows a status field but does not define a complete set of status values, so confirm the current values and their meanings before implementing status-specific rules.
Schedule synchronization
Sync DEN schedules into a local store for search, planning, and board initialization. Preserve the original flight_number, airport codes, scheduled timestamps, airline information, and any terminal or aircraft details you need. Keep live observations separate from the schedule so a stale live value does not overwrite the planned time.
Plan matching around more than a flight number: include the relevant airport and scheduled operation when identifying a record. Reconcile changes rather than blindly appending every refresh, and retain enough provenance to tell whether a displayed value came from a schedule or a later live update.
Time zones, polling, and pagination
The example timestamps use the Z suffix, meaning UTC. Parse timestamps as timezone-aware instants and store them in UTC; convert to Denver local time only when presenting a DEN board or evaluating a local calendar day. Denver observes daylight saving time, so use a timezone database rather than a fixed UTC offset.
For delay calculations, subtract instants rather than formatted local strings. That avoids errors around daylight-saving transitions and avoids comparing a DEN local display time directly with a timestamp from another airport. Preserve the source timestamp alongside any derived delay so your calculation can be audited.
Choose a polling cadence based on how quickly your users need updates and the request allowance on your account. A public display may warrant more frequent refreshes than a planning screen, but neither should make a separate upstream request for every viewer. Fetch once on the server, cache the result, and let clients share it; expose the cache age so users can judge freshness.
Budget for retries and concurrent workers as well as normal polls. When requests fail or the service signals a limit, use backoff rather than an immediate retry loop. Serve a clearly marked last successful result when appropriate, and avoid treating an old cached status as a new operational update.
Schedules can be large enough to require pagination. The supplied schedule example shows a list but does not specify page parameters or response pagination metadata. Check the current documentation for the supported mechanism before implementing traversal; do not assume that the first response contains every DEN flight or invent a page-number parameter.
Once the mechanism is confirmed, process every page, persist progress safely, and make synchronization idempotent so a retry does not duplicate records. Treat an incomplete traversal as an incomplete sync, not evidence that flights missing from the pages already fetched have been cancelled. Check your account’s applicable rate limits and request allowance when sizing the sync.
FAQ
Does the DEN schedules response include delay minutes?
The provided schedule example contains scheduled times but does not show a delay field. A delay can be derived when a suitable live estimate or actual time is available alongside the corresponding schedule.
How should I handle a cancelled or diverted flight?
Use the returned status information and the documented status meanings. Display the disruption separately from a calculated delay, and do not continue to present an old estimate as current.
How often should I poll for DEN updates?
Set the interval according to your freshness requirement and account limits. Share cached responses across users, track their age, and back off when requests fail or limits are reached.
Can I assume all DEN schedules arrive in one response?
No. Verify the current pagination mechanism, retrieve all applicable pages, and distinguish a completed sync from a partial one.
To start building, Register for a FlightLabs API key. For an additional integration option, see MCP.