Menu
News topics
FlightGear Tracker API

FlightGear Tracker API

Location:

(IPv4 and IPv6) https://fgtracker.ml/modules/fgtracker/interface.php

Language: Json (http GET)

Current Version: 0.7.3 - 2016.12.16.1119 (Development stage. Attributes and parameters may change from time to time until v1 is out.)

 Terminology

Archive

Data which was placed to another place for permanent storage. If the functions have a boolean “is_archive” return, the developer shall indicate via GET Parameter on whether he wants the functions return current data or archived data.

Duration/
Flight time

Duration from the pilot enters the FGMS network to the pilot exits the FGMS network. Not recommend to be used for public views. Use effective flight time instead.

Effective flight time

Sum of time the aircraft movement > 5knots in the session/in any session.

Header reply:

Array (PHP: $reply=json_decode( file_get_contents(URL), true))

Type

Description

$reply["header"]["code"]

Int

Code of status/Error code (see below)

$reply["header"]["msg"]

String

Message from server

$reply["header"]["request_time"]

String

Time on server when the request is received

$reply["header"]["request_time_raw"]

int

Time on server when the request is received (since Unix epoch)

$reply["header"]["process_time"]

Float

Time used in processing the request in second

$reply["header"]["request_ip"]

char

Client IP. This IP can be force casting by GET Parameter “&ip=”

$reply["header"]["request_location"]

char

Location of client IP [ISO 3166-1 Alpha 2 country code. Data provided by GeoLite data created by MaxMind, available from http://www.maxmind.com (IPv4 only), or Cloudflare IP Geolocation(IPv4 and IPv6)].  NULL if the location cannot be identified.  This location determines the time zone present in the data reply. To force casting the location, add &clientlocation=  in GET Parameter

$reply["header"]["request_location_name"]

char

Full name of request location

$reply["header"]["request_timezone"]

char

Default time zone set by interface. To force casting the time zone, add &timezone=0  in GET Parameter

$reply["header"]["request_timezone_abbr"]

Char

 

Error code and it’s definition:

Code

Description

200

Request fulfilled and returned

400

Bad request. Some necessary parameters not defined

404

Request return nil result (Note the data section will not be set)

500

Internal server error. Contact administrator for fixing

Data reply:

1. To get a report of a particular callsign: https://fgtracker.ml/modules/fgtracker/interface.php?action=flights&callsign=Quofei

Array (PHP: $reply=json_decode( file_get_contents(URL), true))

Type

Description

GET Parameter

$reply["data"]["callsign"]

String

Callsign

&callsign=

$reply["data"]["status"]

String

Callsign status:
Not registered – The callsign is not yet registered
Registered – The callsign is registered but not yet pass email verification
Active – The callsign is registered and passed email verification
Deactivated – This callsign is deactivated
Protected – This callsign is protected from being registered
Dispute – A person has filed a dispute on this callsign

N/A

$reply["data"]["is_archive"]

boolean

"true" if the request is requesting archived data
"false" if the request is requesting current data

&archive=true
&archive=false (default)

If $reply["data"]["status"]==”Disput”, Json reply ends here.

$reply["data"]["no_of_flights"]

int

Number of flights in current/archive result set

N/A

$reply["data"]["flight_list_offset"]

int

Offset of the flight list. If offset > number of flights, offset=0

&offset= (default=0)

$reply["data"]["rank"]

int

Rank (according to effective flight time)

N/A

$reply["data"]["lastweek"]

String

Total flight time in last 7 days

N/A

$reply["data"]["lastweek_raw"]

int

Total flight time in last 7 days in seconds

N/A

$reply["data"]["last30days"]

String

Total flight time in last 30 days

N/A

$reply["data"]["last30days_raw"]

int

Total flight time in last 30 days in seconds

N/A

$reply["data"]["total_flight_time"]

String

Total flight time all time

N/A

$reply["data"]["total_flight_time_raw"]

int

Total flight time all time in seconds

N/A

$reply["data"]["effective_flight_time"]

String

Total effective flight time all time

N/A

$reply["data"]["effective_flight_time_raw"]

int

Total effective flight time all time in seconds

N/A

$reply["data"]["db_archive_date"]

Date

(YYYY-MM-DD)Database archive date (i.e. flight data before this date is archived)

N/A

$reply["data"]["flight_time_by_type"]

Array

Summary report per aircraft for

N/A

$reply["data"]["flight_time_by_type"][]["model"]

String

Aircraft model

N/A

$reply["data"]["flight_time_by_type"][]["duration"]

String

Total flight duration of that model

N/A

$reply["data"]["flight_time_by_type"][]["duration_raw"]

int

Total flight duration of that model in seconds

N/A

$reply["data"]["flight_time_by_type"][]["effective_flight_time"]

String

Total effective flight time of that model

N/A

$reply["data"]["flight_time_by_type"][]["effective_flight_time_raw"]

int

Total effective flight time of that model in seconds

N/A

$reply["data"]["start_icaos"]

Array

Airports the pilot visits (as departure airports), order by counts

N/A

$reply["data"]["start_icaos"][]["icao"]

String

ICAO name of the departure airport. “----” if location is not an airport

N/A

$reply["data"]["start_icaos"][]["icao_name"]

String

Name of the departure airport. “Unknown” if location is not an airport

N/A

$reply["data"]["start_icaos"][]["country"]

String

Country of the departure airport. NULL if location is not an airport or country cannot be identified

N/A

$reply["data"]["start_icaos"][]["counts"]

Int

No of times visited

N/A

$reply["data"]["end_icaos"]

Array

Airports the pilot visits (as departure airports), order by counts

N/A

$reply["data"]["end_icaos"][]["icao"]

String

ICAO name of the arrival airport. “----” if location is not an airport

N/A

$reply["data"]["end_icaos"][]["icao_name"]

String

Name of the arrival airport. “Unknown” if location is not an airport

N/A

$reply["data"]["end_icaos"][]["country"]

String

Country of the arrival airport. NULL if location is not an airport or country cannot be identified

N/A

$reply["data"]["end_icaos"][]["counts"]

Int

No of times visited

N/A

$reply["data"]["flight_list"]

Array

Flight list in current/archive result set (100 results after offset)

N/A

$reply["data"]["flight_list"][]["row"]

int

Row id in current/archive result set

N/A

$reply["data"]["flight_list"][]["id"]

int

Flight id in DB

N/A

$reply["data"]["flight_list"][]["callsign"]

String

Callsign

N/A

$reply["data"]["flight_list"][]["model"]

String

Aircraft model

N/A

$reply["data"]["flight_list"][]["start_time"]

String

Flight start time

N/A

$reply["data"]["flight_list"][]["start_time_raw"]

int

Flight start time in seconds (since Unix epoch)

N/A

$reply["data"]["flight_list"][]["start_location"]["icao"]

String

ICAO name of the departure airport. “----” if location is not an airport. NULL if data not yet been updated

N/A

$reply["data"]["flight_list"][]["start_location"]["icao_name"]

String

Name of the departure airport. “Unknown” if location is not an airport. NULL if data not yet been updated

N/A

$reply["data"]["flight_list"][]["start_location"]["country"]

String

Country of the departure airport. NULL if location is not an airport or country cannot be identified

N/A

$reply["data"]["flight_list"][]["end_time"]

String

Flight end time

N/A

$reply["data"]["flight_list"][]["end_time_raw"]

int

Flight end time in seconds (since Unix epoch)

N/A

$reply["data"]["flight_list"][]["end_location"]["icao"]

String

ICAO name of the arrival airport. “----” if location is not an airport. NULL if data not yet been updated

N/A

$reply["data"]["flight_list"][]["end_location"]["icao_name"]

String

Name of the arrival airport. “Unknown” if location is not an airport. NULL if data not yet been updated

N/A

$reply["data"]["flight_list"][]["end_location"]["country"]

String

Country of the arrival airport. NULL if location is not an airport or country cannot be identified

N/A

$reply["data"]["flight_list"][]["duration"]

String

Flight duration

N/A

$reply["data"]["flight_list"][]["duration_raw"]

int

Flight duration in seconds

N/A

$reply["data"]["flight_list"][]["numwpts"]

int

Number of way points

N/A

$reply["data"]["flight_list"][]["effective_flight_time"]

String

Effective flight time

N/A

$reply["data"]["flight_list"][]["effective_flight_time_raw"]

int

Effective flight time in seconds

N/A

$reply["data"]["log"]

Array

Array of logs. NULL if no data

N/A

$reply["data"]["log"][]["operating_user"]

String

Origin (Username/IP) or the operation

N/A

$reply["data"]["log"][]["action"]

String

Action

N/A

$reply["data"]["log"][]["time"]

String

Time of operation

N/A

$reply["data"]["log"][]["comments"]

String

Comments (NULL if not set)

N/A

 

2. Log of data changes of particular callsign: https://fgtracker.ml/modules/fgtracker/interface.php?action=alterlog&callsign=Quofei

Array

Type

Description

GET Parameter

$reply["data"]["log"]

Array

Array of logs

N/A

$reply["data"]["log"][]["flight_id"]

int

flight id of the flight concerned

N/A

$reply["data"]["log"][]["operating_user"]

String

Origin (Username/IP) or the operation

N/A

$reply["data"]["log"][]["action"]

String

Action

N/A

$reply["data"]["log"][]["time"]

String

Time of operation

N/A

$reply["data"]["log"][]["comments"]

String

Comments (NULL if not set)

N/A

 

3. To get a report of a particular flight: https://fgtracker.ml/modules/fgtracker/interface.php?action=flight&flightid=3912093

Array

Type

Description

GET Parameter

$reply["data"]["log"]

Array

Array of logs. NULL if no data

N/A

$reply["data"]["log"][]["operating_user"]

String

Origin (Username/IP) or the operation

N/A

$reply["data"]["log"][]["action"]

String

Action

N/A

$reply["data"]["log"][]["time"]

String

Time of operation

N/A

$reply["data"]["log"][]["comments"]

String

Comments (NULL if not set)

N/A

$reply["data"]["flight_id"]

Int

Flight id in DB

&flightid=

$reply["data"]["callsign"]

String

Callsign

N/A

$reply["data"]["model"]

String

Aircraft model

N/A

$reply["data"]["start_time"]

String

Flight start time

N/A

$reply["data"]["start_time_utc"]

String

Flight start time in UTC

N/A

$reply["data"]["start_localtime"]

String

Flight start local time (only available if departure airport be identified)

N/A

$reply["data"]["start_time_raw"]

int

Flight start time in seconds (since Unix epoch)

N/A

$reply["data"]["start_location"]["icao"]

String

ICAO name of the departure airport. “----” if start location is not an airport

N/A

$reply["data"]["start_location"]["icao_name"]

String

Name of the departure airport. “Unknown” if start location is not an airport

N/A

$reply["data"]["start_location"]["country"]

String

Country of the departure airport. NULL if start location is not an airport or country cannot be identified

N/A

$reply["data"]["start_location"]["zone"]

String

(Time)zone of the departure airport. NULL if start location is not an airport or zone cannot be identified

N/A

$reply["data"]["start_location"]["start_time_local"]

String

Flight start local time (if departure airport be identified, otherwise missing)

N/A

$reply["data"]["end_time"]

String

Flight end time

N/A

$reply["data"]["end_time_utc"]

String

Flight end time in UTC

N/A

$reply["data"]["end_time_raw"]

int

Flight end time in seconds (since Unix epoch)

N/A

$reply["data"]["end_location"]["icao"]

String

ICAO name of the arrival airport. “----” if end location is not an airport

N/A

$reply["data"]["end_location"]["icao_name"]

String

Name of the arrival airport. “Unknown” if end location is not an airport

N/A

$reply["data"]["end_location"]["country"]

String

Country of the arrival airport. NULL if end location is not an airport or country cannot be identified

N/A

$reply["data"]["end_location"]["zone"]

String

(Time)zone of the arrival airport. NULL if end location is not an airport or zone cannot be identified

N/A

$reply["data"]["end_location"]["end_time_local"]

String

Flight end local time (if arrival airport be identified and the flight has ended, otherwise missing)

N/A

$reply["data"]["duration"]

String

Flight duration

N/A

$reply["data"]["duration_raw"]

int

Flight duration in seconds

N/A

$reply["data"]["wpts"]

String

Number of way points

N/A

$reply["data"]["wpt"]

Array

Array of way points

N/A

$reply["data"]["wpt"][]["time"]

String

Time of waypoint recorded

N/A

$reply["data"]["wpt"][]["time_raw"]

int

Time of waypoint recorded in seconds (since Unix epoch)

N/A

$reply["data"]["wpt"][]["lat"]

Float

Latitude of waypoint recorded

N/A

$reply["data"]["wpt"][]["lon"]

Float

Longitude of waypoint recorded

N/A

$reply["data"]["wpt"][]["alt"]

Float

Altitude of waypoint recorded

N/A

$reply["data"]["previous_flight"]["flight_id"]

Int

Previous flight’s flight id in DB

N/A

$reply["data"]["previous_flight"]["model"]

String

Previous flight’s aircraft model

N/A

$reply["data"]["previous_flight"]["start_time"]

String

Previous flight’s start time in UTC

N/A

$reply["data"]["previous_flight"]["start_time_raw"]

int

Previous flight’s start time in seconds (since Unix epoch)

N/A

$reply["data"]["previous_flight"]["end_time"]

String

Previous flight’s end time in UTC

N/A

$reply["data"]["previous_flight"]["end_time_raw"]

int

Previous flight’s end time in seconds (since Unix epoch)

N/A

$reply["data"]["previous_flight"]["distance_difference"]

int

Distance between previous flight’s last waypoint and current flight’s first waypoint

N/A

$reply["data"]["previous_flight"]["mergeok"]

boolean

If the current flight can be merged to previous flight

N/A

 

 

 

 

 

4. To get live data (waypoints) from FGTracker: https://fgtracker.ml/modules/fgtracker/interface.php?action=livewaypoints 

Array

Type

Description

GET Parameter

$reply["data"]["wpt"]

Array

Array of way points

N/A

$reply["data"]["wpt"][]["id"]

int

Waypoint id

N/A

$reply["data"]["wpt"][]["flight_id"]

int

Flight id in DB

N/A

$reply["data"]["wpt"][]["callsign"]

String

Callsign

N/A

$reply["data"]["wpt"][]["model"]

String

Aircraft model

N/A

$reply["data"]["wpt"][]["time"]

String

Time of waypoint recorded

N/A

$reply["data"]["wpt"][]["time_raw"]

int

Time of waypoint recorded in seconds (since Unix epoch)

N/A

$reply["data"]["wpt"][]["lat"]

Float

Latitude of waypoint recorded

N/A

$reply["data"]["wpt"][]["lon"]

Float

Longitude of waypoint recorded

N/A

$reply["data"]["wpt"][]["alt"]

Float

Altitude of waypoint recorded

N/A

$reply["data"]["wpt"][]["bearing"]

Int

Calculated bearing of the flight

N/A

$reply["data"]["wpt"][]["speed_kts"]

Float

Calculated speed of the flight

N/A

$reply["data"]["wpt"][]["current_status"]

String

Current status. “OPEN” – still flying, “CLOSED” – already left.

N/A

 

5. To get live data (pilots) from FGTracker: https://fgtracker.ml/modules/fgtracker/interface.php?action=livepilots

* Please note there is performance impact (around 3 sec) if wpt flag (include waypoint information) is defined.

Array

Type

Description

GET Parameter

$reply["data"]["pilot"]

Array

Array of flying pilots (Return NULL if no data)

N/A

$reply["data"]["pilot"][]["callsign"]

String

Callsign

&callsign= (optional)

$reply["data"]["pilot"][]["flight_id"]

int

Flight id in DB

N/A

$reply["data"]["pilot"][]["model"]

String

Aircraft model

N/A

$reply["data"]["pilot"][]["start_time"]

String

Flight start time

N/A

$reply["data"]["pilot"][]["start_time_raw"]

int

Flight start time in seconds (since Unix epoch)

N/A

$reply["data"]["pilot"][]["start_location"]["icao"]

String

ICAO name of the departure airport. “----” if start location is not an airport

N/A

$reply["data"]["pilot"][]["start_location"]["icao_name"]

String

Name of the departure airport. “Unknown” if start location is not an airport

N/A

$reply["data"]["pilot"][]["start_location"]["country"]

String

Country which the departure airport locates. ISO 3166-1 alpha-2 codes. NULL if unknown

N/A

$reply["data"]["pilot"][]["start_location"]["city"]

String

Region/City which the departure airport locates. NULL if unknown

N/A

$reply["data"]["pilot"][]["wpt"]

Array

Array of way points (order by time descending)

&wpt=y, otherwise missing

$reply["data"]["pilot"][]["wpt"][]["time"]

String

Time of waypoint recorded

&wpt=y, otherwise missing

$reply["data"]["pilot"][]["wpt"][]["time_raw"]

int

Time of waypoint recorded in seconds (since Unix epoch)

&wpt=y, otherwise missing

$reply["data"]["pilot"][]["wpt"][]["lat"]

Float

Latitude of waypoint recorded

&wpt=y, otherwise missing

$reply["data"]["pilot"][]["wpt"][]["lon"]

Float

Longitude of waypoint recorded

&wpt=y, otherwise missing

$reply["data"]["pilot"][]["wpt"][]["alt"]

Float

Altitude of waypoint recorded

&wpt=y, otherwise missing

 

6. To show the pilot list (order by rank): https://fgtracker.ml/modules/fgtracker/interface.php?action=pilotlist

 Array

Type

Description

GET Parameter

$reply["data"]["pilot_list_offset"]

int

Offset of the pilot list If offset > number of pilots, offset=0

&offset= (default=0)

$reply["data"]["no_of_pilots"]

int

Total number of pilots in DB

N/A

$reply["data"]["orderby"]

String

The list is order by

&orderby= (default="alltime")
"orderby" can be either "alltime", "lastweek" or "last30days"

$reply["data"]["pilot"]

Array

Array of pilots (100 records)

N/A

$reply["data"]["pilot"][]["rank"]

int

Rank (according to effective flight time)

N/A

$reply["data"]["pilot"][]["callsign"]

String

Callsign

N/A

$reply["data"]["pilot"][]["lastweek"]

String

Total flight time in last 7 days

N/A

$reply["data"]["pilot"][]["lastweek_raw"]

int

Total flight time in last 7 days in seconds

N/A

$reply["data"]["pilot"][]["last30days"]

String

Total flight time in last 30 days

N/A

$reply["data"]["pilot"][]["last30days_raw"]

int

Total flight time in last 30 days in seconds

N/A

$reply["data"]["pilot"][]["total_flight_time"]

String

Total flight time all time

N/A

$reply["data"]["pilot"][]["total_flight_time_raw"]

int

Total flight time all time in seconds

N/A

$reply["data"]["pilot"][]["effective_flight_time"]

String

Total effective flight time all time

N/A

$reply["data"]["pilot"][]["effective_flight_time_raw"]

int

Total effective flight time all time in seconds

N/A

 

7. 10 recent started/ended flight: https://fgtracker.ml/modules/fgtracker/interface.php?action=recentstateswitch

Array

Type

Description

GET Parameter

$reply["data"]["started"]["pilot"]

Array

Array of recent started flight (10 records)

N/A

$reply["data"]["started"]["pilot"][]["flight_id"]

int

Flight id in DB

N/A

$reply["data"]["started"]["pilot"][]["callsign"]

String

Callsign

N/A

$reply["data"]["started"]["pilot"][]["model"]

String

Aircraft model

N/A

$reply["data"]["started"]["pilot"][]["start_time"]

String

Flight start time

N/A

$reply["data"]["started"]["pilot"][]["start_time_raw"]

int

Flight start time in seconds (since Unix epoch)

N/A

$reply["data"]["ended"]["pilot"]

Array

Array of recent ended flight (10 records)

N/A

$reply["data"]["ended"]["pilot"][]["flight_id"]

int

Flight id in DB

N/A

$reply["data"]["ended"]["pilot"][]["callsign"]

String

Callsign

N/A

$reply["data"]["ended"]["pilot"][]["model"]

String

Aircraft model

N/A

$reply["data"]["ended"]["pilot"][]["end_time"]

String

Flight end time

N/A

$reply["data"]["ended"]["pilot"][]["end_time_raw"]

int

Flight end time in seconds (since Unix epoch)

N/A

 

8. Airport information: https://fgtracker.ml/modules/fgtracker/interface.php?action=airport&icao=VHXX

Array

Type

Description

GET Parameter

$reply["data"]["icao"]

String

ICAO name of the airport

&icao=

$reply["data"]["name"]

String

Airport name defined in X-plane

N/A

$reply["data"]["type"]

int

Airport type defined in X-plane (100=land airport; 101=sea airfield; 102=haliport)

N/A

$reply["data"]["lat"]

Float

Latitude of airport

N/A

$reply["data"]["lon"]

Float

Longitude of airport

N/A

$reply["data"]["alt"]

Float

Altitude of airport

N/A

$reply["data"]["city"]

String

City/Region that the airport locates

N/A

$reply["data"]["country"]

String

Country that the airport locates

N/A

$reply["data"]["zone"]

String

(Time)zone of the airport

N/A

$reply["data"]["administrative_area_level_1"]

String

Administrative area level 1/2/3/4 that the airport locates. NULL if unavailable (obtained from Google Map Geocoding)

N/A

$reply["data"]["administrative_area_level_2"]

String

N/A

$reply["data"]["administrative_area_level_3"]

String

N/A

$reply["data"]["administrative_area_level_4"]

String

N/A