example-data.com
Menu
Browse docs and collections

Overview

flights / #217

May
2
Sun

British Airways BA5021

3:41 AM – 2:55 PM

ATL → LHR

From SGD 55.33

Component variants

Related

Referenced by

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/flights/217" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/flights/217"
);
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/217"
);
const flight = (await res.json()) as Flight;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/flights/217"
)
flight = res.json()

Response

{
  "id": 217,
  "flightNumber": "BA5021",
  "airline": "British Airways",
  "departureAirport": "ATL",
  "arrivalAirport": "LHR",
  "departureAt": "2027-05-02T03:41:54.165Z",
  "arrivalAt": "2027-05-02T14:55:54.165Z",
  "durationMinutes": 674,
  "status": "cancelled",
  "priceFrom": 55.33,
  "currency": "SGD",
  "createdAt": "2027-04-29T03:41:54.165Z"
}