example-data.com
Menu
Browse docs and collections

Overview

flights / #3

Apr
17
Sat

Lufthansa LH3261

9:17 PM – 11:55 PM

YYZ → ATL

From AUD 494.66

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 3,
  "flightNumber": "LH3261",
  "airline": "Lufthansa",
  "departureAirport": "YYZ",
  "arrivalAirport": "ATL",
  "departureAt": "2027-04-17T21:17:22.081Z",
  "arrivalAt": "2027-04-17T23:55:22.081Z",
  "durationMinutes": 158,
  "status": "boarding",
  "priceFrom": 494.66,
  "currency": "AUD",
  "createdAt": "2027-01-17T21:17:22.081Z"
}