Track Virgin Atlantic Flights Live with Our Flight Info By Flight Number API (SVO).
You need to display accurate, live status for a specific Virgin Atlantic flight in your app. By the end of this guide, you will query FlightLabs by flight number, parse the status, times, terminals, gates and codeshares, and refresh that data safely in production.
About Virgin Atlantic (VS) and what we will build
Virgin Atlantic is a United Kingdom airline with IATA code VS. It primarily operates long‑haul services, with a major hub at London Heathrow. In this guide you will fetch live status for a single VS flight using the FlightLabs “Detailed Flight Info by Flight Number” endpoint and wire it into a status page or dashboard.
Endpoint to use: Detailed Flight Info by Flight Number
The FlightLabs endpoint for getting a single flight’s details by its flight number is:
- Detailed Flight Info: https://www.goflightlabs.com/flight-info-by-flight-number
This endpoint returns current status and operational details for one flight, identified by its airline flight number. The response includes fields developers need to display a complete status line: status, scheduled/estimated/actual timestamps in UTC, terminals and gates (if provided), and any in-flight position if the aircraft is airborne.
If you are new to the API or need a key, start at the documentation and sign up:
Quick start: curl request for a Virgin Atlantic flight by number
Below is a complete example using a Virgin Atlantic flight number. Replace YOUR_API_KEY with your key and VS7 with any Virgin Atlantic flight number you need to track. The values in the example response are illustrative.
curl -sG "https://www.goflightlabs.com/flight-info-by-flight-number" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "flight_number=VS7"
Example JSON payload and the fields that matter
The endpoint returns a JSON document with a top-level success flag and a data object. Here is a representative payload you can expect for a single Virgin Atlantic flight (field names mirror those shown in the FlightLabs examples; values are illustrative):
{
"success": true,
"data": {
"flight": {
"iata": "VS7",
"icao": "VIR7",
"number": "7",
"status": "en-route",
"departure": {
"airport": "LHR",
"scheduled": "2024-03-20T10:00:00Z",
"actual": "2024-03-20T10:12:00Z",
"terminal": "3",
"gate": "18"
},
"arrival": {
"airport": "JFK",
"scheduled": "2024-03-20T13:15:00Z",
"estimated": "2024-03-20T13:28:00Z",
"terminal": "4",
"gate": "B23"
},
"position": {
"latitude": 52.9011,
"longitude": -20.4420,
"altitude": 36000,
"speed": 505,
"heading": 284
},
"airline": {
"name": "Virgin Atlantic",
"iata": "VS"
},
"aircraft": {
"type": "Airbus A350-1000",
"registration": "G-VXXX"
},
"codeshares": [
{
"airline_iata": "DL",
"flight_iata": "DLXXXX"
}
]
}
}
}
Key fields to use in your UI and logic:
- flight.status: High-level state like scheduled, en-route, landed, cancelled, or diverted. Drive color badges and messaging off this.
- departure.scheduled / departure.actual: UTC timestamps. Compute departure delay as actual - scheduled when present.
- arrival.scheduled / arrival.estimated: UTC timestamps. Use for countdowns and ETAs, and to infer arrival delays.
- departure.terminal / departure.gate and arrival.terminal / arrival.gate: Useful for airport displays and wayfinding.
- position: Present when the flight is en-route; you can show a live map or textual location updates.
- aircraft: Display aircraft type and registration when available.
- codeshares: Map the same physical flight to partner flight numbers (e.g., DL codeshares).
- airline.iata: Confirms you are rendering a VS (Virgin Atlantic) service.
Time zones: All timestamps are shown in ISO 8601 UTC format (e.g., 2024-03-20T10:12:00Z). Convert to local time zones in your frontend if needed, while keeping UTC for storage and comparisons.
Minimal JavaScript: poll a VS flight and compute delays
This script calls the same endpoint, renders a concise status block, and refreshes safely. It parses UTC times, computes departure and arrival delays when possible, and handles cancelled/diverted status rendering.
async function fetchFlightByNumber(apiKey, flightNumber) {
const url = new URL("https://www.goflightlabs.com/flight-info-by-flight-number");
url.searchParams.set("api_key", apiKey);
url.searchParams.set("flight_number", flightNumber);
const res = await fetch(url.toString(), { method: "GET" });
if (!res.ok) throw new Error("Network error " + res.status);
const json = await res.json();
if (!json.success) throw new Error("API reported failure");
return json.data.flight;
}
function parseDelayMinutes(scheduledIso, actualOrEstimatedIso) {
if (!scheduledIso || !actualOrEstimatedIso) return null;
const sched = new Date(scheduledIso).getTime();
const act = new Date(actualOrEstimatedIso).getTime();
return Math.round((act - sched) / 60000);
}
function renderStatusBlock(f) {
const depDelay = parseDelayMinutes(f?.departure?.scheduled, f?.departure?.actual);
const arrDelay = parseDelayMinutes(f?.arrival?.scheduled, f?.arrival?.estimated);
return {
flight_iata: f.iata,
airline_iata: f?.airline?.iata,
status: f.status, // "scheduled", "en-route", "landed", "cancelled", "diverted", etc.
departure: {
airport: f?.departure?.airport,
terminal: f?.departure?.terminal || null,
gate: f?.departure?.gate || null,
scheduled_utc: f?.departure?.scheduled || null,
actual_utc: f?.departure?.actual || null,
delay_min: depDelay
},
arrival: {
airport: f?.arrival?.airport,
terminal: f?.arrival?.terminal || null,
gate: f?.arrival?.gate || null,
scheduled_utc: f?.arrival?.scheduled || null,
estimated_utc: f?.arrival?.estimated || null,
delay_min: arrDelay
},
aircraft: {
type: f?.aircraft?.type || null,
registration: f?.aircraft?.registration || null
},
codeshares: Array.isArray(f?.codeshares) ? f.codeshares : [],
position: f?.position || null
};
}
// Example: poll every 60 seconds with simple backoff on errors
(async function run() {
const API_KEY = "YOUR_API_KEY";
const FLIGHT_NUMBER = "VS7";
let intervalMs = 60000;
async function cycle() {
try {
const flight = await fetchFlightByNumber(API_KEY, FLIGHT_NUMBER);
const block = renderStatusBlock(flight);
console.log(JSON.stringify(block, null, 2));
intervalMs = 60000; // reset on success
} catch (e) {
console.error("Fetch error:", e.message);
intervalMs = Math.min(intervalMs * 2, 10 * 60 * 1000); // backoff, max 10 min
} finally {
setTimeout(cycle, intervalMs);
}
}
cycle();
})();
When to use Flight Info by Number vs other FlightLabs endpoints
The “Detailed Flight Info by Flight Number” endpoint is optimized for a single, known identifier (e.g., VS7) and returns status-rich, display-ready data. For broader workflows, you may combine it with other endpoints, each with different trade-offs.
| Endpoint | Best for | Key fields returned | Notes |
|---|---|---|---|
| Detailed Flight Info by Flight Number https://www.goflightlabs.com/flight-info-by-flight-number |
Single-flight, detail-rich status lookups when you already know the flight number (e.g., VS7) | flight.status, departure/arrival (scheduled, actual, estimated, terminal, gate), position, aircraft, codeshares | Use for dashboards and notifications; simplest for point lookups |
| Real-time Flight Tracking https://www.goflightlabs.com/real-time |
Live position tracking while airborne | flight.status, position (lat, lon, altitude, speed, heading), departure/arrival times | Use when you need continuous map updates |
| Flight Schedules https://www.goflightlabs.com/flights-schedules |
Building day-of and future schedule boards, pagination across many flights | flight_number, departure.scheduled/terminal, arrival.scheduled/terminal, airline, aircraft | Pair with Detailed Flight Info for live gates and status |
| Future Flights https://www.goflightlabs.com/future-flights |
Planning and booking journeys, pre-day-of visibility | Planned schedules, airline and aircraft information | Augment with status once the day-of operations begin |
| Flight Delay Predictions https://www.goflightlabs.com/flight-delay |
Risk scoring and alerts on potential delays | Delay prediction signals | Use alongside status fields to inform users proactively |
Use cases for Virgin Atlantic (VS) developers
- Flight status pages: Read flight.status plus departure/arrival timestamps. Display terminals/gates from departure.terminal, departure.gate, arrival.terminal, arrival.gate to help passengers find the right concourse.
- Delay monitoring and notifications: Compute minute deltas between scheduled and actual/estimated times to trigger user alerts when depDelay or arrDelay exceeds a threshold.
- Route and operations analysis: Combine Flight Schedules to enumerate planned VS flights, then call Flight Info by Number for same-day operational outcomes (landed vs cancelled vs diverted) and roll up metrics like average arrival delta.
Practical implementation details that save time
Time zones and UTC handling
All example timestamps are in UTC (ending with Z). Normalize to UTC in your backend to avoid daylight saving drift. For frontends, convert to the user’s local time zone or the airport’s time zone for readability. Store both raw UTC and the display string you render to improve performance.
Polling frequency and caching for live tracking
- Before departure: Poll every 2–5 minutes; gates and terminals can change less frequently.
- En-route: If showing a live map via position fields, poll more often (e.g., 30–90 seconds). If you do not render position, stick to 2–3 minutes.
- On arrival/landed: Slow down to every 5–10 minutes or stop entirely after a terminal/gate is final.
- Cache: Cache responses for short TTLs to reduce load and jitter. For “scheduled” status, a 2–5 minute TTL is reasonable; for “en-route” with position, use 30–60 seconds.
- Backoff: Use exponential backoff and jitter when responses fail. Avoid synchronized polling across many instances.
Handling cancelled and diverted flights
- Cancelled: flight.status will read "cancelled". Suppress position, show departure and arrival as null or strikethrough, and stop frequent polling.
- Diverted: flight.status will read "diverted". Arrival.airport may differ from the scheduled destination. Highlight the diversion and reset your routing or pickup logic.
- No-takeoff but delayed: If departure.actual is missing yet scheduled has passed, show an “awaiting departure” state and compute an inferred delay using arrival.estimated where present.
Pagination for schedules
When listing many VS flights (e.g., all day-of operations), use the Flight Schedules endpoint and implement pagination. If your UI navigates by date or airport, request in pages rather than loading the full day at once. The schedules endpoint returns light-weight items (flight_number, scheduled times, terminals) designed to be scanned and then enriched by subsequent per-flight calls to Flight Info by Number as users drill in.
Codeshares and deduplication
Codeshares appear under codeshares[]. A single physical flight can map to multiple marketed numbers. If your product keys by aircraft.registration or by a canonical VS flight (via airline.iata + number), display partner numbers as secondary to avoid duplicates on a board.
Aircraft and seat maps
When aircraft.type and aircraft.registration are available, you can link to seat maps or aircraft-specific content in your app. Not all flights publish these fields at all times; design fallbacks for missing aircraft data.
Input validation and known identifiers
Always validate user-provided flight numbers. For Virgin Atlantic, VS is the IATA prefix; parse and normalize inputs like “vs7”, “VS 7”, or “VS007” to a consistent “VS7” format before calling the API.
End-to-end example: put it together for a Virgin Atlantic flight
Here is a simple flow you can adapt:
- User enters VS flight number (e.g., “VS7”).
- Your backend calls https://www.goflightlabs.com/flight-info-by-flight-number with the flight_number set to VS7 and your api_key.
- Render a status row with:
- Badge: flight.status
- Times: departure.scheduled vs departure.actual, arrival.scheduled vs arrival.estimated
- Gates: departure.gate and arrival.gate if present
- Codeshares: any codeshares[], collapsed under a “More flight numbers” affordance
- Map: if position is present, show an in-flight map or last-known location
- Start polling with a frequency depending on status (slower pre-departure, faster en-route, then slow/stop after arrival).
- On cancellation or diversion, switch to an alert state, reduce polling, and surface clear next steps to the user.
Field-by-field notes for VS flight tracking
- flight.iata and flight.number: Use these together to keep the Virgin Atlantic identity visible alongside partner numbers.
- departure and arrival sub-objects:
- scheduled: Canonical reference for comparisons.
- actual and estimated: Realized and projected times; always show the most precise non-null field.
- terminal and gate: Not guaranteed; handle null safely and avoid stale caching after gate changes.
- position: Present primarily during “en-route.” If absent, hide the map gracefully.
- aircraft: Use for interest and to disambiguate equipment changes mid-day.
Testing strategy and observability
- Fixture responses: Store a small set of representative JSON payloads (scheduled, en-route with position, landed, cancelled, diverted) to unit test your UI states.
- Clock-skew: Compare Date.now() to the server timestamps and tolerate a few seconds of skew to avoid flapping states.
- Logging: Log the top-level success flag and flight.status per poll cycle to analyze stability and catch parsing regressions.
FAQ
How do I authenticate?
Include your API key when calling the endpoint. If you have not generated one yet, visit the FlightLabs site to create a key and review authentication guidance in the docs.
Which time zone are the timestamps in?
Times shown in the examples are in UTC (e.g., ISO 8601 with Z). Convert to local time zones for display but keep UTC in storage for calculations.
What should I do if a field like gate or terminal is missing?
Treat it as unknown and hide or gray the field. Not all airports publish gate/terminal data consistently for all flights.
How often should I poll?
2–5 minutes before departure and after arrival, 30–90 seconds when en-route and showing position. Add exponential backoff on errors and short caching to avoid over-polling.
Can I list many Virgin Atlantic flights at once?
Yes. Use Flight Schedules to build lists and then call Detailed Flight Info by Flight Number to enrich individual items with live status, gates, and in-flight details.
Ready to integrate live Virgin Atlantic flight status into your product? Review the FlightLabs documentation and Get your FlightLabs API key to start building.