Skip to content

Flightdata API

mrabans edited this page Feb 7, 2023 · 3 revisions

FLIGHTDATA API

The flightdata API offers several parameters to allow a granular filtering on specific flight attributes.

Base URL https://mobility.api.opendatahub.com/v2/flat%2Cnode/Flight

Default limit is 200 records, so with the following parameters it is possible to retrieve all data without limit.

limit=-1 
offset=0
shownull=false
distinct=true

Filtering on dates

In order to filter on all active flights (not in the past), on "departure_timestamp" and on "arrival_timestamp" a where parameter can be added.

The following example combines all those parameters and looks like:

https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/Flight?limit=-1&offset=0&shownull=false&distinct=true&where=sactive.eq.true&select=scode,smetadata.fromdestination,smetadata.todestination,smetadata.fltsfromperiod,smetadata.std,smetadata.sta&where=and(smetadata.departure_timestamp.gt.1676647946,smetadata.departure_timestamp.lt.1676734346)

In particular the request parameters where=and(smetadata.departure_timestamp.gt.1676647946,smetadata.departure_timestamp.lt.1676734346) list all active flights between 18/02/2023 and 19/02/2023.

lt means "less than" and gt means "greater than.

Prices

By default the API answers with all fares attached to a specific flight. When setting the attribute parameters to "smetadata.fares", the API only shows the fares attributes. This is particulary useful when retriving only prices without all the rest, i.e. querying the lowest fare for a flight could be done by filtering on the name of an according fare: SKY GO = SKY_GO. So the following combinations are possible:

Clone this wiki locally