PureTrack Traffic API
PureTrack provides a simple API to allow your application to use PureTrack live tracking data. Things to note:
- A PureTrack API Key is required for your application. Contact Us to obtain a key.
- Users must be a PureTrack Pro subscriber to access PureTrack data via third party applications.
Authentication Overview
PureTrack uses a simple API token system to authenticate your users. Here's an overview how it works:
- You present a username/password field for your users to login to their PureTrack account.
- Call the /api/login request with your app key, username and password.
- This returns an API Token, and confirms if they are a PureTrack Pro user or not. The tokens do not expire unless a user manually removes it from their account. So generally login is only required once.
- Use the API token on all future requests.
Note use the following header on all requests to ensure JSON is returned.
API Endpoints
POST https://puretrack.io/api/login
Login the user and returns an access token to use for future requests, and indicates if the user is currently a PureTrack Pro subscriber or not.
Required Parameters:
- key - Your application API key, Contact Us to obtain a key.
- email - the user's email.
- password - the user's password.
Example Response:
{"access_token":"26|QDB332hx1mI5vgaqbaX8BtzYpeGx0Y2pZqdoQXeeL387d28a","pro":true}
GET https://puretrack.io/api/logout
Logout the user.
Required Parameters:
Example Response:
200 and Some HTML that it shouldn't be outputting... To be fixed!
POST https://puretrack.io/api/traffic
Fetch PureTrack live traffic data. Only available to PureTrack Pro Users.
Requires Bearer authentication with token provide by /api/login.
Required Parameters (POST or GET parameters fine):
- lat1: lat of bounding box top right, decimal
- long1: long of bounding box top right, decimal
- lat2: lat of bounding box bottom left, decimal
- long2; long of bounding box bottom left, decimal
Optional Parameters
- o: List of type IDs to return, comma separated. e.g. o=63,1,2,27 returns all gliders and tow planes. A full list of types can be found at https://puretrack.io/types.json. Defaults to all types.
- t: Max age in minutes of points to return. Defaults to 5 minutes. Up to 24 hours. Warning high values may return a lot of data if the bounding box is large. Limited to 5 minutes if bounding box is too large.
- s: a list of PureTrack map item keys to always try and include in the response. e.g. s=Y-ZK-GOP,Y-ZK-CNC will always try and include the last known locations for aircraft ZK-GOP and ZK-CNC.
- i: Boolean 1 or 0. Isolate to the items listed with s or not. Defaults to 0.
Notes:
- When the bounding box size is too large, t value is lowered to 5 minutes, and data for the whole planet is returned.
- Bounding box used is expanded slightly by a factor of 1.2 to include aircraft around the edges of the requested bounding box.
Example Request:
GET https://puretrack.io/api/traffic?b1l=52.0&b1g=2.0&b2l=50.0&b2g=0.0&t=5
And don't forget to add the Auth Bearer token! Bearer token is added as a header. e.g. for Curl:
curl -H "Authorization: Bearer 26|QDB332hx1mI5vgaqbaX8BtzYpeGx0Y2pZqdoQXeeL387d28a" 'https://puretrack.io/api/traffic?b1l=52.0&b1g=2.0&b2l=50.0&b2g=0.0&t=5'
Example Response:
{
"lat_distance": 76153,
"long_distance": 182758,
"lat1": "-37.49503",
"long1": "176.54678",
"lat2": "-38.06575",
"long2": "174.82046",
"data": [
"T1713592586,L-37.78174,G174.88159,A4685,P1006.7,C338,S144.05,V-13.31,O56,DC828EA,U12,EZK-MZE,g43,mANZ118M,t4739.4,KY-ZK-MZE",
"T1713592582,L-37.79929,G175.37943,A1058,P1006.7,C43,S74.61,V20.28,O56,DC82336,U12,EZK-MVJ,g53,mANZ823M,t1112.5,KY-ZK-MVJ",
"T1713592574,L-37.58374,G175.9984,A1497,P1007.25,C350,S81.53,V0,O56,DC81958,U12,EZK-NED,mANZ258L,t1546.8,KY-ZK-NED"
],
"time": 32.78803825378418,
"success": true,
"http_code": 200
}
Parameters
- lat_distance, long_distance: distance of bounding box, for debugging
- lat1, long1, lat2, long2: bounding box corners used, for debugging
- data: the data points returned. Details below.
- time: time taken to process the request in ms
- success: boolean, true or false.
- http_code: the http_code returned
Data Rows Specification
The array of data is a list of comma separated lines. Each item is identified by it's first letter/digit, and is case sensitive. Most values are not guaranteed to exist except the timestamp, lat/long and key.
'T': Timestamp Epoch Unix Timestamp
'L': lat
'G': long
'K': key - PureTrack key, to uniquely identify this object in PureTrack. If matching an aircraft, it is prefixed with Y- plus rego. If matches a PureTrack target, prefixed wtih X- or Z-. For unknown items, prefixed with source type ID number and tracker_uid e.g. a FLARM target will be 0-ABC123.
'A': alt_gps - meters, altitude returned by most devices. ADSB calculated from local pressure. See also 't' for standard pressure altitude from ADSB.
'P': pressure - the current latest 6 hour pressure for nearest location, used to calibrate ADSB altitude.
'C': course in degrees 0-360
'S': speed in m/s
'V': v_speed in m/s
'O': object_type see list of types https://puretrack.io/types.json
'Z': timezone - not used at the moment (Timestamp returned is Unixtime).
'D': tracker_uid - The ID of the original tracker. In the case of FLARM FlarmID or ADSB ICAO hex code.
'H': stealth - If this item is stealth or not from flarm.
'Q': no_tracking - If this item is stealth or not from flarm
'I': signal_quality
'R': receiver_name
'U': source_type_id - ID of source of this point. List below of source IDs
'J': target_id - The PureTrack target ID. A 'target' matches an item to a map marker and other user configured options.
'B': label - Label, either returned from the tracking service, or added from what the user has configured via the target
'N': name - actual name of a pilot if provided
'E': rego - If an aircraft, the full rego e.g. ZK-GOP
'M': model - Aircraft model.
's': speed_calc - not used
'd': dist_calc - not used
'v': v_speed_calc - not used
'f': flying - not used
'x': ignore - not used
'g': gl - Ground level at this point
'i': tracker_id - Internal puretrack ID
'e': comp - not used?
'c': colour - Colour selected by user to use on map. Generated randomly if not provided.
'a': aircraft_id
'j': target_key
'k': inreach_id
'l': spot_id
'h': accuracy_horizontal
'z': accuracy_vertical
'u': username - Username provided by some services e.g. Skylines, Flymaster etc
'm': callsign - not used
'n': comp_name - Contest name
'b': comp_class - Name of the contest class
'q': comp_class_id - ID of the contest class
't': alt_standard - standard pressure altitude in meters
'r': thermal_climb_rate - m/s. calculated thermal climb rate from start of climb to current location.
'p': phone - user's phone number
'F': ffvl_key - if the target has an FFVL key
'!': random - If the item is a randomly generated ID from FLARM
Source IDs
- 0 = flarm
- 1 = spot
- 2 = particle
- 3 = overland
- 4 = spotnz
- 5 = inreachnz
- 6 = btraced
- 7 = api
- 8 = mt600-l-gnz
- 9 = inreach
- 10 = igc
- 11 = pi
- 12 = adsb
- 13 = igcdroid
- 14 = navigator
- 16 = puretrack
- 17 = teltonika
- 18 = celltracker
- 19 = mt600
- 20 = mt600-l
- 21 = api
- 22 = fr24
- 23 = xcontest
- 24 = skylines
- 25 = flymaster
- 26 = livegliding
- 27 = ADSBExchange
- 28 = adsb.lol
- 29 = adsb.fi
- 30 = SportsTrackLive
- 31 = FFVL Tracking
- 32 = Zoleo
- 33 = Total Vario
- 34 = Tracker App
- 35 = OGN ICAO
- 36 = XC Guide
- 37 = Bircom