Feb
16
Tue
British Airways BA2132
4:49 PM – 7:14 PM
MAD → ORD
From SGD 1321.17
Overview
flights / #238
4:49 PM – 7:14 PM
MAD → ORD
From SGD 1321.17
Request
curl example
curl -sS \ "https://example-data.com/api/v1/flights/238" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/flights/238" ); const flight = await res.json();
TypeScript example
// Download once: mkdir -p types && curl -o types/flights.d.ts https://example-data.com/types/flights.d.ts
import type { Flight } from "./types/flights";
const res = await fetch(
"https://example-data.com/api/v1/flights/238"
);
const flight = (await res.json()) as Flight; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/flights/238"
)
flight = res.json() Response
{
"id": 238,
"flightNumber": "BA2132",
"airline": "British Airways",
"departureAirport": "MAD",
"arrivalAirport": "ORD",
"departureAt": "2027-02-16T16:49:36.045Z",
"arrivalAt": "2027-02-16T19:14:36.045Z",
"durationMinutes": 145,
"status": "boarding",
"priceFrom": 1321.17,
"currency": "SGD",
"createdAt": "2027-02-07T16:49:36.045Z"
}