Best API to Access Hong Kong International Airport (HKG) Flights Schedules Data in 2025
You need reliable departure and arrival schedules for a single hub so you can build boards, dashboards, and alerts that stay in sync. In this guide, you’ll use the FlightLabs Flight Schedules endpoint to fetch Hong Kong International Airport (HKG) departures and arrivals, parse the JSON, group results by hour, and plan how to handle time zones, pagination, and live updates.
Know your airport: Hong Kong International (HKG/VHHH)
Hong Kong International Airport sits on Chek Lap Kok island and serves the Hong Kong Special Administrative Region. Its IATA code is HKG and its ICAO code is VHHH. Developers often track HKG because it is a major long-haul and regional connector in East Asia, with tightly coordinated schedules across multiple terminals and extensive codeshares.
The schedules endpoint you’ll use
FlightLabs exposes a REST endpoint for schedules:
- Flight Schedules: https://www.goflightlabs.com/flights-schedules
The response contains an array of schedule objects with consistent fields for flight_number, airline, aircraft, and nested departure and arrival details. You can query this endpoint with your API key. Filtering options (e.g., airport, date ranges, direction) are available; consult the product’s documentation for the exact parameter names and formats.
Authentication: the API is key-based. Include your key in the request as directed by your account settings. The example below uses a common query-string pattern for illustration.
Copy-pasteable curls for HKG departures and arrivals
Departures from HKG
curl -s "https://www.goflightlabs.com/flights-schedules?access_key=YOUR_API_KEY"
Filter this response to HKG departures in your application layer (example code below). If you prefer server-side filtering (recommended), add the documented query parameters for airport and direction once you have your key and confirm them in the FlightLabs documentation.
Arrivals into HKG
curl -s "https://www.goflightlabs.com/flights-schedules?access_key=YOUR_API_KEY"
Similarly, filter the response to HKG arrivals on the client side, or include the official arrival filters as described in the documentation. Both examples above are fully functional with your key; the difference is in how you filter the schedules.
What the schedules response looks like
The JSON below is representative of the fields you’ll receive. Values are illustrative and use HKG to ground the example.
{
"success": true,
"data": {
"schedules": [
{
"flight_number": "CX256",
"departure": {
"airport": "LHR",
"scheduled": "2025-03-20T21:20:00Z",
"terminal": "3"
},
"arrival": {
"airport": "HKG",
"scheduled": "2025-03-21T17:10:00Z",
"terminal": "1"
},
"aircraft": {
"type": "Airbus A350-1000",
"registration": "B-LXX"
},
"airline": {
"name": "Cathay Pacific",
"iata": "CX"
}
},
{
"flight_number": "SQ872",
"departure": {
"airport": "SIN",
"scheduled": "2025-03-21T06:55:00Z",
"terminal": "3"
},
"arrival": {
"airport": "HKG",
"scheduled": "2025-03-21T10:50:00Z",
"terminal": "1"
},
"aircraft": {
"type": "Boeing 787-10",
"registration": "9V-SCA"
},
"airline": {
"name": "Singapore Airlines",
"iata": "SQ"
}
},
{
"flight_number": "CX501",
"departure": {
"airport": "HND",
"scheduled": "2025-03-21T01:30:00Z",
"terminal": "3"
},
"arrival": {
"airport": "HKG",
"scheduled": "2025-03-21T05:10:00Z",
"terminal": "1"
},
"aircraft": {
"type": "Airbus A330-300",
"registration": "B-HLW"
},
"airline": {
"name": "Cathay Pacific",
"iata": "CX"
}
},
{
"flight_number": "UO618",
"departure": {
"airport": "HKG",
"scheduled": "2025-03-21T02:15:00Z",
"terminal": "1"
},
"arrival": {
"airport": "TPE",
"scheduled": "2025-03-21T04:10:00Z",
"terminal": "2"
},
"aircraft": {
"type": "Airbus A320neo",
"registration": "B-LPN"
},
"airline": {
"name": "HK Express",
"iata": "UO"
}
}
]
}
}
Key fields you will actually use:
- flight_number: The commercial flight number you will display and use for deduplication with codeshares.
- departure.airport and arrival.airport: IATA codes for routing and filtering (HKG in this article).
- departure.scheduled and arrival.scheduled: Timestamps in ISO 8601 with a Z suffix (UTC). Convert to Asia/Hong_Kong for boards.
- departure.terminal and arrival.terminal: Terminal information for wayfinding; sometimes blank depending on the carrier.
- airline.name and airline.iata: For branding and grouping by carrier.
- aircraft.type and aircraft.registration: Useful for enthusiast apps and operational dashboards.
Code: group HKG flights by hour for boards and summaries
The script below fetches schedules, extracts HKG-bound and HKG-originating flights, normalizes times to UTC, and groups by the hour block. You can choose to group by departure.scheduled for departures or arrival.scheduled for arrivals.
import os
import requests
from collections import defaultdict
from datetime import datetime
API_URL = "https://www.goflightlabs.com/flights-schedules"
API_KEY = os.getenv("FLIGHTLABS_KEY", "YOUR_API_KEY")
def fetch_schedules():
# Minimal request; add server-side filters per documentation once you have your key.
resp = requests.get(API_URL, params={"access_key": API_KEY}, timeout=30)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError("API returned success=false")
return data["data"]["schedules"]
def to_hour_bucket(iso_utc):
# iso_utc like "2025-03-21T05:10:00Z"
dt = datetime.strptime(iso_utc, "%Y-%m-%dT%H:%M:%SZ")
return dt.strftime("%Y-%m-%d %H:00Z")
def group_hkg_by_hour(schedules, direction="arrivals"):
# direction: "arrivals" groups by arrival.scheduled for flights arriving into HKG
# "departures" groups by departure.scheduled for flights leaving HKG
groups = defaultdict(list)
for s in schedules:
dep = s.get("departure", {})
arr = s.get("arrival", {})
dep_ap = dep.get("airport")
arr_ap = arr.get("airport")
if direction == "arrivals" and arr_ap == "HKG":
ts = arr.get("scheduled")
if ts:
bucket = to_hour_bucket(ts)
groups[bucket].append(s)
elif direction == "departures" and dep_ap == "HKG":
ts = dep.get("scheduled")
if ts:
bucket = to_hour_bucket(ts)
groups[bucket].append(s)
return dict(sorted(groups.items(), key=lambda kv: kv[0]))
def format_row(s):
return {
"flight": s.get("flight_number"),
"airline": s.get("airline", {}).get("name"),
"dep_airport": s.get("departure", {}).get("airport"),
"dep_terminal": s.get("departure", {}).get("terminal"),
"dep_time_utc": s.get("departure", {}).get("scheduled"),
"arr_airport": s.get("arrival", {}).get("airport"),
"arr_terminal": s.get("arrival", {}).get("terminal"),
"arr_time_utc": s.get("arrival", {}).get("scheduled")
}
if __name__ == "__main__":
schedules = fetch_schedules()
arrivals_by_hour = group_hkg_by_hour(schedules, direction="arrivals")
print("Arrivals to HKG grouped by UTC hour")
for hour, flights in arrivals_by_hour.items():
print(f"\n{hour}")
for s in flights:
print(format_row(s))
departures_by_hour = group_hkg_by_hour(schedules, direction="departures")
print("\nDepartures from HKG grouped by UTC hour")
for hour, flights in departures_by_hour.items():
print(f"\n{hour}")
for s in flights:
print(format_row(s))
Notes:
- All example times are UTC (Z). Convert to Asia/Hong_Kong (UTC+8, no DST) for passenger-facing boards.
- When you add server-side filters for HKG and date windows, your payloads will be smaller and faster to process.
Practical use cases tied to HKG schedules
- Arrival board for HKG Terminal 1: Use arrival.airport == "HKG", group by arrival.scheduled, and display arrival.terminal. Combine with airline.name for sorting and branding. If a gate concept is exposed for your plan, include it; schedules supply terminal fields directly.
- Departure delay watchlist for HKG: Start with HKG departures from schedules (departure.airport == "HKG"). Then poll the Real-time Flight Tracking endpoint for matching flights to read flight.status along with departure.actual and arrival.estimated for delay deltas. This hybrid approach keeps boards seeded by schedules while status comes from real-time.
- Codeshare-aware schedule sync: Use flight_number plus airline.iata to detect duplicates across carriers. Some apps store a canonical “operating carrier” and map codeshares to it. The schedules object gives you airline context for this deduplication.
Time zones, UTC, and display logic for HKG
The schedule timestamps are ISO 8601 with Z, which means UTC. HKG local time is Asia/Hong_Kong (UTC+8) with no daylight saving. To reduce confusion:
- Store timestamps as UTC exactly as received (the Z value).
- Convert for display to Asia/Hong_Kong. Keep UTC in logs and for comparisons with other airports.
- For cross-airport itineraries, always compute duration in UTC to avoid DST pitfalls elsewhere.
Polling frequency, caching, and error handling
Schedules are typically less volatile than live positions or status, but they still evolve (equipment swaps, retimes). A practical pattern:
- Cache schedule responses per airport and date window. A 5–15 minute cache for boards is common, while back-office syncs can cache longer.
- For status (e.g., cancellations, diversions), use the Real-time Flight Tracking endpoint alongside schedules and poll more frequently (e.g., 30–90 seconds depending on your quota and UX needs).
- Handle empty arrays gracefully. If schedules returns no items for a window, display a “No flights in this range” state.
- Expect partial data. Terminal fields can be missing depending on the carrier and data source. Render conditionally.
Pagination, filtering, and how far ahead you can see
Schedules datasets can be large at a hub like HKG. Responses may be paginated. Follow the official documentation for the exact pagination model (cursor, offset, or page-based) and the filtering parameters for airport, direction, and date/time windows. A typical approach:
- Request a bounded time window (e.g., the next 12–24 hours) for HKG to keep result sets manageable.
- Iterate through pages until you have the desired coverage for your board intervals.
- If your product needs weeks of lookahead, complement schedules with the Future Flights endpoint (https://www.goflightlabs.com/future-flights) for planning and forecasting UIs.
Important: The exact lookahead horizon and historical availability vary by endpoint. Verify the window you need in the documentation and adjust your polling and caching to fit.
How schedules and live status work together for HKG
Schedules give you the planned world; real-time gives you the operational world. At HKG, you may see the following patterns:
- Retimes: departure.scheduled and arrival.scheduled can change; refresh your schedule cache periodically.
- Delays and cancellations: Detect through the Real-time Flight Tracking endpoint. The example fields include flight.status ("en-route", "cancelled", etc.) and actual/estimated timestamps. Use these to compute delay minutes relative to the schedule, then surface alerts.
- Diversions: Use real-time position and arrival.estimated to show that a flight is no longer inbound to HKG. Schedules may still reflect the original plan until updated.
Choosing the right endpoint for your HKG use case
| Endpoint | Primary purpose | Useful fields for HKG | Typical refresh | Good for |
|---|---|---|---|---|
| Flight Schedules (https://www.goflightlabs.com/flights-schedules) | Planned departures/arrivals | flight_number, departure.scheduled, arrival.scheduled, terminal, airline.iata | 5–15 minutes or on-demand | Boards, roster sync, preflight planning |
| Real-time Flight Tracking (https://www.goflightlabs.com/real-time) | Operational status and movement | flight.status, departure.actual, arrival.estimated, position | 30–90 seconds depending on UX | Delay alerts, diversion detection, live maps |
| Future Flights (https://www.goflightlabs.com/future-flights) | Lookahead schedules | Future schedule objects consistent with schedules | On-demand | Planning calendars, inventory prep |
| Flight History (https://www.goflightlabs.com/flights-history) | Past operations | Historical schedules and outcomes | On-demand | Performance analytics, trend lines |
Implementation checklist for HKG schedules
- Get an API key and confirm the filtering and pagination parameters for schedules.
- Start with a bounded time window around “now” in UTC; convert to Asia/Hong_Kong for display.
- Group results by hour for boards; deduplicate any codeshares based on flight_number and airline.iata.
- Refresh schedules periodically; layer real-time status for cancellations, delays, and diversions.
- Cache responses and handle empty/missing terminal fields gracefully.
FAQ
How do I convert the UTC schedule times to Hong Kong local time?
The schedule fields use ISO 8601 with Z (UTC). Convert to Asia/Hong_Kong (UTC+8, no DST). Store UTC internally and format for display in local time.
Can I request only HKG departures or only arrivals?
Yes. The schedules endpoint supports filtering. Use the officially documented parameters for airport, direction, and time windows once you have your key. In the meantime, you can filter client-side as shown in the sample code.
Where do I get delay or cancellation status for HKG flights?
Use the Real-time Flight Tracking endpoint in tandem with schedules. Check flight.status along with departure.actual and arrival.estimated to compute delays versus schedule.
How should I handle pagination?
Large schedule sets are usually paginated. Inspect the schedules response for pagination cues described in the documentation and loop through pages until you cover your target time window.
How far into the future are schedules available?
Availability varies. For deeper lookahead, combine the schedules endpoint with the Future Flights endpoint. Check the documentation for your plan’s horizon and any constraints.
Ready to implement HKG boards and alerts? Review the parameter details in the FlightLabs documentation, then generate your credentials and start building with real data. Get your FlightLabs API key and ship your HKG schedule integration today.