example-data.com
Menu
Browse docs and collections

Overview

flights / #307

Apr
5
Mon

Emirates EK2997

4:51 AM – 9:10 AM

FCO → LAX

From AED 1155.43

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 307,
  "flightNumber": "EK2997",
  "airline": "Emirates",
  "departureAirport": "FCO",
  "arrivalAirport": "LAX",
  "departureAt": "2027-04-05T04:51:27.085Z",
  "arrivalAt": "2027-04-05T09:10:27.085Z",
  "durationMinutes": 259,
  "status": "scheduled",
  "priceFrom": 1155.43,
  "currency": "AED",
  "createdAt": "2027-01-22T04:51:27.085Z"
}