DXB Flight Schedule API: Dubai Departures as JSON
You need a clean JSON feed of Dubai International Airport (DXB) departures that your app can poll, cache, and render into boards, alerts, or operational dashboards. By the end of this guide you will be able to request the DXB departures board from the FlightLabs Flight Schedules API, parse the response for status, times, terminals, gates, delays, and codeshares, and build a production-safe pipeline with polling, filtering, and error handling.
What you get from the DXB departures schedule
The FlightLabs flight schedules endpoint returns a machine-friendly list of departing flights from Dubai International (IATA: DXB) when queried with the right parameters. Each record includes fields you need to drive a departure board or trip notifications, such as:
- dep_iata and arr_iata: the origin and destination IATA airport codes
- status: current flight status (for example, scheduled, active, landed, cancelled, diverted)
- Times: scheduled, estimated, and actual timestamps for departure/arrival (use these for countdowns and delay calculations)
- Delay: a numeric delay value if available
- Terminal and gate: terminal and gate assignments where provided
- Codeshares: if a flight operates under multiple flight numbers
Responses are JSON over HTTPS, authenticated via your API key. The same structure works across airports; you identify Dubai departures with iataCode=DXB and type=departure, and you can also additionally confirm by filtering dep_iata equals DXB.
Endpoint and parameters for Dubai departures
Use a single REST call:
- Method: GET
- Endpoint: https://api.goflightlabs.com/flights-schedules
- Query parameters:
- access_key: your API key
- iataCode=DXB: selects Dubai International
- type=departure: limits to outbound flights
Starter is $24.99/mo (4,000 calls) with a 7-day trial, so you can get live quickly and tune your polling and caching before you go to production. For endpoint conventions and optional filters, see the Documentation. If you prefer exploring via a control plane, the MCP has quickstart references.
Requesting DXB departures
Here is the exact GET call developers use to retrieve Dubai departures as JSON. Replace YOUR_API_KEY with the key from your FlightLabs account.
Copy/paste the request below.
curl "https://api.goflightlabs.com/flights-schedules?access_key=YOUR_ACCESS_KEY&iataCode=DXB&type=departure"
About the sample response you’ll see below
The official example JSON that follows is from a different airport (it shows dep_iata: JFK for a specific date). That sample demonstrates the exact shape (fields and nesting) you will receive for DXB. When you run the DXB call above in your environment, live results will show dep_iata set to DXB, with the same keys present for status, times, delays, terminals, gates, and codeshares.
{
"success": true,
"type": "departure",
"data": [
{
"airline_iata": "TG",
"flight_iata": "TG6173",
"dep_iata": "JFK",
"dep_terminal": "7",
"dep_gate": "5",
"dep_time_utc": "2026-09-16 17:30",
"arr_iata": "HND",
"status": "active"
}
]
}
Reading the fields that matter
From the sample above:
- data[]: an array of flight records. Each element represents one scheduled or operating flight.
- dep_iata: the origin IATA code. In your live DXB request, this will be "DXB".
- arr_iata: the destination IATA code. Use this to group departures by destination city.
- status: the current flight status. Use this to color rows or trigger notifications.
- Times: scheduled, estimated, and actual times (fields show both planned and updated timestamps). If a flight is delayed, estimated/actual times move while scheduled stays fixed.
- delay: the delay in minutes, when provided. If null or absent, compute from scheduled vs. estimated times.
- terminal and gate: the assigned departure terminal/gate when available for passenger displays or wayfinding.
- codeshares: details for codeshare partners. Show all public flight numbers to help users find their ticketed flight.
If a field is missing for a record (for example, no gate assignment yet), treat it as unknown and avoid rendering “None” or “null” in your UI. Instead, hide that subcomponent or show a placeholder like “TBD”.
Going live in four steps
- Register for FlightLabs — includes a 7-day trial.
- Copy your access_key from the dashboard.
- Call GET /flights-schedules with iataCode=DXB and type=departure.
- Filter client-side using data[].dep_iata to ensure your board shows only DXB-originating flights.
That’s all you need to wire DXB departures into your app or display.
A minimal Python client for DXB departures
This example fetches departures, filters for dep_iata == "DXB", and prints status, times, delays, and terminal/gate when available.
import os
import time
import requests
from datetime import datetime, timezone
API_URL = "https://api.goflightlabs.com/flights-schedules"
API_KEY = os.getenv("FLIGHTLABS_KEY", "YOUR_API_KEY")
def parse_time(ts):
# Parse an ISO-like timestamp if present; return both local-ish and UTC string forms if needed.
if not ts:
return None
try:
# Many APIs return ISO 8601. If an offset is included, requests won't parse; do simple string return.
return ts
except Exception:
return ts
def fetch_dxb_departures():
params = {
"access_key": API_KEY,
"iataCode": "DXB",
"type": "departure"
}
r = requests.get(API_URL, params=params, timeout=20)
# Handle transport-level errors
r.raise_for_status()
payload = r.json()
# Some responses include a top-level success flag. If present and false, treat as an error.
if isinstance(payload, dict) and ("success" in payload) and (payload["success"] is False):
# If the API provides an error message, surface it for debugging.
message = payload.get("error") or payload.get("message") or "Unknown API error"
raise RuntimeError(f"FlightLabs API error: {message}")
flights = payload.get("data", [])
results = []
for f in flights:
if f.get("dep_iata") != "DXB":
continue # Double-check origin
# Access keys defensively; some fields may be missing for certain flights
status = f.get("status")
dep_time_scheduled = f.get("dep_time") or f.get("departure_time") or f.get("scheduled_departure")
dep_time_estimated = f.get("estimated_departure") or f.get("dep_time_estimated")
dep_time_actual = f.get("actual_departure") or f.get("dep_time_actual")
delay = f.get("delay")
terminal = f.get("dep_terminal")
gate = f.get("dep_gate")
codeshares = f.get("codeshares") # may be a list or nested object depending on the record
results.append({
"status": status,
"scheduled": parse_time(dep_time_scheduled),
"estimated": parse_time(dep_time_estimated),
"actual": parse_time(dep_time_actual),
"delay_min": delay,
"terminal": terminal,
"gate": gate,
"codeshares": codeshares
})
return results
if __name__ == "__main__":
flights = fetch_dxb_departures()
for f in flights[:20]:
print("DXB departure:")
print(" status :", f["status"])
print(" scheduled :", f["scheduled"])
print(" estimated :", f["estimated"])
print(" actual :", f["actual"])
print(" delay_min :", f["delay_min"])
print(" terminal :", f["terminal"])
print(" gate :", f["gate"])
print(" codeshares :", f["codeshares"])
Notes for production:
- Field names are read defensively because some values can be absent depending on flight state and data availability. Keep the keys you use aligned with the response shape shown above.
- Do not assume a terminal/gate or delay will be present for every record.
- Times in the payload are timestamps; convert consistently to your target timezone for rendering.
Time zones, timestamps, and delay math
Schedules and real-time updates often mix local airport time and UTC offsets in their timestamps. Best practices:
- Store raw API timestamps as strings for auditability.
- Convert to UTC immediately inside your service layer for comparisons and sorting.
- Render in the user’s preferred timezone (or the airport local time) in the UI.
- Calculate delays against scheduled vs. estimated/actual timestamps if the numeric delay field is missing.
If the API supplies an explicit delay value, prefer it. Otherwise compute delay_minutes = max(0, estimated_departure - scheduled_departure) in minutes, using UTC to avoid DST or offset issues.
Live polling, caching, and resiliency
Departures change frequently near pushback. To balance accuracy and quota:
- Poll the DXB departures endpoint at a cadence appropriate to your UX (e.g., more frequent near departure time, less frequent for flights far in the future).
- Cache each response with a short TTL. Reuse cached data for list views and refetch on detail views when needed.
- Only re-render rows when significant fields change (status, estimated/actual times, terminal/gate).
- Debounce notification triggers so users are not spammed by minor estimate adjustments.
- Defend against transient errors: retry with backoff on HTTP 5xx; handle timeouts; if a top-level success flag is present and false, log and surface the message.
When a flight is cancelled or diverted, set clear visual states and suppress countdowns. For diverted flights, keep the original DXB departure context but update status and downstream fields per the record.
Filtering, pagination, and volume
Dubai International is a high-volume hub. Even with type=departure, results may be large. Recommendations:
- Always filter client-side by dep_iata == "DXB". This is a safe guardrail.
- If the endpoint offers pagination controls (for example, a page index and page size documented in the API reference), use them to batch through the full board.
- For displays, you can pre-partition flights into timeslices (e.g., departures within the next few hours) using scheduled/estimated times to minimize payload and refresh cost.
If you are building timelines or predictive ETDs, keep a local store of flight records keyed by an immutable identifier (e.g., flight ID or a composite of date+carrier+number) and update in place as you poll.
Error handling and data hygiene
- HTTP errors: retry with exponential backoff for transient issues; do not retry on 4xx without fixing parameters.
- success=false: if the payload contains a boolean success and it’s false, treat it as an application-level failure. Inspect error/message fields if present.
- Missing values: terminal, gate, delay, and codeshares may be absent. Design your UI to hide or gracefully label unknown values.
- Data consistency: when both estimated and actual are present, actual takes precedence for “departed” state; estimated takes precedence over scheduled while a flight is still on the ground.
Security and environment setup
- Store your access_key in environment variables or a secrets manager, not in source control.
- If you operate from the browser, proxy requests through your backend to keep the key server-side.
- Monitor usage against your plan; Starter includes 4,000 calls per month with a 7-day trial to evaluate.
Testing with JFK sample vs. live DXB
The JSON example above shows a real structure using a JFK departure snapshot so you can confidently map fields like status, times, gates, terminals, and codeshares. When you execute the DXB request, the same keys will be returned, and dep_iata will be DXB. Your parsing logic should not special-case JFK vs. DXB; instead, rely on data[].dep_iata checks to scope your boards and alerts.
FAQ
How do I get only Dubai outbound flights?
Use iataCode=DXB and type=departure in your request, then confirm dep_iata == "DXB" in the returned data to filter your view.
What timezone are the timestamps in?
The payload includes timestamps that you should treat consistently and convert to UTC in your backend. Render in local airport time or user preference. If a timezone string or UTC offset is present in the timestamp, preserve it for correct arithmetic.
How should I handle cancelled or diverted flights?
Use the status field to drive UX states. For cancelled, stop countdowns and show a clear label. For diverted, keep the DXB departure context but reflect the updated status and downstream fields from the record.
Do I need to paginate?
DXB can produce large schedules. If pagination parameters are available for this endpoint (refer to the API documentation), use them and stitch pages in your service layer.
What’s the best polling interval?
Match your interval to the user experience: faster near departure time and slower otherwise, with short-lived caching to smooth load and avoid rate spikes.
Ready to build against live Dubai departures? Start your 7-day trial and get your API key here: Register. For endpoint details and optional filters, visit the Documentation, or explore in the MCP console.