Cathay Pacific (LAX) Routes API
You need to build or improve a Cathay Pacific (CX) routes and schedules view anchored on Los Angeles International Airport (LAX), and wire it to live flight data your team can trust. By the end of this guide, you’ll know how to query FlightLabs for CX schedules around LAX, interpret the JSON you get back, and ship route-aware features like status pages, delay monitors, and route analysis for planning.
About Cathay Pacific and why CX + LAX matters for routing
Cathay Pacific (IATA: CX) is based in Hong Kong and operates long-haul and regional services. LAX is a major U.S. gateway where developers commonly need to surface CX long-haul operations, build route-level visuals, and monitor schedule changes that affect downstream logistics and customer messaging.
In this article we’ll focus on pulling Cathay Pacific schedules that include LAX, understanding the data model for status and timing fields, and comparing which FlightLabs endpoints to combine for a robust CX+LAX route experience.
Which FlightLabs endpoints to use for Cathay Pacific routes at LAX
There are three categories to combine when you’re building route experiences for CX around LAX:
- Scheduling and Planning:
- Flight Schedules: https://www.goflightlabs.com/flights-schedules
- Future Flights: https://www.goflightlabs.com/future-flights
- Flight Data (for live updates on a scheduled route):
- Real-time Flight Tracking: https://www.goflightlabs.com/real-time
- Flight Information by Callsign: https://www.goflightlabs.com/flights-with-callSign
- Airline Flights: https://www.goflightlabs.com/flights-airline
- Detailed Flight Info: https://www.goflightlabs.com/flight-info-by-flight-number
- Reference Data (to map airline and airport context):
- Routes: https://www.goflightlabs.com/retrieve-routes
For CX routes involving LAX, developers typically start with Flight Schedules filtered by the airline IATA code (CX). Then, they enrich each scheduled leg with real-time status for departures and arrivals when a flight window is active.
How to query Cathay Pacific schedules you can map to LAX
Schedules are retrieved from the API host at https://api.goflightlabs.com. As documented for schedules, use the endpoint path /flights-schedules with the parameters iataCode and type. The iataCode value will be CX for Cathay Pacific, and type defines the scheduling context. Refer to the documentation to confirm allowed values for type based on your use case (airline-level, departure-centric, or arrival-centric queries).
Curl example: fetch Cathay Pacific schedules
This request filters schedules by the airline IATA code (CX). Replace YOUR_API_KEY with your key.
curl -G "https://api.goflightlabs.com/flights-schedules" \
--data-urlencode "iataCode=CX" \
--data-urlencode "type=airline" \
--data-urlencode "api_key=YOUR_API_KEY"
Notes:
- Use URL encoding for parameters, especially when automating.
- Use type to determine whether you’re fetching by airline, origin, or destination perspective. Validate types in the Documentation.
- Filter in your application to isolate schedules where departure.airport === "LAX" or arrival.airport === "LAX".
JavaScript example: retrieve and filter for LAX
async function fetchCathayLAXSchedules() {
const params = new URLSearchParams({
iataCode: "CX",
type: "airline",
api_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 body = await res.json();
// Expect a structure similar to the official schedules example shown below.
// Filter for LAX as either origin or destination.
const schedules = (body.data && body.data.schedules) || [];
const laxRelated = schedules.filter(s => {
const dep = s.departure && s.departure.airport;
const arr = s.arrival && s.arrival.airport;
return dep === "LAX" || arr === "LAX";
});
// Map what you need for route displays
return laxRelated.map(s => ({
flightNumber: s.flight_number,
airlineIata: s.airline && s.airline.iata,
from: s.departure && s.departure.airport,
to: s.arrival && s.arrival.airport,
depScheduledUtc: s.departure && s.departure.scheduled,
arrScheduledUtc: s.arrival && s.arrival.scheduled,
depTerminal: s.departure && s.departure.terminal,
arrTerminal: s.arrival && s.arrival.terminal,
aircraft: s.aircraft && s.aircraft.type
}));
}
// Example usage
fetchCathayLAXSchedules()
.then(list => console.log("CX schedules touching LAX:", list))
.catch(err => console.error(err));
Understanding the response fields you’ll use
Below are official sample payloads that illustrate how FlightLabs structures schedules and live tracking. When you query for Cathay Pacific (CX), expect analogous structures with CX values for airline.iata and relevant LAX fields in the departure or arrival sections.
Official sample: Flight Schedule
{
"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"
}
}
]
}
}
Key fields you’ll rely on for CX + LAX use cases:
- flight_number: Tie to real-time status or display it directly in route listings.
- departure.airport and arrival.airport: Filter for LAX involvement; build origin–destination routes.
- departure.scheduled and arrival.scheduled: These timestamps are ISO 8601 in UTC (Z). Convert to local time zones in the client.
- departure.terminal and arrival.terminal: Useful for airport signage or app gate/terminal hints (if present).
- aircraft.type and aircraft.registration: Provide aircraft context for travelers and analysts.
- airline.iata: For filtering by CX specifically.
Official sample: Real-time Flight Tracking
{
"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 these fields help for CX + LAX route displays:
- status: Determine whether a CX flight is scheduled, en-route, landed, etc. Use this to color-code or order flights in dashboards.
- departure.actual vs. departure.scheduled: Calculate departure delay minutes; feed delay monitors.
- arrival.estimated vs. arrival.scheduled: Estimate arrival delays at LAX and adjust downstream logistics.
- terminal and gate: Surface the operational experience for passengers and meet-and-greet services.
- position: Plot live location when flights are active along CX routes to or from LAX.
End-to-end flow for CX routes into/out of LAX
- Pull schedules filtered by iataCode=CX using /flights-schedules.
- Filter in your app to include only those with LAX as departure.airport or arrival.airport.
- For flights in the current or near-future window, call a real-time endpoint to enrich each item with status, actual/estimated times, and gates.
- Normalize timestamps to UTC internally; convert to airport local time zones in the UI layer.
- Cache schedule payloads for a reasonable TTL (for example, 30–60 minutes) and poll live status more frequently during active flight windows (for example, every 30–90 seconds, mindful of your plan limits).
Comparison: which endpoints to use at which step
| Endpoint | Primary Use in CX + LAX flow | Key Fields | Freshness | Notes |
|---|---|---|---|---|
| /flights-schedules (Scheduling and Planning) | Seed Cathay Pacific route lists; filter to LAX | flight_number, departure.scheduled, arrival.scheduled, airline.iata, aircraft.type | Schedule-level; less frequent updates | Use iataCode=CX and type per docs; paginate if the airline-day is large |
| Real-time (Flight Data) | Overlay status, gate, and delay info | status, departure.actual, arrival.estimated, terminal, gate, position | Live; poll during flight windows | Join by flight number and date window; cache bursts responsibly |
| Retrieve Routes (Reference Data) | Baseline network map for CX | Airline and airport route pairs | Reference | Use alongside schedules to verify coverage; schema per documentation |
Use cases tied to Cathay Pacific routes at LAX
1) Flight status page for CX services at LAX
Start with /flights-schedules filtered to CX, then restrict to LAX as either the origin or destination. For each flight window that’s current or imminent, call a real-time endpoint and read:
- status to show whether it’s scheduled, en-route, landing, or arrived.
- departure.actual against departure.scheduled to compute delay minutes.
- arrival.estimated and terminal/gate to present where travelers should go at LAX.
For historical flights, use the flights history category page (https://www.goflightlabs.com/flights-history) to ground truth delays and ETAs against past behavior.
2) Delay monitoring and proactive messaging
To monitor CX flights bound for LAX, read both:
- departure.scheduled and arrival.scheduled from schedules (UTC ISO 8601).
- actual and estimated times from the real-time flight resource.
You can compute delay deltas in UTC and only convert to local times in the UI. Edge cases to handle:
- Flight cancellations or diversions will present in the status field. Adjust messaging workflows accordingly.
- Gate and terminal changes may update closer to departure/arrival; keep a short polling cadence near T-90 to T+30 minutes.
3) Route analysis for planning CX capacity at LAX
Use the Routes reference along with the schedules endpoint to enumerate which CX city pairs include LAX and when they operate. Fields that matter:
- departure.airport and arrival.airport to build a route graph.
- aircraft.type to profile long-haul vs. regional deployments.
- airline.iata to ensure only CX is included across your dataset.
For upcoming periods, you can cross-check with Future Flights to model route forecasts and operational windows.
Time zones, polling, and pagination details you’ll want on day one
- Timestamps: Scheduled, actual, and estimated fields are shown in ISO 8601 UTC (Z). Convert to local time zones (e.g., America/Los_Angeles for LAX) in your UI. Keep all calculations in UTC for consistency.
- Live polling: Poll real-time endpoints more frequently only when a flight is within its active window. Outside that window, rely on schedules and cache results with a reasonable TTL to conserve requests.
- Cancelled/diverted flights: Check the status field. Your UI should clearly differentiate cancelled, diverted, and delayed states, and you should suppress gate info if it’s no longer applicable.
- Pagination: Schedule queries for an airline can return multiple flights. Implement pagination handling if the response indicates multiple pages. If your use case is focused on LAX, filter early to reduce processing.
- Caching: Cache schedules for CX at LAX in a short-term store (e.g., 30–60 minutes) and invalidate around schedule change windows. Cache real-time data for seconds to a couple of minutes based on your refresh strategy.
Bringing it together in your app architecture
For a Cathay Pacific routes module anchored at LAX, a straightforward architecture looks like this:
- Backend worker runs periodic CX schedule pulls via /flights-schedules (iataCode=CX, type per docs). Results are normalized and cached.
- Edge function or API layer filters cached schedules by LAX and enriches with real-time fields during relevant windows to compose a route-aware status payload.
- Client layer requests the composed payload, renders local times for both origin and destination, and displays terminals/gates when available.
If you also need analyst views for planning, schedule a daily export of routes and schedules to your data warehouse and join against operational outcomes from real-time or history endpoints.
End-to-end example: from schedules to live status
Step 1: Query schedules for CX
Use the curl above (iataCode=CX). Store the schedules that reference LAX in either the departure or arrival nodes.
Step 2: Enhance active flights with real-time data
Call a real-time endpoint for the specific flight. Refer to the official real-time sample structure above. Use fields:
- status to define the operational state.
- departure.actual and arrival.estimated to compute deltas from scheduled times.
- terminal and gate for passenger experience data near LAX.
Step 3: Present the final Cathay Pacific route card
Each CX route that includes LAX can display:
- Flight number (from schedules); airline IATA should be CX.
- Origin–destination pair (airport IATA codes); highlight LAX when appropriate.
- Scheduled and actual/estimated times in local time zones.
- Status-driven UI badges and optional live map plotting when position is present.
Authentication, environment, and where to try calls
All requests are authenticated with an API key. Get yours here: Register. You can also browse feature overviews and sample schemas on www.goflightlabs.com, and use the MCP to explore and test endpoints during development.
FlightLabs offers a Starter plan at $24.99/month and a trial (7 days or 50 requests). Confirm current plan details on goflightlabs.com before you scale.
Error handling and operational reliability
- Transport errors: Handle non-2xx responses with retries and exponential backoff, especially in polling loops.
- Empty or partial schedule windows: If a window returns no data (e.g., seasonal routes), fall back to future schedules to confirm upcoming operations.
- Data alignment: Match flights across schedules and real-time data using flight number and time windows. If callsigns vary by operational day, prefer date-scoped joins.
Testing strategy for CX + LAX integrations
- Unit-test schedule filtering to ensure only routes with LAX are included.
- Mock real-time status transitions (scheduled → en-route → landed) using the official response structure to validate UI states.
- Verify UTC-to-local conversions for both Hong Kong and Los Angeles time zones, including DST boundaries for LAX.
- Simulate cancellations and diversions by testing status-handling paths in your UI and messaging workflows.
What “good” looks like in production
- Schedules cached and refreshed periodically for CX, filtered to LAX on access.
- Real-time polling enabled only for flights in an active window, with graceful backoff.
- UI shows correct local times, terminal/gate when available, and delay deltas computed in UTC.
- Analytics layer receives normalized route records for CX with on-time deltas for LAX arrivals.
FAQ
- How do I filter only Cathay Pacific flights that touch LAX? Query /flights-schedules with iataCode=CX and an appropriate type per the documentation. In your app, filter the returned schedules where departure.airport === "LAX" or arrival.airport === "LAX".
- How should I handle time zones for CX long-haul flights? Keep all arithmetic in UTC using the ISO 8601 fields (scheduled, actual, estimated). Convert to local time at render time for HKG and LAX to avoid DST pitfalls.
- What’s the right polling cadence for real-time tracking? Poll more frequently only during active flight windows (for example, every 30–90 seconds). Outside that, rely on cached schedules to reduce load and stay within plan limits.
- How do I detect a cancelled or diverted flight? Inspect the status field in the real-time response. Adjust your UI and notifications to reflect cancellations or diversions and suppress gate/terminal details that are no longer valid.
- Where can I confirm available parameters like “type” for schedules? Refer to the official Documentation for parameter options and response schemas across endpoints.
Ready to build your Cathay Pacific routes module for LAX with schedule, real-time, and route reference in one place? Get your API key on the Register page, explore endpoints via the MCP, and ship your first CX+LAX route view today.