example-data.com
Menu
Browse docs and collections

Overview

flights / #5

Jan
4
Mon

Singapore Airlines SQ8464

5:21 PM – 6:24 PM

SYD → SIN

From USD 1973.82

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 5,
  "flightNumber": "SQ8464",
  "airline": "Singapore Airlines",
  "departureAirport": "SYD",
  "arrivalAirport": "SIN",
  "departureAt": "2027-01-04T17:21:18.455Z",
  "arrivalAt": "2027-01-04T18:24:18.455Z",
  "durationMinutes": 63,
  "status": "cancelled",
  "priceFrom": 1973.82,
  "currency": "USD",
  "createdAt": "2026-12-09T17:21:18.455Z"
}