Skip to content

Airports

Search airports by ICAO code or find airports near a position from Flow Pro scripts.

Updated View as Markdown
For humans
Flow APIFlow Pro scriptingSimulator data

This article covers the following platforms

Use the Airports API to search by ICAO code — an airport’s identifier, like KJFK — or to find airports around a geographic position. Both methods deliver results through callbacks.

find_airport_by_icao()

Find airports whose ICAO code matches a full or partial search value.

SignatureTypeScript contract
find_airport_by_icao(
  uid: string,
  icao: string,
  callback: (airports: Airport[]) => void
): void

Parameters

NameTypeRequiredDescription
uidstringYesReusable identifier for this search. It must be unique within the widget.
icaostringYesFull or partial ICAO code to search for.
callback(airports: Airport[]) => voidYesFunction that receives the matching airports.
ExampleJavaScript
const searchId = "airport-search-by-icao";

this.$api.airports.find_airport_by_icao(searchId, "KJFK", (airports) => {
  console.log(airports);
});

Returns

voidNo value is returned directly. Matching airports are delivered to the callback.

Callback data

NameTypeDescription
airportsAirport[]Array of airports matching the full or partial ICAO code.

find_airports_by_coords()

Find the nearest airports within a radius of a geographic position.

SignatureTypeScript contract
find_airports_by_coords(
  uid: string,
  longitude: number,
  latitude: number,
  radius: number,
  limit: number,
  onAdded: (airports: Airport[]) => void,
  onRemoved: (airports: Airport[]) => void,
  onError: (error: object) => void,
  init: boolean
): void

Parameters

NameTypeRequiredDescription
uidstringYesReusable identifier for this search. It must be unique within the widget.
longitudenumberYesLongitude of the search center.
latitudenumberYesLatitude of the search center.
radiusnumberYesSearch radius in meters.
limitnumberYesMaximum number of airports to keep. The farthest matches are removed first.
onAdded(airports: Airport[]) => voidYesReceives airports added since the previous search.
onRemoved(airports: Airport[]) => voidYesReceives airports removed since the previous search.
onError(error: object) => voidYesReceives an error object when the search fails.
initbooleanYesWhen true, onAdded receives every matching airport instead of only changes.
ExampleJavaScript
const searchId = "airports-near-position";

this.$api.airports.find_airports_by_coords(
  searchId,
  -73.7781,
  40.6413,
  50000,
  10,
  (added) => console.log("Added", added),
  (removed) => console.log("Removed", removed),
  (error) => console.error(error),
  true
);

Returns

voidNo value is returned directly. Search changes and failures are delivered to callbacks.

Callback data

NameTypeDescription
addedAirport[]Airports added to the result set.
removedAirport[]Airports removed from the result set.
errorobjectError details when the search cannot be completed.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close