example-data.com
Menu
Browse docs and collections

Overview

flights / #332

Mar
7
Sun

Lufthansa LH4954

6:47 AM – 6:05 PM

SYD → JFK

From AED 921.43

Component variants

Related

Referenced by

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 332,
  "flightNumber": "LH4954",
  "airline": "Lufthansa",
  "departureAirport": "SYD",
  "arrivalAirport": "JFK",
  "departureAt": "2027-03-07T06:47:40.919Z",
  "arrivalAt": "2027-03-07T18:05:40.919Z",
  "durationMinutes": 678,
  "status": "landed",
  "priceFrom": 921.43,
  "currency": "AED",
  "createdAt": "2027-01-24T06:47:40.919Z"
}