### Traffic Data Response Example Source: https://puretrack.io/help/api Example of a successful response when fetching live traffic data. Includes bounding box details, data points, processing time, and success status. ```json { "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 } ``` -------------------------------- ### Set Location and Zoom Level in URL Source: https://puretrack.io/help/linking-embedding Example of setting the initial location and zoom level for PureTrack via URL parameters. ```url https://puretrack.io/?l=-37.73087,175.74903&z=14.2 ``` -------------------------------- ### Embed PureTrack with Custom Settings Source: https://puretrack.io/help/linking-embedding Append settings to the PureTrack URL using the 'settings' GET parameter. Settings are stored in browser local storage and will be used if not set in the URL. This example shows how to set altitude units, speed units, and disable the welcome screen. ```url https://puretrack.io?settings=altitudeUnits:meters,speedUnits:kilometersPerHour,showChart:false ``` -------------------------------- ### Login User and Get Access Token Source: https://puretrack.io/help/api Use this endpoint to authenticate users and obtain an access token for subsequent API requests. It also indicates the user's subscription status. ```json {"access_token":"26|QDB332hx1mI5vgaqbaX8BtzYpeGx0Y2pZqdoQXeeL387d28a","pro":true} ``` -------------------------------- ### Link to Registered Aircraft by Registration Source: https://puretrack.io/help/linking-embedding Link to a specific aircraft using the 'a' GET parameter with its registration. ```url https://puretrack.io/?a=ZK-TOW ``` -------------------------------- ### Link to a Group Source: https://puretrack.io/help/linking-embedding Example of a link to a specific group within PureTrack, obtained from the group menu. ```url https://puretrack.io/g/join-this-test-group ``` -------------------------------- ### Example API Insert Response Source: https://puretrack.io/help/api-insert This JSON object represents a successful response from the PureTrack API after inserting data points. It indicates the number of trackers and points received and inserted, processing time, and success status. ```json { "trackers_received": 2, "total_points_recieved": 6, "total_points_inserted": 5, "time": 29.019832611083984, "success": true, "http_code": 200 } ``` -------------------------------- ### API Login Source: https://puretrack.io/help/api This endpoint is used to authenticate users and obtain an API Token. It requires your application's API key, along with the user's PureTrack username and password. ```APIDOC ## POST /api/login ### Description Authenticates a user and returns an API Token. This token is used for subsequent API requests. ### Method POST ### Endpoint /api/login ### Request Body - **app_key** (string) - Required - Your application's API key. - **username** (string) - Required - The user's PureTrack username. - **password** (string) - Required - The user's PureTrack password. ### Response #### Success Response (200) - **api_token** (string) - The authentication token for the user. - **is_pro_user** (boolean) - Indicates if the user is a PureTrack Pro subscriber. ``` -------------------------------- ### Login User Source: https://puretrack.io/help/api Authenticates a user and returns an access token for subsequent requests. It also indicates the user's subscription status. ```APIDOC ## POST /api/login ### Description 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. ### Method POST ### Endpoint https://puretrack.io/api/login ### Parameters #### Query Parameters - **key** (string) - Required - Your application API key, Contact Us to obtain a key. - **email** (string) - Required - The user's email. - **password** (string) - Required - The user's password. ### Response #### Success Response (200) - **access_token** (string) - The authentication token. - **pro** (boolean) - Indicates if the user is a PureTrack Pro subscriber. ### Response Example ```json { "access_token": "26|QDB332hx1mI5vgaqbaX8BtzYpeGx0Y2pZqdoQXeeL387d28a", "pro": true } ``` ``` -------------------------------- ### Embed PureTrack with Settings in an iFrame Source: https://puretrack.io/help/linking-embedding Embed PureTrack into a website using an iFrame. Settings can be passed via URL parameters within the 'src' attribute. ```html ``` -------------------------------- ### Insert Multiple Tracker Data Source: https://puretrack.io/help/api-insert Send data for multiple trackers in a single API call by providing an array of tracker objects. Each tracker object requires its own key and DeviceID. ```json [{ "rego": "ZK-ABC", "label": "Sam ABC", "key": "{YOUR_KEY_GOES_HERE}", "type": 9, "deviceID": "1234", "username": "sambo", "points": [ { "ts": 1713563621, "lat": -41.2334745, "lng": 174.348365, "alt": 345.1, "speed": 25, "course": 270, "vspeed": 5.3 }, { "ts": 1713563624, "lat": -41.1634343, "lng": 174.36545, "alt": 335.1, "speed": 28, "course": 240, "vspeed": 5.1 } ] }, { "rego": "ZK-XYZ", "label": "Jimbo XYZ", "key": "{YOUR_KEY_GOES_HERE}", "type": 9, "deviceID": "4567", "username": "jimbo", "points": [ { "ts": 1713563621, "lat": -41.2334745, "lng": 174.348365, "alt": 345.1, "speed": 25, "course": 270, "vspeed": 5.3 }, { "ts": 1713563624, "lat": -41.1634343, "lng": 174.36545, "alt": 335.1, "speed": 28, "course": 240, "vspeed": 5.1 } ] }] ``` -------------------------------- ### Data Insertion Endpoint Source: https://puretrack.io/help/api-insert This endpoint allows you to insert data points for devices into PureTrack. It accepts various parameters to identify the device, link to registrations, and provide point data. The response indicates the success of the operation and the number of points processed. ```APIDOC ## POST /api/v1/data ### Description Inserts data points for a device into PureTrack. It supports linking to registered aircraft and provides detailed point data. ### Method POST ### Endpoint /api/v1/data ### Parameters #### Query Parameters - **deviceID** (string) - Required - A unique ID or username for your device/user. - **Rego** (string) - Optional - The aircraft registration to link to (e.g., ZK-ABC). - **label** (string) - Optional - The default label to be displayed on PureTrack. Ignored if 'Rego' is supplied. - **key** (string) - Required - Your application key. - **type** (string) - Optional - The type of device. A list can be found at https://puretrack.io/types.json. - **username** (string) - Optional - UserID on your system for optional linking. #### Request Body - **ts** (integer) - Required - Timestamp of the data point as an Epoch Unix Timestamp. - **lat** (number) - Required - Latitude in decimal format. - **lng** (number) - Required - Longitude in decimal format. - **alt** (number) - Optional - Altitude in meters. - **speed** (number) - Optional - Speed in meters per second. - **vspeed** (number) - Optional - Vertical speed in meters per second. - **course** (number) - Optional - Bearing or course in degrees (0 to 360). ### Response #### Success Response (200) - **trackers_received** (integer) - The number of trackers received. - **total_points_recieved** (integer) - The total number of data points received. - **total_points_inserted** (integer) - The number of data points successfully inserted. - **time** (number) - The time taken for the operation in seconds. - **success** (boolean) - Indicates if the operation was successful. - **http_code** (integer) - The HTTP status code of the response. ### Response Example { "trackers_received": 2, "total_points_recieved": 6, "total_points_inserted": 5, "time": 29.019832611083984, "success": true, "http_code": 200 } ``` -------------------------------- ### Link to Specific Tracker Source by Device ID Source: https://puretrack.io/help/linking-embedding Link to a specific device on PureTrack using its unique source ID and device ID. Note that ADSB sources are combined under source ID 46. ```url https://puretrack.io/?k=XX-123456 ``` -------------------------------- ### Insert Tracking Data Source: https://puretrack.io/help/api-insert This endpoint allows you to insert tracking data points for one or more devices. Ensure you include a unique DeviceID for each data source. ```APIDOC ## Insert Tracking Data ### Description This endpoint is used to send tracking data points to PureTrack. It supports sending data for a single tracker or multiple trackers in a single request. ### Method POST ### Endpoint https://puretrack.io/api/insert ### Request Body #### Single Tracker Example ```json { "rego": "ZK-ABC", "label": "asdf", "key": "{YOUR_KEY_GOES_HERE}", "type": 9, "deviceID": "1234", "username": "timbo", "points": [ { "ts": 1713563621, "lat": -41.2334745, "lng": 174.348365, "alt": 345.1, "speed": 25, "course": 270, "vspeed": 5.3 }, { "ts": 1713563624, "lat": -41.1634343, "lng": 174.36545, "alt": 335.1, "speed": 28, "course": 240, "vspeed": 5.1 }, { "ts": 1713563629, "lat": -41.194343, "lng": 174.38545, "alt": 325.1, "speed": 29, "course": 190, "vspeed": 5.0 } ] } ``` #### Multiple Trackers Example ```json [ { "rego": "ZK-ABC", "label": "Sam ABC", "key": "{YOUR_KEY_GOES_HERE}", "type": 9, "deviceID": "1234", "username": "sambo", "points": [ { "ts": 1713563621, "lat": -41.2334745, "lng": 174.348365, "alt": 345.1, "speed": 25, "course": 270, "vspeed": 5.3 }, { "ts": 1713563624, "lat": -41.1634343, "lng": 174.36545, "alt": 335.1, "speed": 28, "course": 240, "vspeed": 5.1 } ] }, { "rego": "ZK-XYZ", "label": "Jimbo XYZ", "key": "{YOUR_KEY_GOES_HERE}", "type": 9, "deviceID": "4567", "username": "jimbo", "points": [ { "ts": 1713563621, "lat": -41.2334745, "lng": 174.348365, "alt": 345.1, "speed": 25, "course": 270, "vspeed": 5.3 }, { "ts": 1713563624, "lat": -41.1634343, "lng": 174.36545, "alt": 335.1, "speed": 28, "course": 240, "vspeed": 5.1 } ] } ] ``` ### Parameters #### Request Body Fields - **rego** (string) - Required - Registration of the vehicle. - **label** (string) - Required - A user-friendly label for the tracker. - **key** (string) - Required - Your unique API key. - **type** (integer) - Required - Type of tracker (e.g., 9). - **deviceID** (string) - Required - A unique identifier for the device sending the data. - **username** (string) - Required - The username associated with the tracker. - **points** (array) - Required - An array of data points. - **ts** (integer) - Required - Timestamp of the data point (Unix epoch time). - **lat** (float) - Required - Latitude of the data point. - **lng** (float) - Required - Longitude of the data point. - **alt** (float) - Optional - Altitude of the data point. - **speed** (integer) - Optional - Speed at the data point. - **course** (integer) - Optional - Course (direction) at the data point. - **vspeed** (float) - Optional - Vertical speed at the data point. ``` -------------------------------- ### Fetch Live Traffic Data Source: https://puretrack.io/help/api Retrieve live traffic data within a specified bounding box. This endpoint requires Bearer authentication and is only available to PureTrack Pro users. Optional parameters allow filtering by category, specific types, age, and inclusion of specific items. ```http GET https://puretrack.io/api/traffic?lat1=52.0&long1=2.0&lat2=50.0&long2=0.0&t=5&key=abc1234 ``` ```bash curl -H "Authorization: Bearer 26|QDB332hx1mI5vgaqbaX8BtzYpeGx0Y2pZqdoQXeeL387d28a" 'https://puretrack.io/api/traffic?lat1=52.0&long1=2.0&lat2=50.0&long2=0.0&t=5&key=abc1234' ``` -------------------------------- ### Link to Non-Aircraft Map Markers by Hashtag Source: https://puretrack.io/help/linking-embedding Link to any configured PureTrack map marker, such as a boat or paraglider, using a hashtag. ```url https://puretrack.io/#whitianga-ferry1567 ``` -------------------------------- ### Logout User Source: https://puretrack.io/help/api Logs out the currently authenticated user. ```APIDOC ## GET /api/logout ### Description Logout the user. ### Method GET ### Endpoint https://puretrack.io/api/logout ### Parameters #### Query Parameters - **none** ### Response #### Success Response (200) - **Status**: 200 OK. Note: The source indicates unexpected HTML output which is noted as 'To be fixed!'. ``` -------------------------------- ### PureTrack Base URL Source: https://puretrack.io/help/linking-embedding The base URL for PureTrack. Location, zoom, and map marker settings can be appended to this URL. ```url https://puretrack.io/ ``` -------------------------------- ### Insert Single Tracker Data Source: https://puretrack.io/help/api-insert Use this JSON payload to send data for a single tracker. Ensure the DeviceID is unique and short for user convenience. ```json { "rego": "ZK-ABC", "label": "asdf", "key": "{YOUR_KEY_GOES_HERE}", "type": 9, "deviceID": "1234", "username": "timbo", "points": [ { "ts": 1713563621, "lat": -41.2334745, "lng": 174.348365, "alt": 345.1, "speed": 25, "course": 270, "vspeed": 5.3 }, { "ts": 1713563624, "lat": -41.1634343, "lng": 174.36545, "alt": 335.1, "speed": 28, "course": 240, "vspeed": 5.1 }, { "ts": 1713563629, "lat": -41.194343, "lng": 174.38545, "alt": 325.1, "speed": 29, "course": 190, "vspeed": 5.0 } ] } ``` -------------------------------- ### Fetch Traffic Data Source: https://puretrack.io/help/api Retrieves live traffic data within a specified geographical bounding box. This endpoint is restricted to PureTrack Pro users and requires Bearer authentication. ```APIDOC ## POST /api/traffic ### Description Fetch PureTrack live traffic data. Only available to PureTrack Pro Users. Requires Bearer authentication with token provided by /api/login. ### Method POST ### Endpoint https://puretrack.io/api/traffic ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **lat1** (decimal) - Required - Latitude of the bounding box top-right corner. - **long1** (decimal) - Required - Longitude of the bounding box top-right corner. - **lat2** (decimal) - Required - Latitude of the bounding box bottom-left corner. - **long2** (decimal) - Required - Longitude of the bounding box bottom-left corner. - **cat** (string) - Optional - Category of types. Must be: "air", "ground", "other" or "water". Can be combined with extra types specified with 'o'. - **o** (string) - Optional - List of type IDs to return, comma separated. Defaults to all types if not specified. - **t** (integer) - Optional - Max age in minutes of points to return. Defaults to 5 minutes. Up to 24 hours. - **s** (string) - Optional - A list of PureTrack map item keys to always try and include in the response. - **i** (boolean) - Optional - Isolate to the items listed with s or not. Defaults to 0. ### Request Example `GET https://puretrack.io/api/traffic?lat1=52.0&long1=2.0&lat2=50.0&long2=0.0&t=5&key=abc1234` `curl -H "Authorization: Bearer 26|QDB332hx1mI5vgaqbaX8BtzYpeGx0Y2pZqdoQXeeL387d28a" 'https://puretrack.io/api/traffic?lat1=52.0&long1=2.0&lat2=50.0&long2=0.0&t=5&key=abc1234'` ### Response #### Success Response (200) - **lat_distance** (number) - Distance of bounding box (for debugging). - **long_distance** (number) - Distance of bounding box (for debugging). - **lat1** (string) - Latitude of the bounding box corner used (for debugging). - **long1** (string) - Longitude of the bounding box corner used (for debugging). - **lat2** (string) - Latitude of the bounding box corner used (for debugging). - **long2** (string) - Longitude of the bounding box corner used (for debugging). - **data** (array) - The data points returned. - **time** (number) - Time taken to process the request in ms. - **success** (boolean) - True if the request was successful, false otherwise. - **http_code** (integer) - The HTTP status code returned. ### Response Example ```json { "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 } ``` ``` -------------------------------- ### Logout User Source: https://puretrack.io/help/api This endpoint logs out the current user. Note: The current implementation may return unexpected HTML. === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.