The LRMLive API allows you to acces your profile, landing and flight data in a simple, programmatic way using conventional HTTP requests.
All of the functionality that you are familiar with on the LRMLive website is also available through the API, allowing you to script and retrieve data for mobile applications or websites.
The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints.
Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted.
For simple retrieval of information about your account, flights, aerodrome data and METAR reports, you should use the GET method. The information you request will be returned to you as a JSON object.
The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.
Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.
In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.
In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered.
Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed.
If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently.
When a request is successful, a response body will typically be sent back in the form of a JSON object.
The value of these keys will generally be a JSON object for a request on a single object and an array of objects for a request on a collection of objects.
In addition to the main resource root, the response may also contain a meta object. This object contains information about the response itself.
The meta object contains a total key that is set to the total number of objects returned by the request. This has implications on the links object and pagination.
The meta object will only be displayed when it has a value. Currently, the meta object will have a value when a request is made on a collection (like droplets or domains).
To access the v2 API, you must specifiy a pilot token which is a randomly generated API token, you can create these from the integrations page.
When making API requests, you should specify the token as a HTTP header, the HTTP header name should be X-Pilot-Token, the value should be the token string.
When attempting to access the API without a valid token, the following response object will be received:
{ "error": { "status_code": 401, "message": "Unauthorised request" } }
When an error is returned from the API, instead of having a "data" root, an "error" root will instead be returned with details of the error, the following response object, an example of the format will be received:
{ "error": { "status_code": 404, "message": "Aerodrome not found." } }
Endpoints that respond with collections of data utilise some additional URL parameters for limiting results and moving through data-sets.
The limit parameter enables you to reduce or increase the number of collection items returned, the cursor parameter enables to you offset your results returned.
If not limit or cursor parameters are present in the request, the number of collection items are automatically set to 10 and the cursor at the beginning of the data set.
The following API endpoints and examples can be used to query data from the API...
GET /api/v2/pilot
This endpoint enables developers to query a collection of all pilots; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/pilotHEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/pilot"RESPONSE
The below example is only two results returned given that the ?limit=2 parameter has been used.
{ "data": [ { "id": 1, "name": "Anonymous", "bio": null, "handles": { "facebook": null, "twitter": null, "vatsim": null, "ivao": null }, "base": "EGST", "locale": "LEAS", "online_at": { "date": "2016-10-28 22:55:43.000000", "timezone_type": 3, "timezone": "UTC" }, "created_at": { "date": "2016-10-09 09:34:11.000000", "timezone_type": 3, "timezone": "UTC" }, "links": [ { "rel": "self", "uri": "/pilot/1" } ] }, { "id": 2, "name": "Bobby Allen", "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!", "handles": { "facebook": null, "twitter": "@bobsta63", "vatsim": "1167426", "ivao": "458562" }, "base": "EGSS", "locale": false, "online_at": { "date": "2016-10-29 17:56:27.000000", "timezone_type": 3, "timezone": "UTC" }, "created_at": { "date": "2016-10-09 10:41:46.000000", "timezone_type": 3, "timezone": "UTC" }, "links": [ { "rel": "self", "uri": "/pilot/2" } ] } ], "meta": { "cursor": { "current": null, "prev": "2", "next": 2, "count": 2 } } }
GET /api/v2/pilot/{id}
This endpoint enables developers to query a single profile resource for a specific pilot ID; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/pilot/{id}HEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/pilot/2"RESPONSE
{ "data": { "id": 2, "name": "Bobby Allen", "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!", "handles": { "facebook": null, "twitter": "@bobsta63", "vatsim": "1167426", "ivao": "458562" }, "base": "EGSS", "locale": false, "online_at": { "date": "2016-10-29 17:56:27.000000", "timezone_type": 3, "timezone": "UTC" }, "created_at": { "date": "2016-10-09 10:41:46.000000", "timezone_type": 3, "timezone": "UTC" }, "links": [ { "rel": "self", "uri": "/pilot/2" } ] } }
GET /api/v2/pilot/{id}/flight
This endpoint enables developers to query flight data (a collection) for a given pilot resource for a specific pilot ID; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/pilot/{id}/flightHEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/pilot/2/flight"RESPONSE
{ "data": [ { "id": 169324, "user": { "id": 2, "name": "Bobby Allen" }, "aircraft": { "name": "Airbus A320 IAE British " }, "fuel_used": 3717, "distance": { "nm": 491, "km": 910 }, "time": 5718, "takeoff": { "icao": "LSGG", "name": "Geneva", "time": { "date": "2016-10-09 18:14:20.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 46.237592, "lng": 6.108025 }, "hdg": { "mag": 43, "true": 44 }, "spd": { "tas": 154 }, "fob": 3717, "pitch": -9, "bank": 0, "wind": { "spd": 6, "dir": 9 } }, "landing": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2016-10-09 19:49:39.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.884976, "lng": 0.23501 }, "hdg": { "mag": 44, "true": 42 }, "spd": { "tas": 103 }, "fob": 3717, "pitch": -7, "bank": 0, "wind": { "spd": 5, "dir": 20 } }, "links": [ { "rel": "self", "uri": "/flight/169324" } ] }, .... { "id": 171177, "user": { "id": 2, "name": "Bobby Allen" }, "aircraft": { "name": "Airbus A320 IAE British " }, "fuel_used": 2499, "distance": { "nm": 338, "km": 626 }, "time": 3619, "takeoff": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2016-10-14 08:33:25.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.887266, "lng": 0.238408 }, "hdg": { "mag": 46, "true": 44 }, "spd": { "tas": 141 }, "fob": 2499, "pitch": -8, "bank": 0, "wind": { "spd": 6, "dir": 60 } }, "landing": { "icao": "EGPF", "name": "Glasgow", "time": { "date": "2016-10-14 09:33:45.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 55.871836, "lng": -4.433397 }, "hdg": { "mag": 53, "true": 49 }, "spd": { "tas": 109 }, "fob": 2499, "pitch": -5, "bank": 0, "wind": { "spd": 10, "dir": 80 } }, "links": [ { "rel": "self", "uri": "/flight/171177" } ] } ], "meta": { "cursor": { "current": null, "prev": 10, "next": 171177, "count": 10 } } }
GET /api/v2/flight
This endpoint enables developers to query flight data (a collection); an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/flightHEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/flight"RESPONSE
{ "data": [ { "id": 173994, "user": { "id": 4, "name": "AdamisFlying" }, "aircraft": { "name": "Beech King Air 350 Paint" }, "fuel_used": 0, "distance": { "nm": 2, "km": 3 }, "time": 41, "takeoff": { "icao": "KMIA", "name": "Miami Intl", "time": { "date": "2016-10-19 19:29:14.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 25.801182, "lng": -80.287768 }, "hdg": { "mag": 273, "true": 267 }, "spd": { "tas": 151 }, "fob": 0, "pitch": -7, "bank": 0, "wind": { "spd": 10, "dir": 6170 } }, "landing": { "icao": "KMIA", "name": "Miami Intl", "time": { "date": "2016-10-19 19:45:34.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 25.800841, "lng": -80.292927 }, "hdg": { "mag": 275, "true": 269 }, "spd": { "tas": 154 }, "fob": 0, "pitch": -1, "bank": 0, "wind": { "spd": 11, "dir": 6161 } }, "links": [ { "rel": "self", "uri": "/flight/173994" } ] }, .... { "id": 173997, "user": { "id": 1, "name": "Anonymous" }, "aircraft": { "name": "Carenado B1900D WHITE" }, "fuel_used": -1424, "distance": { "nm": 12, "km": 22 }, "time": 717, "takeoff": { "icao": null, "name": null, "time": { "date": "2016-10-19 19:04:14.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 25.107842, "lng": -77.567139 }, "hdg": { "mag": 123, "true": 115 }, "spd": { "tas": 0 }, "fob": -1424, "pitch": -2, "bank": 3, "wind": { "spd": 1, "dir": 348 } }, "landing": { "icao": "MYNN", "name": "Nassau Intl", "time": { "date": "2016-10-19 19:49:49.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 25.046394, "lng": -77.469699 }, "hdg": { "mag": 144, "true": 136 }, "spd": { "tas": 114 }, "fob": -1424, "pitch": -1, "bank": 0, "wind": { "spd": 0, "dir": 360 } }, "links": [ { "rel": "self", "uri": "/flight/173997" } ] } ], "meta": { "cursor": { "current": "173987", "prev": 10, "next": 173997, "count": 10 } } }
GET /api/v2/flight/{id}
This endpoint enables developers to query a single flight resource from a specific flight ID; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/flight/{id}HEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/flight/173994"RESPONSE
{ "data": { "id": 173994, "user": { "id": 4, "name": "AdamisFlying" }, "aircraft": { "name": "Beech King Air 350 Paint" }, "fuel_used": 0, "distance": { "nm": 2, "km": 3 }, "time": 41, "takeoff": { "icao": "KMIA", "name": "Miami Intl", "time": { "date": "2016-10-19 19:29:14.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 25.801182, "lng": -80.287768 }, "hdg": { "mag": 273, "true": 267 }, "spd": { "tas": 151 }, "fob": 0, "pitch": -7, "bank": 0, "wind": { "spd": 10, "dir": 6170 } }, "landing": { "icao": "KMIA", "name": "Miami Intl", "time": { "date": "2016-10-19 19:45:34.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 25.800841, "lng": -80.292927 }, "hdg": { "mag": 275, "true": 269 }, "spd": { "tas": 154 }, "fob": 0, "pitch": -1, "bank": 0, "wind": { "spd": 11, "dir": 6161 } }, "links": [ { "rel": "self", "uri": "/flight/173994" } ] } }
GET /api/v2/aerodrome/{icao}
This endpoint enables developers to query a single aerodrome resource for a specific ICAO; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/aerodrome/{icao}HEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/aerodrome/egss"RESPONSE
{ "data": { "icao": "EGSS", "name": "Stansted", "locale": { "city": "London", "state": null, "county": "United Kingdom" }, "geo": { "lat": 51.884998, "lng": 0.235 }, "alt": 348, "mag_var": -3, "freqencies": { "atis": 127.17, "cd": null, "gnd": 121.72, "tower": 123.8, "unicom": null, "multicom": null, "app": 120.62, "dep": 126.95 }, "runways": [ { "name": "05", "tpye": "Asphalt", "length": 9984, "hdg": 46, "geo": { "lat": 51.875076, "lng": 0.219898 }, "ils": { "id": "ISED", "freqency": 110.5, "hdg": 46, "slope": 3 } }, { "name": "23", "tpye": "Asphalt", "length": 9984, "hdg": 226, "geo": { "lat": 51.895157, "lng": 0.250072 }, "ils": { "id": "ISX", "freqency": 110.5, "hdg": 226, "slope": 3 } } ], "links": [ { "rel": "self", "uri": "/aerodrome/10325" } ] } }
GET /api/v2/aerodrome/{icao}/arrivals
This endpoint enables developers to query flight arrivals for a specific aerodrome ICAO; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/aerodrome/{icao}/arrivalsHEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/aerodrome/egss/arrivals"RESPONSE
{ "data": [ { "id": 1, "user": { "id": 1, "name": "Anonymous" }, "aircraft": { "name": "Carenado A36 Bonanza 60t" }, "fuel_used": 0, "distance": { "nm": 0, "km": 0 }, "time": 0, "takeoff": null, "landing": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2015-03-31 18:50:35.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.891648, "lng": 0.244799 }, "hdg": { "mag": 225, "true": 223 }, "spd": { "tas": 0 }, "fob": 0, "pitch": 0, "bank": 0, "wind": { "spd": 0, "dir": 0 } }, "links": [ { "rel": "self", "uri": "/flight/1" } ] }, .... { "id": 1293, "user": { "id": 1, "name": "Anonymous" }, "aircraft": { "name": "Boeing 737-8ASNGX Ryanai" }, "fuel_used": 0, "distance": { "nm": 0, "km": 0 }, "time": 0, "takeoff": null, "landing": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2015-04-28 19:32:31.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.891674, "lng": 0.244871 }, "hdg": { "mag": 224, "true": 223 }, "spd": { "tas": 0 }, "fob": 0, "pitch": 0, "bank": 0, "wind": { "spd": 0, "dir": 0 } }, "links": [ { "rel": "self", "uri": "/flight/1293" } ] } ], "meta": { "cursor": { "current": null, "prev": 10, "next": 1293, "count": 10 } } }
GET /api/v2/aerodrome/{icao}/departures
This endpoint enables developers to query flight departures for a specific aerodrome ICAO; an example of this request is as follows:
REQUESThttps://lrmlive.com/api/v2/aerodrome/{icao}/departuresHEADERS
Content-Type: application/json X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlTcURL REQUEST EXAMPLE
curl -X GET -H "Content-Type: application/json" -H "X-Pilot-Token: HbS0fI8bJ0rdZxJYIYGqQrqAOMmY1iU0IwyvAczM0kMmlSDWqVVQDB1tzOPYYYlT" "https://lrmlive.com/api/v2/aerodrome/egss/departures"RESPONSE
{ "data": [ { "id": 136708, "user": { "id": 1, "name": "Anonymous" }, "aircraft": { "name": "F-22 Raptor - 525th Figh" }, "fuel_used": 0, "distance": { "nm": 0, "km": 0 }, "time": 263, "takeoff": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2016-08-10 13:28:13.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.879083, "lng": 0.225983 }, "hdg": { "mag": 0, "true": 0 }, "spd": { "tas": 0 }, "fob": 0, "pitch": 0, "bank": 0, "wind": { "spd": 0, "dir": 0 } }, "landing": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2016-08-10 13:32:36.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.879721, "lng": 0.227233 }, "hdg": { "mag": 42, "true": 40 }, "spd": { "tas": 159 }, "fob": 0, "pitch": -5, "bank": -1, "wind": { "spd": 8, "dir": 320 } }, "links": [ { "rel": "self", "uri": "/flight/136708" } ] }, .... { "id": 140312, "user": { "id": 1, "name": "Anonymous" }, "aircraft": { "name": "Beech Baron 58 w G1000" }, "fuel_used": 0, "distance": { "nm": 75, "km": 139 }, "time": 1961, "takeoff": { "icao": "EGSS", "name": "Stansted", "time": { "date": "2016-08-18 08:51:07.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.879503, "lng": 0.226683 }, "hdg": { "mag": 0, "true": 0 }, "spd": { "tas": 0 }, "fob": 0, "pitch": 0, "bank": 0, "wind": { "spd": 0, "dir": 0 } }, "landing": { "icao": "EGVA", "name": "Fairford", "time": { "date": "2016-08-18 09:23:48.000000", "timezone_type": 3, "timezone": "UTC" }, "geo": { "lat": 51.683662, "lng": -1.775361 }, "hdg": { "mag": 257, "true": 254 }, "spd": { "tas": 0 }, "fob": 0, "pitch": 5, "bank": -10, "wind": { "spd": 0, "dir": 155 } }, "links": [ { "rel": "self", "uri": "/flight/140312" } ] } ], "meta": { "cursor": { "current": null, "prev": 10, "next": 142881, "count": 10 } } }