Skip to main content

Fake Flight Data API

MOCK DATA

Coherent fake flight fixtures between real hub airports, with working route, status, cabin and departure-window filters — never live operations.

Generated test data for fixtures and development

Base URL
/api/flights
Capabilities
1 route Seedable
Last updated
July 30, 2026
Data source

GET /api/flights

Live requestRuns against the public API
No key required
GET/api/flights?origin=CPH&destination=JFK&count=5&seed=42

Request parameters

Pin the origin to one of the hub three-letter IATA codes, case-insensitively. Codes outside the hub network return 400 listing them.

Pin the destination to a hub IATA code. It must differ from origin when both are supplied.

Pin every fictional snapshot to this status. Omit for a weighted mix.

Snapshot instant used to evaluate status. Defaults to the end of the current UTC day for day-stable seeded output; pass it explicitly for an intraday snapshot.

Earliest synthetic scheduled departure. Defaults to the current UTC-day boundary (or 30 days before an explicit to).

Latest synthetic scheduled departure. Defaults to 30 days after the resolved from value. Must be ≥ from.

Pin every record to this cabin. Omit for a weighted mix dominated by economy.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/flights?origin=CPH&destination=JFK&count=5&seed=42"
const res = await fetch("https://randomapi.dev/api/flights?origin=CPH&destination=JFK&count=5&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/flights?origin=CPH&destination=JFK&count=5&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/flights?origin=CPH&destination=JFK&count=5&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 7
origin string

Pin the origin to one of the hub three-letter IATA codes, case-insensitively. Codes outside the hub network return 400 listing them.

allowed: 3 – 3
example: origin=CPH
destination string

Pin the destination to a hub IATA code. It must differ from origin when both are supplied.

allowed: 3 – 3
example: destination=JFK
status enum

Pin every fictional snapshot to this status. Omit for a weighted mix.

allowed: scheduled | boarding | departed | arrived | cancelled
example: status=boarding
asOf date

Snapshot instant used to evaluate status. Defaults to the end of the current UTC day for day-stable seeded output; pass it explicitly for an intraday snapshot.

example: asOf=2026-08-14T08:45:00Z
from date

Earliest synthetic scheduled departure. Defaults to the current UTC-day boundary (or 30 days before an explicit to).

example: from=2026-08-01
to date

Latest synthetic scheduled departure. Defaults to 30 days after the resolved from value. Must be ≥ from.

example: to=2026-08-31
cabin enum

Pin every record to this cabin. Omit for a weighted mix dominated by economy.

allowed: economy | premiumEconomy | business | first
example: cabin=business
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=id,flightNumber
exclude list

Return all fields except these (comma-separated).

example: exclude=terminal
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 14
id string

Distinct flt_-prefixed fictional fixture identifier.

example: flt_4e19c0a27b5d8f31_00

flightNumber string

Fictional internal airline code plus a per-response sequence; not an IATA flight number.

example: NX1-1000

airline object

Fictional airline name and digit-bearing internal fixture code; neither claims an IATA/ICAO assignment.

example: {"name":"Northstar Air (fictional)","code":"NX1"}

origin object

Hub airport IATA, name, city, country, countryCode and pinned IANA timezone.

example: {"iata":"CPH","name":"Copenhagen Kastrup Airport","city":"Copenhagen","country":"Denmark","countryCode":"DK","timezone":"Europe/Copenhagen"}

destination object

A different hub airport with IATA, name, city, country, countryCode and timezone.

example: {"iata":"JFK","name":"John F. Kennedy International Airport","city":"New York","country":"United States","countryCode":"US","timezone":"America/New_York"}

status string

Fictional snapshot label: scheduled | boarding | departed | arrived | cancelled; never live status.

example: scheduled

statusAsOf string (ISO 8601)

Snapshot instant used to make status temporally consistent with departure and arrival.

example: 2026-08-14T08:45:00.000Z

departure string (ISO 8601)

Synthetic scheduled UTC departure inside from..to — not an actual or live time.

example: 2026-08-14T09:20:00.000Z

arrival string (ISO 8601)

Synthetic scheduled UTC arrival, exactly durationMinutes after departure.

example: 2026-08-14T17:45:00.000Z

durationMinutes integer

Positive fixture duration derived from route distance plus generic operating time.

example: 505

aircraft string

Generic aircraft class selected coherently with route length, not a real tail assignment.

example: wide-body twinjet

cabin string

economy | premiumEconomy | business | first.

example: economy

gate string

Synthetic gate label for interface fixtures; not operational airport data.

example: B17

terminal string

Synthetic terminal label T1–T4; not operational airport data.

example: T2

Documented examples

Build-generated requests and complete responses
3
Copenhagen to New York fixtures
GET /api/flights?origin=CPH&destination=JFK&count=5&seed=42
{
  "data": [
    {
      "id": "flt_016cfb6a5c85eac5_00",
      "flightNumber": "CA3-1000",
      "airline": {
        "name": "Copperline Aviation (fictional)",
        "code": "CA3"
      },
      "origin": {
        "iata": "CPH",
        "name": "Copenhagen Kastrup Airport",
        "city": "Copenhagen",
        "country": "Denmark",
        "countryCode": "DK",
        "timezone": "Europe/Copenhagen"
      },
      "destination": {
        "iata": "JFK",
        "name": "John F. Kennedy International Airport",
        "city": "New York",
        "country": "United States",
        "countryCode": "US",
        "timezone": "America/New_York"
      },
      "status": "departed",
      "statusAsOf": "2026-07-30T23:59:59.999Z",
      "departure": "2026-07-30T18:37:14.925Z",
      "arrival": "2026-07-31T02:31:14.925Z",
      "durationMinutes": 474,
      "aircraft": "wide-body twinjet",
      "cabin": "economy",
      "gate": "D33",
      "terminal": "T4"
    },
    {
      "id": "flt_248abeccba6fd45d_01",
      "flightNumber": "AL5-1001",
      "airline": {
        "name": "Atlas Loop Airways (fictional)",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Boarding flights at a fixed snapshot
GET /api/flights?status=boarding&asOf=2026-08-14T08%3A45%3A00Z&from=2026-08-14T08%3A45%3A00Z&to=2026-08-14T09%3A45%3A00Z&count=10&seed=7
{
  "data": [
    {
      "id": "flt_e2436f61bcde1a23_00",
      "flightNumber": "CA3-1000",
      "airline": {
        "name": "Copperline Aviation (fictional)",
        "code": "CA3"
      },
      "origin": {
        "iata": "MUC",
        "name": "Munich Airport",
        "city": "Munich",
        "country": "Germany",
        "countryCode": "DE",
        "timezone": "Europe/Berlin"
      },
      "destination": {
        "iata": "SEA",
        "name": "Seattle–Tacoma International Airport",
        "city": "Seattle",
        "country": "United States",
        "countryCode": "US",
        "timezone": "America/Los_Angeles"
      },
      "status": "boarding",
      "statusAsOf": "2026-08-14T08:45:00.000Z",
      "departure": "2026-08-14T09:30:03.214Z",
      "arrival": "2026-08-14T20:05:03.214Z",
      "durationMinutes": 635,
      "aircraft": "wide-body twinjet",
      "cabin": "economy",
      "gate": "C40",
      "terminal": "T2"
    },
    {
      "id": "flt_d5cab8a9dd45683e_01",
      "flightNumber": "AL5-1001",
      "airline": {
        "name": "Atlas Loop Airways (fictional)",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Business-cabin departures from Tokyo
GET /api/flights?origin=HND&cabin=business&count=8&seed=19
{
  "data": [
    {
      "id": "flt_d76736c926a42926_00",
      "flightNumber": "MW2-1000",
      "airline": {
        "name": "Meridian Wings (fictional)",
        "code": "MW2"
      },
      "origin": {
        "iata": "HND",
        "name": "Tokyo Haneda International Airport",
        "city": "Tokyo",
        "country": "Japan",
        "countryCode": "JP",
        "timezone": "Asia/Tokyo"
      },
      "destination": {
        "iata": "AUH",
        "name": "Zayed International Airport",
        "city": "Abu Dhabi",
        "country": "United Arab Emirates",
        "countryCode": "AE",
        "timezone": "Asia/Dubai"
      },
      "status": "arrived",
      "statusAsOf": "2026-07-30T23:59:59.999Z",
      "departure": "2026-07-30T11:32:06.375Z",
      "arrival": "2026-07-30T21:24:06.375Z",
      "durationMinutes": 592,
      "aircraft": "wide-body twinjet",
      "cabin": "business",
      "gate": "B20",
      "terminal": "T1"
    },
    {
      "id": "flt_6dc8e7f89f85bddd_01",
      "flightNumber": "BO4-1001",
      "airline": {
        "name": "Blue Orchard Air (fictional)",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

About this API

Coverage & behavior

Generates fictional flight fixtures, not schedules, fares, availability or live status. Airport codes, names, cities and countries are read from the platform's bundled airport snapshot — the same rows /api/airports serves — narrowed to a curated network of 85 well-known hubs so generated itineraries stay plausible. Each route always connects two different hubs, and the required timezone value is the pinned IANA zone for that airport.

Airline brands and digit-bearing codes are deliberately fictional and do not claim IATA or ICAO assignments. Likewise, flightNumber, gate and terminal are UI fixtures. departure and arrival are synthetic scheduled UTC times, never actual/estimated operational times. status is evaluated at asOf: scheduled flights depart later, boarding flights depart within the next hour, departed flights are in progress, and arrived flights have completed. Cancelled is an explicit cancellation snapshot and may refer to a scheduled time on either side of asOf.

origin and destination accept the 85 hub IATA codes case-insensitively and echo canonical uppercase. Codes outside the hub network — including real airports that /api/airports knows about — return 400 with the supported set and an airport-reference link, rather than a fixture the route generator cannot build. Pinning both to the same airport is a 400. from/to constrain scheduled departure; omitted values resolve to the current UTC-day boundary through 30 days later. asOf defaults to the end of the current UTC day, so a pinned seed remains stable throughout that day; pass it explicitly for an intraday snapshot. All three resolved values are echoed in meta.params. Impossible status/window/as-of combinations return 400 rather than contradictory fixtures.

Duration is internally coherent: arrival is exactly durationMinutes after departure, and route distance guides both duration and generic aircraft class.

Use it for

  • Populate flight-search, itinerary and departure-board interface states
  • Test airport selectors with real IATA/name/city/timezone relationships
  • Create reproducible scheduled, boarding, arrived and cancellation fixtures

Frequently asked questions

Are these real flight schedules or statuses?

No. Every flight, airline, number, time, status, gate and terminal is synthetic fixture data; only the hub airport reference facts are real.

Can I pin the origin and destination airports?

Yes. Use any of the hub IATA codes, such as origin=CPH&destination=JFK; lowercase is canonicalized, codes outside the hub network are rejected, and an airport cannot route to itself.

Do the arrival time and duration agree?

Yes. arrival is calculated as scheduled departure + durationMinutes, and duration is guided by the real airport coordinates rather than chosen independently.

Do flight status and schedule time agree?

Yes. Status is evaluated at the echoed asOf instant: scheduled is future, boarding is within an hour of departure, departed is in progress and arrived has completed. Impossible pinned combinations return 400.

Are the airline codes valid IATA assignments?

No. The names and digit-bearing codes are explicitly fictional internal fixture labels and must not be used as airline identifiers.

Standards & references