example-data.com
Menu
Browse docs and collections

Overview

flights / #378

Jan
21
Thu

Singapore Airlines SQ2555

12:24 AM – 10:20 AM

FCO → BCN

From AED 2165.23

Component variants

Related

Referenced by

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 378,
  "flightNumber": "SQ2555",
  "airline": "Singapore Airlines",
  "departureAirport": "FCO",
  "arrivalAirport": "BCN",
  "departureAt": "2027-01-21T00:24:38.720Z",
  "arrivalAt": "2027-01-21T10:20:38.720Z",
  "durationMinutes": 596,
  "status": "scheduled",
  "priceFrom": 2165.23,
  "currency": "AED",
  "createdAt": "2027-01-16T00:24:38.720Z"
}