example-data.com
Menu
Browse docs and collections

Overview

flights / #224

Mar
8
Mon

Delta Air Lines DL2924

1:56 PM – 2:32 AM

MAD → JFK

From GBP 1278.71

Component variants

Related

Referenced by

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 224,
  "flightNumber": "DL2924",
  "airline": "Delta Air Lines",
  "departureAirport": "MAD",
  "arrivalAirport": "JFK",
  "departureAt": "2027-03-08T13:56:53.440Z",
  "arrivalAt": "2027-03-09T02:32:53.440Z",
  "durationMinutes": 756,
  "status": "boarding",
  "priceFrom": 1278.71,
  "currency": "GBP",
  "createdAt": "2027-01-09T13:56:53.440Z"
}