example-data.com
Menu
Browse docs and collections

Overview

flights / #275

May
4
Tue

Southwest Airlines WN4523

11:38 PM – 4:06 AM

YYZ → JFK

From SGD 1453.34

Component variants

Related

Referenced by

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 275,
  "flightNumber": "WN4523",
  "airline": "Southwest Airlines",
  "departureAirport": "YYZ",
  "arrivalAirport": "JFK",
  "departureAt": "2027-05-04T23:38:39.214Z",
  "arrivalAt": "2027-05-05T04:06:39.214Z",
  "durationMinutes": 268,
  "status": "landed",
  "priceFrom": 1453.34,
  "currency": "SGD",
  "createdAt": "2027-04-11T23:38:39.214Z"
}