example-data.com
Menu
Browse docs and collections

Overview

flights / #67

Mar
13
Sat

Singapore Airlines SQ5477

12:13 PM – 3:53 PM

SIN → SYD

From GBP 2258.50

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 67,
  "flightNumber": "SQ5477",
  "airline": "Singapore Airlines",
  "departureAirport": "SIN",
  "arrivalAirport": "SYD",
  "departureAt": "2027-03-13T12:13:02.702Z",
  "arrivalAt": "2027-03-13T15:53:02.702Z",
  "durationMinutes": 220,
  "status": "boarding",
  "priceFrom": 2258.5,
  "currency": "GBP",
  "createdAt": "2027-02-27T12:13:02.702Z"
}