Best API to Access Shanghai Pudong International Airport (PVG) Flights Schedules Data in 2025
You need a dependable way to pull Shanghai Pudong International Airport flight schedules into your app. By the end of this guide, you’ll query schedules anchored to PVG, parse the JSON you receive, group flights by hour, and design for time zones, pagination, and live status checks—all using the FlightLabs API.
Shanghai Pudong (PVG): what you’re integrating
Shanghai Pudong International Airport serves the Pudong area of Shanghai, China. Its IATA code is PVG and its ICAO code is ZSPD. Developers frequently track PVG because it is a major hub for long-haul and regional connections across Asia, Europe, and North America, with frequent time zone boundaries and high schedule density.
The schedules endpoint you will use
For departure and arrival schedules, use the Flight Schedules endpoint:
https://www.goflightlabs.com/flights-schedules
The endpoint returns schedule items that include:
- flight_number
- departure: airport (IATA), scheduled (ISO 8601 in UTC), terminal, gate if available
- arrival: airport (IATA), scheduled (ISO 8601 in UTC), terminal, gate if available
- aircraft: type, registration
- airline: name, iata
Authentication is via API key. Filtering options (e.g., by airport and by direction) are available in the documentation; the exact parameter names and combinations can vary by plan. The examples below demonstrate a common pattern for departures and arrivals using PVG. Adjust to match your account’s documented query parameters.
Copy-paste requests for PVG departures and arrivals
Departures from PVG
curl -G "https://www.goflightlabs.com/flights-schedules" \
--data-urlencode "airport=PVG" \
--data-urlencode "direction=departure" \
--data-urlencode "date=2025-03-20" \
--data-urlencode "access_key=YOUR_API_KEY"
Arrivals to PVG
curl -G "https://www.goflightlabs.com/flights-schedules" \
--data-urlencode "airport=PVG" \
--data-urlencode "direction=arrival" \
--data-urlencode "date=2025-03-20" \
--data-urlencode "access_key=YOUR_API_KEY"
Notes:
- These examples illustrate filtering by airport (PVG), direction (departure or arrival), and a calendar date. Confirm the exact parameter names in the FlightLabs documentation.
- All timestamps in the examples below are illustrative and returned in UTC with “Z”.
What the JSON looks like (PVG-focused)
A compact example of a schedules response, showing a few flights tied to PVG. Field names and structure follow the documented sample schema; values are illustrative.
{
"success": true,
"data": {
"schedules": [
{
"flight_number": "MU717",
"departure": {
"airport": "PVG",
"scheduled": "2025-03-20T00:45:00Z",
"terminal": "1"
},
"arrival": {
"airport": "NRT",
"scheduled": "2025-03-20T04:20:00Z",
"terminal": "2"
},
"aircraft": {
"type": "Airbus A321",
"registration": "B-123A"
},
"airline": {
"name": "China Eastern Airlines",
"iata": "MU"
}
},
{
"flight_number": "DL288",
"departure": {
"airport": "PVG",
"scheduled": "2025-03-20T02:10:00Z",
"terminal": "2"
},
"arrival": {
"airport": "SEA",
"scheduled": "2025-03-20T15:55:00Z",
"terminal": "S"
},
"aircraft": {
"type": "Airbus A350-900",
"registration": "N512DN"
},
"airline": {
"name": "Delta Air Lines",
"iata": "DL"
}
},
{
"flight_number": "AF125",
"departure": {
"airport": "CDG",
"scheduled": "2025-03-19T19:30:00Z",
"terminal": "2E"
},
"arrival": {
"airport": "PVG",
"scheduled": "2025-03-20T11:55:00Z",
"terminal": "2"
},
"aircraft": {
"type": "Boeing 777-300ER",
"registration": "F-GZNE"
},
"airline": {
"name": "Air France",
"iata": "AF"
}
}
]
}
}
Fields you’ll actually use:
- flight_number: your primary per-flight identifier for UI listing; pair with airline.iata for display.
- departure.airport and arrival.airport: IATA codes to filter PVG departures vs PVG arrivals.
- departure.scheduled and arrival.scheduled: UTC schedule times to slot flights into hourly buckets and for countdown timers.
- terminal (in both departure and arrival): show which terminal to display on airport boards or pickup instructions.
- aircraft.type and aircraft.registration: useful for enthusiast apps or gate/stand planning.
For live status (e.g., scheduled vs en-route vs landed or cancelled), combine schedules with the Real-time Flight Tracking endpoint: https://www.goflightlabs.com/real-time. That endpoint returns a status field such as “scheduled”, “en-route”, “landed”, “delayed”, etc., plus terminal/gate updates when available.
Code: group PVG schedules by hour
The snippet below fetches schedules for PVG and groups flights by the UTC hour of their scheduled time. You can swap “direction=departure” for “direction=arrival” using the same pattern (confirm parameter names in the documentation).
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_pvg(direction="departure", date_iso="2025-03-20"):
params = {
"airport": "PVG", # confirm exact parameter name in documentation
"direction": direction, # "departure" or "arrival"
"date": date_iso, # ISO date string, e.g., 2025-03-20
"access_key": API_KEY
}
r = requests.get(API_URL, params=params, timeout=30)
r.raise_for_status()
payload = r.json()
if not payload.get("success"):
raise RuntimeError(f"API error: {payload}")
return payload["data"]["schedules"]
def group_by_utc_hour(schedules, side="departure"):
buckets = defaultdict(list)
for s in schedules:
ts = s.get(side, {}).get("scheduled")
if not ts:
continue
# Example timestamp: "2025-03-20T02:10:00Z"
dt = datetime.strptime(ts, "%Y-%m-%dT%H:%M:%SZ")
hour_key = dt.strftime("%Y-%m-%d %H:00Z")
buckets[hour_key].append(s)
return buckets
if __name__ == "__main__":
schedules = fetch_pvg(direction="departure", date_iso="2025-03-20")
buckets = group_by_utc_hour(schedules, side="departure")
for hour, flights in sorted(buckets.items()):
print(hour, f"({len(flights)} flights)")
for f in flights:
airline = f.get("airline", {}).get("iata", "")
fn = f.get("flight_number", "")
arr = f.get("arrival", {}).get("airport", "")
term = f.get("departure", {}).get("terminal", "")
print(f" {airline}{fn} -> {arr} Terminal {term}")
Why UTC? The schedule timestamps are returned in UTC. If your app needs local time at PVG (Asia/Shanghai), convert at the UI layer and always store a canonical UTC timestamp to avoid daylight saving shifts on other routes.
Use cases tied to PVG schedules
- Airport arrival boards for PVG: filter schedules where arrival.airport == "PVG", group by hour, and display airline.iata + flight_number, arrival.scheduled, and arrival.terminal. Overlay live status from the real-time endpoint’s status field for “delayed” or “landed”.
- Departure delay alerts from PVG: track departure.airport == "PVG"; compare departure.scheduled to the real-time endpoint’s arrival/estimated or departure/actual for drifts. Trigger notifications when status moves to “delayed” or when “actual” deviates from “scheduled”.
- Schedule sync for corporate travel: nightly pull of PVG arrivals and departures using the Flight Schedules endpoint; write into a calendar system keyed by airline.iata + flight_number, keeping terminal changes and aircraft.type as metadata.
How FlightLabs endpoints fit together for PVG
Below is a technical comparison of which endpoint to call and when for PVG-focused workflows:
| Endpoint | Primary purpose | Relevant fields | When to use with PVG |
|---|---|---|---|
| Flight Schedules | Timetabled departures and arrivals | flight_number, departure/arrival.scheduled, terminal, airline, aircraft | Build PVG day-of boards, hourly overviews, and preflight planning |
| Real-time Flight Tracking | Up-to-the-minute status and movement | status, departure.actual, arrival.estimated, gates, position | Overlay live status on PVG schedules, handle delays/cancellations/diversions |
| Future Flights | Planning beyond the near-term schedule window | Forward-looking schedule metadata | Forecast and capacity planning for PVG routes weeks/months ahead |
| Flight History | Past movements and timings | Historical schedule vs actual, terminals, gates | On-time analysis and post-event auditing for PVG departures/arrivals |
Time zones, polling, and caching considerations
- Timestamps and time zones: The schedules endpoint returns ISO 8601 timestamps in UTC (e.g., 2025-03-20T02:10:00Z). For PVG, convert to Asia/Shanghai at display time while storing UTC internally.
- Polling frequency: Schedules are less volatile than live tracking, so polling every 5–10 minutes for near-term windows is typically sufficient. If you pair with Real-time Flight Tracking for PVG gates and status, reduce the interval (e.g., 30–90 seconds) for flights departing or arriving within the next 2 hours.
- Caching: Cache stable schedule data (flight_number, planned times, aircraft.type) aggressively for the calendar day. Apply short TTLs (e.g., 1–5 minutes) to terminal/gate and any fields you promote to “live”, refreshing via the Real-time endpoint when the flight is close.
- Handling cancelled or diverted flights: The schedules payload is the plan; use Real-time Flight Tracking to read status for operational changes. If the real-time status indicates “cancelled” or “diverted”, mark the corresponding PVG schedule row accordingly.
Pagination, filtering, and how far ahead you can pull PVG schedules
Pagination: The schedules endpoint is paginated. Use the pagination parameters described in the documentation to step through result sets when PVG traffic is high (e.g., overnight long-hauls and morning peaks). If you’re generating full-day boards, iterate pages until no more schedules are returned, and persist a cursor or page index for resumable fetching.
Filtering: Filter server-side by airport and direction (departures vs arrivals) to reduce payload and latency. You can also filter by date or time range to focus on an operating window, then refine client-side for display groupings or airline-specific lists. Confirm the exact filter names in the documentation for your account.
Schedule horizon: FlightLabs provides a “Flight Schedules” view for near-term and a “Future Flights” endpoint for longer-range planning. For PVG planning beyond the schedules window (e.g., multiple weeks ahead), use Future Flights and transition to the schedules and real-time endpoints as the day approaches.
Putting it all together for PVG
A reliable PVG workflow often looks like this:
- At T-24h: Pull PVG arrivals and departures via the Flight Schedules endpoint in hourly batches, store UTC timestamps, airline.iata, flight_number, and terminals.
- At T-2h to T+1h: For flights nearing operation, enrich schedules with Real-time Flight Tracking to get status, gates, departure.actual, and arrival.estimated.
- For forward planning: Use Future Flights for PVG routes after the schedules window, and reconcile with schedules as the operating day approaches.
Balanced technical comparison: what to consider for PVG builds
- Coverage and freshness: Combine the schedules endpoint (planned) with real-time (operational) to capture both intent and execution for PVG’s long-haul mix.
- Data model fit: The schedules schema is compact and predictable (flight_number, departure/arrival, airline, aircraft). This makes it straightforward to map to common UI components like hour buckets and gate boards.
- Integration cost: REST+JSON over a single base domain, no SDK required. Most apps can ship with one schedules call plus an optional real-time enrichment pass.
- Operational behavior: Handle time zones at the edge, cache aggressively, and page through PVG’s busy windows. Add status-aware UX states to gracefully present delays, cancellations, or diversions.
FAQ
How do I distinguish PVG departures from PVG arrivals?
Use server-side filters for the airport (PVG) and the direction (departures vs arrivals), then confirm that departure.airport == "PVG" for departures and arrival.airport == "PVG" for arrivals in the returned objects.
Are schedule timestamps local to PVG or UTC?
Schedules are returned as ISO 8601 timestamps in UTC. Convert to Asia/Shanghai at display time while keeping UTC in storage and for comparisons.
How do I get cancellations or gate changes for PVG flights?
Pair schedules with the Real-time Flight Tracking endpoint. It includes a status field and often terminal/gate updates. Use it to override the planned schedule when the flight is within your live window.
What if there are too many PVG flights for a single response?
Use the pagination parameters provided in the documentation to iterate through results. For full-day displays, loop until no additional pages are available, and cache results by hour.
How far ahead can I query PVG schedules?
Use the schedules endpoint for near-term operations. For longer horizons, switch to the Future Flights endpoint and reconcile to schedules as the operating day nears.
Ready to build PVG schedules into your product? Read the FlightLabs documentation and Get your FlightLabs API key to start integrating today.