Omniscope Custom Blocks › Connectors/Flightstats/Flights

FlightStats Flights

Looks up each flight in the input (carrier, flight number and departure date) in the FlightStats (Cirium Flex) schedules and adds its scheduled airports, local departure and arrival times, aircraft type and codeshares. Needs a FlightStats App ID and App key.

Connectors › Flightstats R

Open the demo in Omniscope Download demo.ioz Sample data: flight-bookings.csv Sample data: placeholder.csv Source on GitHub

Omniscope custom block · Connectors · Flightstats

A list of bookings with only flight numbers and dates? Look each flight up in the FlightStats schedules and add its airports, local departure and arrival times, aircraft and codeshares.

R · httr, jsonlite · install httr and jsonlite on the server's R if missing

The problem it solves

Travel bookings and expense claims usually record a flight as "ZQ 214 on 16 November". Questions such as "who is flying out of Northmoor on Monday morning?" or "how many trips need an overnight stay?" need the airports and times, which the booking does not carry.

This block looks up each flight in the FlightStats schedules for its day and adds the scheduled legs.

Service status. FlightStats (Cirium) has said its legacy Flex APIs, which this block calls, will keep working until 31 December 2026; new integrations are directed to the newer Cirium Sky API, which this block does not call, and free trials are offered only for that. Check the provider's current terms before building on the block.

How it works

What goes in

Flight bookings

10 invented bookings on fictional airlines.

Booking Traveller Carrier Flight Departure date
B-101 A. Okafor ZQ 214 2026-11-16
B-102 P. Natarajan ZQ 214 2026-11-16
B-104 S. Whitfield J7 1402 2026-11-18
B-106 M. Haddad QV 931 2026-11-19
B-108 R. Byrne RB 2026-11-20
B-110 J. Mensah TF 77 2026-11-25

10 rows in the sample file.

The options

Option Demo setting What it does
App ID (your ID) The application ID of your FlightStats account.
App key (your key) The application key; sent with each request, never written to the output.
Carrier field Carrier The airline code: the "LH" in LH1234.
Flight number field Flight The number part: the "1234" in LH1234.
Departure date field Departure date The day the flight departs.

What comes out

Flights (selected fields)

Requested carrier Requested flight number Requested date departureAirportFsCode arrivalAirportFsCode departureTime arrivalTime flightEquipmentIataCode codeshares
ZQ 214 2026-11-16 KQB NMR 2026-11-16 07:10 2026-11-16 08:05 AT7 XK5214
XK 88 2026-11-17 NMR JNP 2026-11-17 09:40 2026-11-17 10:55 320
J7 1402 2026-11-18 JNP VLB 2026-11-18 13:20 2026-11-18 14:30 E75 XK1402, OY7402
OY 2210 2026-11-20 ORB NMR 2026-11-20 08:30 2026-11-20 10:05 73H
TF 77 2026-11-25 RBK TFD 2026-11-25 06:50 2026-11-25 07:25 DH4
TF 77 2026-11-25 TFD HBL 2026-11-25 08:05 2026-11-25 09:35 DH4

8 records in all. QV 931 is not in the schedules for 19 November and B-108 has no flight number, so neither appears; the block's message says so. Join the output back to the bookings on the three Requested fields to see both travellers on ZQ 214.

Where it pays off

Corporate travel: Who is where

Add airports and times to bookings, then list who departs from or arrives at each airport on a given day, for duty of care or meeting planning.

Expenses: Checking claims

Compare claimed travel times and airports with the schedule for the flight on that day.

Events: Arrivals planning

Count delegates arriving at each airport by hour, from the flight numbers they registered, to plan transfers.

Freight: Planned connections

Look up the scheduled legs of the flights shipments are booked on, with the aircraft type on each leg.

Use cases describe typical scenarios and are illustrative; the sample data is invented.

Why do this in Omniscope

How it fits into an Omniscope workflow

Bookings (File) → FlightStats Flights → Join (back to Bookings on carrier, number and date) → Join (FlightStats Airports, for airport names) → Report

Try it

  1. Open the demo project (demo.iox on the demo server, or import demo.ioz from this folder). It holds the bookings, the FlightStats Flights block (no credentials, so it is not run) and a File block with placeholder.csv, the 8 legs the block writes for the invented answers.
  2. The question: from which airport, and at what local time, does each traveller depart?
  3. Follow the placeholder into the join with the bookings: both travellers on ZQ 214 get the same flight.
  4. To use your own account: enter your App ID and App key in the block, run it, and connect its Flights output where the File block was.

Running in Omniscope

Omniscope workflow
Omniscope workflow

The demo project's workflow: the sample bookings, the block, the placeholder data and a Validate data check on the output.

Language and libraries

R. It uses the httr and jsonlite packages (both MIT licence).

Neither is part of base R: install them on the Omniscope server's R if they are missing (install.packages(c("httr", "jsonlite"))).

Tested

The block is covered by automated tests that run its script against a stand-in for Omniscope's R API and invented FlightStats answers (no live calls): the sample bookings (legs, local times, lists joined as text, codeshares), the request sent, one request per distinct flight and day, flights not found and records skipped, failed requests, refused credentials, lower-case carriers and numeric flight numbers, an empty input, wrong field types and missing choices, and 2,000 bookings.

Reference

Fields it reads

NameTypeWhat it does
Carrier fieldFieldText field with the airline code: the "LH" in LH1234. FlightStats, IATA or ICAO codes are accepted.
Flight number fieldFieldField with the number part of the flight: the "1234" in LH1234 (text or a whole number, up to 4 digits).
Departure date fieldFieldDate field with the day the flight departs (the date in UTC is used; any time of day is ignored).

Options

NameTypeWhat it does
App IDTextThe application ID of your FlightStats (Cirium Flex) account.
App keyPasswordThe application key of your FlightStats (Cirium Flex) account. It is sent with each request and never written to the output.

Outputs

OutputWhat it holds
FlightsOne record per scheduled leg: the requested carrier, number and date, then the schedule's airports, local times, terminals, aircraft and codeshares.