This page is dedicated to developers wishing to interact with flightear-atc

API Overview

Authentication

API Queries

GET - Check if an airport is controlled

GET - Retrieve flight plans

GET - Flight plan details

GET - ATC Sessions

GET - Test authentication

POST - Create an ATC session

POST - File a new flight plan

POST - Edit a flight plan

POST - Open a flight plan

POST - Close a flight plan

POST - Insert/Modify a custom value

API Overview

Description

The API queries are made directly through the URL. Every query has an answer, in an XML format (not JSON).
Current API version is 2.2. The URL to access the API is :

http://flightgear-atc.alwaysdata.net/dev2017_04_28.php
The name of the query and the parameters are mentioned after the ".php".
Example : "http://flightgear-atc.alwaysdata.net/dev2017_04_28.php?isAirportControlled&icao=LFML&date=2017-04-28&time=20:00:00"

There are two kinds of queries : GET and POST.

Errors

If any query is not correct, an error message will appear. Example of error message :

<error version="2.2">
    <code>ERR_VAR</code>
    <message>getATCSessions requires limitDate</message>
</error>

Error types are :

Authentication

For POST queries you will need to sign in.
For this purpose please sign in here. Enter your email address and choose a password.

The email and password will be asked for any POST query.

API queries

GET - Check if an airport is controlled

?isAirportControlled&airport=...&date=YYYY-MM-DD&time=HH:MM:SS

Check if an airport is controlled at a given date and time.

TEST with isAirportControlled&airport=EDDF&date=2017-04-28&time=20:30:00

Mandatory parameters

airport : airport ICAO code (example : LFML, KSFO, EGLL, ...)
date : in YYYY-MM-DD format
time : in HH:MM:SS format

Optional parameters

-

Answer example


<airport version="2.2">
    <icao>EDDF</icao>
    <date>2017-04-28</date>
    <time>20:30:00</time>
    <isControlled>1</isControlled>
</airport>

GET - Retrieve flight plans

?getFlightplans[&callsign=...[&date=YYYY-MM-DD[&airport=...[&status=...[&limit=...]]]]]

Retrieve flight plans for a given pilot callsign AND/OR a given date AND/OR a given airport AND/OR a given status limited by limit.

TEST with getFlightplans&date=2017-04-28&airport=EDDF&limit=1

Mandatory parameters

getFlightplans

Optional parameters

callsign : pilot callsign
date : flightplan's departure date
airport : departure or arrival airport ICAO code
status : flightplan status ("filed" / "open" / "close")
limit : maximum number of flightplans to retrieve (default : 30 ; maximum : 80)

Answer example


<flightplans version="2.2" count="1">
    <flightplan>
        <flightplanId>3160</flightplanId>
        <callsign>ABC123</callsign>
        <airline>DLH</airline>
        <flightNumber>DLH141</flightNumber>
        <airportFrom>EDDS</airportFrom>
        <airportTo>EDDF</airportTo>
        <alternateDestination/>
        <cruiseAltitude>FL200</cruiseAltitude>
        <trueAirspeed/>
        <dateDeparture>2017-04-28</dateDeparture>
        <dateArrival>2017-04-28</dateArrival>
        <departureTime>18:20:00</departureTime>
        <arrivalTime>18:50:00</arrivalTime>
        <aircraft>A320</aircraft>
        <soulsOnBoard/>
        <fuelTime/>
        <pilotName/>
        <waypoints/>
        <category>IFR</category>
        <comments>
        <comment>
        <user>ABC123</user>
        <message/>
        </comment>
        </comments>
        <status>filed</status>
        <additionalInformation/>
        <lastUpdated>0</lastUpdated>
    </flightplan>
</flightplans>

GET - Flight plan details

?getFlightplanDetails&flightplanId=...

Get all flightplan information for a given flightplanId.

TEST with getFlightplanDetails&flightplanId=3160

Mandatory parameters

getFlightplanDetails
flightplanId : flightplan ID

Optional parameters

-

Answer example


<flightplan version="2.2">
    <flightplanId>3160</flightplanId>
    <callsign>ABC123</callsign>
    <airline>DLH</airline>
    <flightNumber>DLH141</flightNumber>
    <airportFrom>EDDS</airportFrom>
    <airportTo>EDDF</airportTo>
    <alternateDestination/>
    <cruiseAltitude>FL200</cruiseAltitude>
    <trueAirspeed/>
    <dateDeparture>2017-04-28</dateDeparture>
    <dateArrival>2017-04-28</dateArrival>
    <departureTime>18:20:00</departureTime>
    <arrivalTime>18:50:00</arrivalTime>
    <aircraft>A320</aircraft>
    <soulsOnBoard/>
    <fuelTime/>
    <pilotName/>
    <waypoints/>
    <category>IFR</category>
    <comments>
    <comment>
    <user>ABC123</user>
    <message/>
    </comment>
    </comments>
    <status>filed</status>
    <additionalInformation/>
    <lastUpdated>0</lastUpdated>
</flightplan>

GET - ATC sessions

?getATCSessions&limitDate=YYYY-MM-DD

Get all ATC sessions before limitDate.

TEST with getATCSessions&limitDate=2017-06-26

Mandatory parameters

getATCSessions
limitDate : limit date in YYYY-MM-DD format

Optional parameters

-

Answer example


<events version="2.2">
    <event>
        <eventId>2877</eventId>
        <airportICAO>SBEG</airportICAO>
        <date>2017-05-01</date>
        <beginTime>15:00:00</beginTime>
        <endTime>21:00:00</endTime>
        <fgcom>118.30</fgcom>
        <teamspeak>Portugues</teamspeak>
        <transitionLevel>4000</transitionLevel>
        <runways>10</runways>
        <ILS>110.30 105</ILS>
        <docsLink>http://www.aisweb.aer.mil.br/</docsLink>
        <remarks>
        http://inutiles.byethost16.com/flightgear/modules/brazukaairlines/Evento/
        </remarks>
    </event>
</events>

GET - Test authentication

?testAuthentication&email=...&password=...

Check if your email and password work fine.

TEST with ?testAuthentication&email=abc&password=abc

Mandatory parameters

email : your email
password : your password

Optional parameters

-

Answer example


<airport version="2.2">
    <icao>EDDF</icao>
    <date>2017-04-28</date>
    <time>20:30:00</time>
    <isControlled>1</isControlled>
</airport>

POST - Create an ATC session

?newAtcSession&email=...&password=...&date=YYYY-MM-DD&beginTime=HH:MM:SS&endTime=HH:MM:SS&airportICAO=...
[&fgCom=...[&teamSpeak=...[&docsLink[&remarks=...]]]]

Creates a new ATC session at a given date according specified airportICAO, beginTime and endTime.
Warning: as all POST queries, you'll need to create an account here and use your login information into the query.

Mandatory parameters

newAtcSession
email : your email
password : your password
date : date in YYYY-MM-DD format
beginTime : HH:MM:SS of the begin of the ATC session
endTime : HH:MM:SS of the end of the ATC session
airportICAO : ICAO code of the airport

Optional parameters

fgCom : FGCom frequency
teamspeak : Information regarding team speak client
docsLink : link for additional documentation
remarks : any useful information

Answer example


<event version="2.2">
    <eventId>2894</eventId>
    <airportICAO>TEST</airportICAO>
    <date>2017-05-10</date>
    <beginTime>20:00:00</beginTime>
    <endTime>21:00:00</endTime>
    <fgcom>N/A</fgcom>
    <teamspeak>N/A</teamspeak>
    <transitionLevel/>
    <runways/>
    <ILS/>
    <docsLink>N/A</docsLink>
    <remarks>N/A</remarks>
</event>

POST - File a new flight plan

?fileFlightplan&email=...&password=...&callsign=...&dateDeparture=YYYY-MM-DD&departureAirport=...&departureTime=HH:MM:SS&arrivalAirport=...&arrivalTime=HH:MM:SS
[&airline=...[&flightNumber=...[&alternateDestination=...[&cruiseAltitude=...[&trueAirspeed=...[&aircraft=...[&soulsOnBoard=...[&fuelTime=...[&pilotName=...[&waypoints=...[&category=IFR/VFR[&comments=...]]]]]]]]]]]]

Creates a new flight plan for given information.
Warning: as all POST queries, you'll need to create an account here and use your login information into the query.

Mandatory parameters

fileFlightplan
email : your email
password : your password
callsign : pilot callsign
dateDeparture : date in YYYY-MM-DD format
departureAirport : ICAO code of the departure airport
departureTime : HH:MM:SS of flight departure
arrivalAirport : ICAO code of the arrival airport
arrivalTime : HH:MM:SS of the flight arrival

Optional parameters

airline : name of the airline
flightNumber : flight number
alternateDestination : alternate airport ICAO code (for divert)
cruiseAltitude : cruise altitude or flight level
trueAirspeed : speed of the aircraft
aircraft : aircraft type/model
soulsOnBoard : number of people
fuelTime : autonomy of the aircraft
pilotName : name of the pilot
waypoints : waypoints during the flight
category : either VFR of IFR (Visual Flight Rules or Instrument Flight Rules)
comments : any useful information regarding the flight

Answer example


<flightplan version="2.2">
    <flightplanId>3171</flightplanId>
    <callsign>_TEST</callsign>
    <airline/>
    <flightNumber/>
    <airportFrom>LFML</airportFrom>
    <airportTo>LFOK</airportTo>
    <alternateDestination/>
    <cruiseAltitude/>
    <trueAirspeed/>
    <dateDeparture>2017-05-05</dateDeparture>
    <dateArrival>2017-05-05</dateArrival>
    <departureTime>20:00:00</departureTime>
    <arrivalTime>22:00:00</arrivalTime>
    <aircraft/>
    <soulsOnBoard/>
    <fuelTime/>
    <pilotName/>
    <waypoints/>
    <category/>
    <comments/>
    <status>filed</status>
    <additionalInformation/>
    <lastUpdated/>
</flightplan>

POST - Edit a flight plan

?editFlightplan&email=...&password=...&flightplanId=...
[&callsign=...[&dateDeparture=YYYY-MM-DD[&departureAirport=...[&departureTime=HH:MM:SS[&arrivalAirport=...[&arrivalTime=HH:MM:SS[&airline=...[&flightNumber=...[&alternateDestination=...[&cruiseAltitude=...[&trueAirspeed=...[&aircraft=...[&soulsOnBoard=...[&fuelTime=...[&pilotName=...[&waypoints=...[&category=IFR/VFR[&comments=...]]]]]]]]]]]]

Edits the flightplanId with the optional information.
Warning: as all POST queries, you'll need to create an account here and use your login information into the query.

Mandatory parameters

editFlightplan
email : your email
password : your password
flightplanId : flightplan ID

Optional parameters

callsign : pilot callsign
dateDeparture : date in YYYY-MM-DD format
departureAirport : ICAO code of the departure airport
departureTime : HH:MM:SS of flight departure
arrivalAirport : ICAO code of the arrival airport
arrivalTime : HH:MM:SS of the flight arrival
airline : name of the airline
flightNumber : flight number
alternateDestination : alternate airport ICAO code (for divert)
cruiseAltitude : cruise altitude or flight level
trueAirspeed : speed of the aircraft
aircraft : aircraft type/model
soulsOnBoard : number of people
fuelTime : autonomy of the aircraft
pilotName : name of the pilot
waypoints : waypoints during the flight
category : either VFR of IFR (Visual Flight Rules or Instrument Flight Rules)
comments : any useful information regarding the flight

Answer example


<flightplan version="2.2">
    <flightplanId>3171</flightplanId>
    <callsign>_TEST</callsign>
    <airline/>
    <flightNumber/>
    <airportFrom>LFML</airportFrom>
    <airportTo>LFOK</airportTo>
    <alternateDestination/>
    <cruiseAltitude/>
    <trueAirspeed/>
    <dateDeparture>2017-05-05</dateDeparture>
    <dateArrival>2017-05-05</dateArrival>
    <departureTime>20:00:00</departureTime>
    <arrivalTime>22:00:00</arrivalTime>
    <aircraft/>
    <soulsOnBoard/>
    <fuelTime/>
    <pilotName/>
    <waypoints/>
    <category/>
    <comments/>
    <status>filed</status>
    <additionalInformation/>
    <lastUpdated>2017-04-29 10:00:00</lastUpdated>
</flightplan>

POST - Open a flight plan

?openFlightplan&email=...&password=...&flightplanId=...

Opens flightplanId.
Warning: as all POST queries, you'll need to create an account here and use your login information into the query.

Mandatory parameters

openFlightplan
email : your email
password : your password
flightplanId : flightplan ID

Optional parameters

-

Answer example


<flightplan version="2.2">
    <flightplanId>3171</flightplanId>
    <callsign>_TEST</callsign>
    <airline/>
    <flightNumber/>
    <airportFrom>LFML</airportFrom>
    <airportTo>LFOK</airportTo>
    <alternateDestination/>
    <cruiseAltitude/>
    <trueAirspeed/>
    <dateDeparture>2017-05-05</dateDeparture>
    <dateArrival>2017-05-05</dateArrival>
    <departureTime>20:00:00</departureTime>
    <arrivalTime>22:00:00</arrivalTime>
    <aircraft/>
    <soulsOnBoard/>
    <fuelTime/>
    <pilotName/>
    <waypoints/>
    <category/>
    <comments/>
    <status>open</status>
    <additionalInformation/>
    <lastUpdated>2017-04-29 10:00:00</lastUpdated>
</flightplan>

POST - Close a flight plan

?closeFlightplan&email=...&password=...&flightplanId=...

Closes flightplanId.
Warning: as all POST queries, you'll need to create an account here and use your login information into the query.

Mandatory parameters

closeFlightplan
email : your email
password : your password
flightplanId : flightplan ID

Optional parameters

-

Answer example


<flightplan version="2.2">
    <flightplanId>3171</flightplanId>
    <callsign>_TEST</callsign>
    <airline/>
    <flightNumber/>
    <airportFrom>LFML</airportFrom>
    <airportTo>LFOK</airportTo>
    <alternateDestination/>
    <cruiseAltitude/>
    <trueAirspeed/>
    <dateDeparture>2017-05-05</dateDeparture>
    <dateArrival>2017-05-05</dateArrival>
    <departureTime>20:00:00</departureTime>
    <arrivalTime>22:00:00</arrivalTime>
    <aircraft/>
    <soulsOnBoard/>
    <fuelTime/>
    <pilotName/>
    <waypoints/>
    <category/>
    <comments/>
    <status>close</status>
    <additionalInformation/>
    <lastUpdated>2017-04-29 10:00:00</lastUpdated>
</flightplan>

POST - Insert/Modify a custom value

?setVar&email=...&password=...&flightplanId=...&variable=...&value=[...]

This query allows one to add some custom information on a flight plan. Any variable and value can be created/modified.
Caution: if the variable already exists, this command will overwrite it.
Notice: leaving the value empty will unset the variable.
Warning: as all POST queries, you'll need to create an account here and use your login information into the query.

Mandatory parameters

editFlightplan
email : your email
password : your password
flightplanId : flightplan ID
variable : custom variable to set/overwrite
value : custom value to set/overwrite
(if empty, the variable is unset)

Optional parameters

-

Answer example


<flightplan version="2.2">
    <flightplanId>3171</flightplanId>
    <callsign>_TEST</callsign>
    <airline/>
    <flightNumber/>
    <airportFrom>LFML</airportFrom>
    <airportTo>LFOK</airportTo>
    <alternateDestination/>
    <cruiseAltitude/>
    <trueAirspeed/>
    <dateDeparture>2017-05-05</dateDeparture>
    <dateArrival>2017-05-05</dateArrival>
    <departureTime>20:00:00</departureTime>
    <arrivalTime>22:00:00</arrivalTime>
    <aircraft/>
    <soulsOnBoard/>
    <fuelTime/>
    <pilotName/>
    <waypoints/>
    <category/>
    <comments/>
    <status>close</status>
    <additionalInformation>
        <custom>2</custom>
    </additionalInformation>
    <lastUpdated>2017-04-29 10:00:00</lastUpdated>
</flightplan>