Flight Schedules API for Tokyo Haneda Airport (HND): constructing date-range requests and handling delays
You need to pull a dependable list of flights for Tokyo Haneda (HND), query it across a date range, and surface delay-aware arrival or departure boards in your app. By the end of this guide, you will know how to call the FlightLabs schedules endpoint for HND, iterate across time windows safely, combine schedules with live status to handle delays, and ship alerts and displays that stay trustworthy throughout the day.
Why HND matters for your application
Tokyo Haneda Airport (IATA: HND, ICAO: RJTT) serves central Tokyo and is one of Japan’s primary international and domestic hubs. Developers track HND to power live arrival boards, passenger notifications, logistics timing, and day-of-operations tooling where a few minutes of delay can cascade across connections.
Endpoint overview: retrieving flight schedules for HND
The schedules API groups planned flights by airport and movement type. For Haneda, you filter by its IATA code and whether you want arrivals or departures:
- Base URL: https://api.goflightlabs.com
- Path: /flights-schedules
- Query parameters:
- iataCode: the airport IATA code (use HND)
- type: arrival or departure
Authentication uses an API key. If you don’t have one yet, you can create it from the FlightLabs site. See the FlightLabs homepage and the Documentation for details.
Copy-pasteable curl (HND arrivals)
curl -G "https://api.goflightlabs.com/flights-schedules" \
--data-urlencode "iataCode=HND" \
--data-urlencode "type=arrival" \
--data-urlencode "access_key=YOUR_API_KEY"
What a schedules payload looks like
Below is the official sample structure for a schedules response. While this example references SFO and ORD, the JSON shape is the same you’ll use for HND arrivals or departures.
{
"success": true,
"data": {
"schedules": [
{
"flight_number": "UA456",
"departure": {
"airport": "SFO",
"scheduled": "2024-03-20T08:00:00Z",
"terminal": "3"
},
"arrival": {
"airport": "ORD",
"scheduled": "2024-03-20T14:15:00Z",
"terminal": "1"
},
"aircraft": {
"type": "Boeing 787-9",
"registration": "N123UA"
},
"airline": {
"name": "United Airlines",
"iata": "UA"
}
}
]
}
}
Fields you will rely on most for HND schedules:
- data.schedules[].flight_number: for display and correlation with status.
- data.schedules[].departure.scheduled and data.schedules[].arrival.scheduled: ISO 8601 timestamps in UTC you should convert to Asia/Tokyo for user-facing times.
- data.schedules[].departure.terminal and data.schedules[].arrival.terminal: useful for signage and wayfinding at HND terminals.
- data.schedules[].airline.iata and .name: useful for filtering or branding in your UI.
- data.schedules[].aircraft.*: optional for aircraft-aware apps (seat maps, ops planning).
JavaScript example: render an HND arrivals board from schedules
async function fetchHndArrivals() {
const params = new URLSearchParams({
iataCode: 'HND',
type: 'arrival',
access_key: 'YOUR_API_KEY'
});
const url = `https://api.goflightlabs.com/flights-schedules?${params.toString()}`;
const res = await fetch(url);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const json = await res.json();
// Expect: { success: true, data: { schedules: [ ... ] } }
const schedules = (json && json.data && Array.isArray(json.data.schedules))
? json.data.schedules
: [];
// Transform for a simple arrivals board, converting UTC to local time where your UI runs.
// Note: Convert with a library like Luxon/Temporal for production use.
return schedules.map(s => {
const flt = s.flight_number;
const airline = (s.airline && s.airline.iata) ? s.airline.iata : '';
const etaUtc = s.arrival && s.arrival.scheduled;
const terminal = s.arrival && s.arrival.terminal;
return {
flight: `${airline}${flt}`,
scheduledArrivalUtc: etaUtc,
terminal: terminal || null,
from: s.departure && s.departure.airport
};
});
}
fetchHndArrivals()
.then(rows => console.table(rows))
.catch(err => console.error(err));
Constructing date-range requests for HND
The schedules endpoint is designed around an airport and a movement type. When you need a broader window (e.g., “all HND arrivals from Friday through Sunday”), implement a date-range workflow by splitting the time window into slices and caching results:
- Choose a time slice that matches your UI and cache TTL (e.g., one calendar day per slice for arrivals, then stitch results).
- Run two passes per slice: type=arrival and type=departure as needed for your use case.
- Persist results in your database keyed by UTC date, airport, and type. Reuse slices that fall entirely in the past to minimize calls.
- For near-term windows (e.g., next 6–12 hours), schedule more frequent refreshes because operators may publish adjustments close to departure.
Time zones: timestamps such as departure.scheduled and arrival.scheduled are in UTC. For customer-facing experiences at Haneda, convert to Asia/Tokyo. If you need to assemble “local day” queries, align your slice boundaries to midnight Asia/Tokyo while still sending/receiving UTC in the API response—your app handles the conversion.
From planned to live: handling delays, diversions, and gates for HND
Schedules are a plan. To keep boards and notifications trustworthy, augment them with real-time status and timing fields like actual or estimated times, gates, and terminals. Here is the official real-time example (structure representative of what you’ll use to enrich HND schedules):
{
"success": true,
"data": {
"flight": {
"iata": "AA123",
"icao": "AAL123",
"number": "123",
"status": "en-route",
"departure": {
"airport": "JFK",
"scheduled": "2024-03-20T10:00:00Z",
"actual": "2024-03-20T10:05:00Z",
"terminal": "8",
"gate": "B12"
},
"arrival": {
"airport": "LAX",
"scheduled": "2024-03-20T13:15:00Z",
"estimated": "2024-03-20T13:20:00Z",
"terminal": "4",
"gate": "45A"
},
"position": {
"latitude": 39.8729,
"longitude": -98.7372,
"altitude": 35000,
"speed": 495,
"heading": 270
}
}
}
}
How to use these fields with HND schedules:
- Match by airline + flight_number (and date) to align a scheduled row with a live row. The iata flight code and number are common keys.
- status: power UI badges (e.g., “en-route”, “scheduled”, and—if present—“canceled”, “landed”, or similar). Handle cancelations gracefully by hiding from customer boards or marking “Canceled”.
- departure.actual vs. departure.scheduled and arrival.estimated vs. arrival.scheduled: compute delays in minutes and color-code in your board.
- terminal and gate: show the latest gate assignment, which can change within hours of departure at HND. Prefer real-time gates when available over scheduled gates.
- position: optional, useful for maps and ETAs for inbound HND flights.
Polling and caching strategy at HND:
- Schedules: refresh every 30–60 minutes for the next 24 hours; cache beyond 24 hours and backfill only if you detect changes.
- Live status: for flights departing/arriving within the next 3 hours at HND, poll more frequently (e.g., every 2–5 minutes) and use a short TTL cache per flight ID. Increase the interval once a flight is “landed” or “canceled.”
- Backoff: if you hit throttling, apply exponential backoff and widen your refresh intervals temporarily.
Comparing FlightLabs endpoints you will combine for HND
Each endpoint solves a different part of the planning-to-ops pipeline. Here’s how they fit together for HND use cases:
| Endpoint | Primary purpose | Freshness | Useful fields for HND | Typical usage |
|---|---|---|---|---|
| /flights-schedules | Planned arrivals/departures by airport | Planned; update periodically | flight_number, departure/arrival.scheduled, terminal | Daily and intra-day boards; date-range planning |
| Real-time Flight Tracking | Live status and positions | Near real-time | status, actual/estimated times, terminal, gate, position | Delay alerts; gate boards; inbound monitoring |
| Future Flights | Forward-looking planning | Schedule-level | Future availability by route/airport | Publishing future boards; planning capacity |
| Flight History | Past operations | Historical | Past actuals, timings | Analytics, post-ops audits, training ML models |
These endpoints are described at a high level here; implementation details and filters are covered in the Documentation. For testing queries and troubleshooting payloads, use the MCP.
Three practical HND use cases you can ship
1) Arrival boards in terminals or lounges
- Primary feed: /flights-schedules with iataCode=HND&type=arrival.
- Fields: arrival.scheduled, flight_number, airline.iata, arrival.terminal.
- Enrichment: merge real-time arrival.estimated and gate for the latest ETA and gate display.
2) Delay and gate-change alerts for passengers
- Primary feed: match schedules to real-time by flight_number + airline code.
- Fields: status transitions plus scheduled vs. actual/estimated to compute delay deltas; terminal/gate for gate-change triggers.
- Logic: send notifications on threshold crossings (e.g., delay ≥ 15 minutes, gate changed from X to Y).
3) Corporate calendar sync for HND travelers
- Primary feed: schedules for departures from HND and arrivals into HND across the traveler’s dates.
- Fields: departure.scheduled and arrival.scheduled for creating calendar blocks; airline and flight_number for event titles.
- Enrichment: update events with real-time actual/estimated as the travel day approaches.
Time, time zones, and data hygiene
- All times in the samples are ISO 8601 UTC (e.g., 2024-03-20T08:00:00Z). Convert to Asia/Tokyo for HND-facing UIs and keep UTC keys for database joins and caching.
- Store both “scheduled” and “actual/estimated” where available. When both exist, prefer actual/estimated for customer messaging.
- Codeshares: when present in real-time or schedule feeds, normalize on a primary operating carrier + flight number to avoid duplicate rows in boards.
Throughput, pagination, and caching for schedules
For large airports like HND, a single schedules query can return many flights. If the schedules endpoint paginates, follow the response’s pagination cues as documented and merge pages in your cache before rendering. Because the exact pagination fields aren’t detailed here, implement a resilient fetcher:
- Loop until the response indicates no further pages; store each page atomically.
- Cache by (airport, type, UTC-date-slice, page) with a reasonable TTL; assemble from cache first, then refresh in the background.
- Use idempotent upserts keyed by (flight_number, airline code, scheduled departure date) to avoid duplicates when refetching.
Error handling, retries, and testing with MCP
- Handle non-200 responses by backing off and retrying a limited number of times. Log request IDs where available.
- Treat network timeouts the same as errors: retry with jitter to avoid thundering herds at the top of the hour when many apps refresh boards.
- Validate schema before use: check that data and data.schedules exist before accessing fields.
- Use the MCP to craft and debug queries interactively for HND before you automate them.
Getting an API key, pricing, and next steps
FlightLabs offers a trial (7 days or 50 requests) so you can validate HND boards and alerting workflows. A Starter plan is available at $24.99/month. Create your key and start testing today: Register. While you prototype, keep the Documentation handy to confirm optional fields and pagination behavior.
FAQ
-
How do I construct a weekend-wide HND arrivals list?
Split the weekend into day slices in Asia/Tokyo time, fetch /flights-schedules for iataCode=HND&type=arrival per slice, cache the results keyed by UTC date, and merge for display. Refresh the “today” slice more frequently than “tomorrow” or “yesterday.”
-
How do I detect and display delays?
Join a schedule row with its live status. Compare arrival.estimated (or departure.actual) with the scheduled time to compute the delay in minutes. Update your board color and message based on thresholds.
-
What about canceled or diverted flights?
Use the live status field. When a cancelation or diversion is indicated, remove it from customer-facing boards or clearly mark it. Keep the record in your datastore for auditing.
-
Which time zone should I store?
Store UTC for joins and analytics; render Asia/Tokyo for HND-facing UIs. Keep both scheduled and actual/estimated fields when available.
-
How often should I poll to keep HND boards accurate?
Schedules: every 30–60 minutes. Live status: every 2–5 minutes within the next few hours of departure/arrival at HND, then slow down after final statuses.
Ready to build a dependable HND schedule board with delay-aware updates? Create your API key and start integrating in minutes: Register. For endpoint details, field definitions, and examples, keep the Documentation open as you code.