About

Hopefully these API functions will make it a little easier for people to manage their OGN receivers

1. Get Station Information

Return information about one or all stations in the database including their location and availability status.

URL

http://flarmrange.onglide.com/api/1/stations

Optional Query Parameters

JSON Response

{"stations":[
	   {"s":"UKDUN","lt":51.8715,"lg":-0.5475,"u":"U","ut":"2014-06-05 15:13","b":3,"stats1":"2014-06-06 09:45,16,1,5"}
	  ... other stations ...
	  ]}

Examples:

Get current location and status for all stations
http://flarmrange.onglide.com/api/1/stations
{"stations":[{"s":"LFRN","lt":48.0972,"lg":-1.6848,"u":"D","ut":"","b":0,"stats1":""},{"s":"Saltby","lt":52.8325,"lg":-0.6997,"u":"D","ut":"2014-05-11 10:35","b":0,"stats1":""},{"s":"BIRRFELD","lt":47.4942,"lg":8.2208,"u":"D","ut":"2014-05-11 16:30","b":0,"stats1":""},{"s":"Klippenec","lt":48.1070,"lg":8.7560,"u":"D","ut":"2014-05-14 13:22","b":0,"stats1":""},{"s":"EDTQ","lt":48.8652,"lg":9.2227,"u":"D","ut":"2014-05-15 07:53","b":0,"stats1":""},{"s":"Cern","lt":46.2563,"lg":6.0588,"u":"D","ut":"2014-05-15 13:58","b":0,"stats1":""},{"s":"GCHGG-10","lt":51.4395,"lg":-2.5570,"u":"D","ut":"2014-05-15 18:06","b":0,"stats1":""},{"s":"Loehne2","lt":51.2000,"lg":8.7000,"u":"D","ut":"2014-05-16 17:03","b":0,"stats1":""},{"s":"Swind","lt":53.1573,"lg":-0.7015,"u":"D","ut":"2014-05-17 22:24","b":0,"stats1":""},{"s":"Loehne1","lt":52.1920,"lg":8.7155,"u":"D","ut":"2014-05-18 11:09","b":0,"stats1":""},{"s":"LFOY","lt":49.5442,"lg":0.3592,"u":"D","ut":"2014-05-19 07:56","b":0,"stats1":""},{"s":"Mynd","lt":52.5180,"lg":-2.8810,"u":"D","ut":"2014-05-19 07:56","b":0,"stats1":""},{"s":"Saleve","lt":46.1283,"lg":6.1737,"u":"D","ut":"2014-05-19 07:56","b":0,"stats1":""},{"s":"EFRY","lt":60.7562,"lg":23.9718,"u":"D","ut":"2014-05-20 11:36","b":0,"stats1":""},{"s":"GM8ARV","lt":55.9000,"lg":-3.2000,"u":"D","ut":"2014-05-22 05:57","b":0,"stats1":""},{...

Get a list of stations that have been active on a specific date. Use this to filter on what is working now, by passing in todays date. Don't forget all dates and times are UTC. This will also give you the latest location and statistics
http://flarmrange.onglide.com/api/1/stations?station=UKDUN&start=2014-06-06
{"stations":[{"s":"UKDUN","lt":51.8715,"lg":-0.5475,"u":"U","ut":"2014-06-05 15:13","b":1,"stats1":"2014-06-06 10:35,18,1,0"}]}

Find out where a station was on a specific date... Not very useful! If you want stats for a single station on a specific date please use the stats api function.
http://flarmrange.onglide.com/api/1/stations?station=UKDUN&end=2014-06-04
{"stations":[{"s":"UKDUN","lt":51.8715,"lg":-0.5475,"u":"U","ut":"2014-06-05 15:13","b":1,"stats1":"2014-06-04 00:00,0,0,0"}]}

2. Get Station Stats

Return performance statistics on a specific station

URL

http://flarmrange.onglide.com/api/1/stats

Mandatory Query Parameter

Optional Query Parameters

JSON Response

{"stats":[
	  {"t":"2014-06-06 10:20","p":498,"g":9,"c":2,"la":2.1,"temp":54}
	  ... other time periods ...
	  ]}

 or when grouping

{"stats":[{"t":"2014-06","p":816.0,"g":29.0,"c":45.0,"la":3.3,"n":1289,"temp":59}]}

Examples:

Get statistics for the last 1 hour for your station http://flarmrange.onglide.com/api/1/stats?station=UKDUN&rows=20
{"stats":[{"t":"2014-06-09 15:40","p":199,"g":5,"c":8,"la":2.7,"temp":49},{"t":"2014-06-09 15:35","p":198,"g":6,"c":8,"la":2.7,"temp":49},{"t":"2014-06-09 15:30","p":201,"g":7,"c":19,"la":2.8,"temp":50},{"t":"2014-06-09 15:25","p":141,"g":8,"c":17,"la":2.3,"temp":49},{"t":"2014-06-09 15:20","p":65,"g":5,"c":17,"la":1.7,"temp":50},{"t":"2014-06-09 15:15","p":53,"g":2,"c":3,"la":1.8,"temp":49},{"t":"2014-06-09 15:10","p":96,"g":3,"c":7,"la":2.3,"temp":48},{"t":"2014-06-09 15:05","p":108,"g":4,"c":5,"la":2.7,"temp":49},{"t":"2014-06-09 15:00","p":191,"g":6,"c":20,"la":3.0,"temp":50},{"t":"2014-06-09 14:55","p":163,"g":6,"c":9,"la":2.4,"temp":53},{"t":"2014-06-09 14:50","p":96,"g":5,"c":8,"la":1.5,"temp":53},{"t":"2014-06-09 14:45","p":60,"g":5,"c":3,"la":1.6,"temp":51},{"t":"2014-06-09 14:40","p":41,"g":2,"c":3,"la":1.1,"temp":50},{"t":"2014-06-09 14:35","p":9,"g":1,"c":3,"la":1.6,"temp":50},{"t":"2014-06-09 14:30","p":23,"g":2,"c":7,"la":1.4,"temp":51},{"t":"2014-06-09 14:25","p":60,"g":3,"c":7,"la":2.1,"temp":0},{"t":"2014-06-09 14:20","p":135,"g":4,"c":8,"la":2.4,"temp":0},{"t":"2014-06-09 14:10","p":159,"g":6,"c":14,"la":2.6,"temp":0},{"t":"2014-06-09 14:05","p":132,"g":7,"c":11,"la":2.2,"temp":0},{"t":"2014-06-09 14:00","p":125,"g":5,"c":13,"la":2.0,"temp":0}]}

Get summary statistics for your station - Maximums for the last 40 months http://flarmrange.onglide.com/api/1/stats?station=UKDUN&grouping=month&aggregate=max
{"stats":[{"t":"2014-06","p":816.0,"g":29.0,"c":45.0,"la":3.3,"n":1289,"temp":56}]}
Get summary statistics for your station - Averages for the last 24 hours http://flarmrange.onglide.com/api/1/stats?station=UKDUN&grouping=hour&aggregate=avg&rows=24
{"stats":[{"t":"2014-06-09 15","p":139.1,"g":5.1,"c":11.6,"la":2.4,"n":9,"temp":49.2},{"t":"2014-06-09 14","p":91.2,"g":4.2,"c":7.8,"la":1.9,"n":11,"temp":28.0},{"t":"2014-06-09 13","p":63.2,"g":3.5,"c":7.5,"la":1.6,"n":12,"temp":0.0},{"t":"2014-06-09 12","p":0.0,"g":0.0,"c":0.0,"la":1.0,"n":12,"temp":0.0},{"t":"2014-06-09 11","p":15.2,"g":1.4,"c":3.5,"la":1.2,"n":11,"temp":0.0},{"t":"2014-06-09 10","p":22.2,"g":1.3,"c":3.8,"la":1.4,"n":12,"temp":0.0},{"t":"2014-06-09 09","p":11.8,"g":1.1,"c":3.1,"la":1.2,"n":12,"temp":0.0},{"t":"2014-06-09 08","p":25.0,"g":1.8,"c":5.0,"la":1.2,"n":4,"temp":0.0},{"t":"2014-06-09 01","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":10,"temp":0.0},{"t":"2014-06-09 00","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":12,"temp":0.0},{"t":"2014-06-08 23","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":12,"temp":0.0},{"t":"2014-06-08 22","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":12,"temp":0.0},{"t":"2014-06-08 21","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":12,"temp":0.0},{"t":"2014-06-08 20","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":12,"temp":0.0},{"t":"2014-06-08 19","p":0.0,"g":0.0,"c":0.0,"la":0.9,"n":12,"temp":0.0},{"t":"2014-06-08 18","p":2.2,"g":0.2,"c":0.8,"la":1.0,"n":12,"temp":0.0},{"t":"2014-06-08 17","p":72.6,"g":2.2,"c":1.6,"la":1.3,"n":12,"temp":0.0},{"t":"2014-06-08 16","p":167.0,"g":6.1,"c":8.8,"la":2.7,"n":12,"temp":0.0},{"t":"2014-06-08 15","p":265.2,"g":12.2,"c":25.4,"la":2.9,"n":12,"temp":0.0},{"t":"2014-06-08 14","p":387.1,"g":18.0,"c":28.0,"la":2.9,"n":12,"temp":0.0},{"t":"2014-06-08 13","p":498.0,"g":20.7,"c":39.1,"la":2.8,"n":12,"temp":0.0},{"t":"2014-06-08 12","p":436.0,"g":18.2,"c":35.4,"la":2.9,"n":12,"temp":0.0},{"t":"2014-06-08 11","p":471.3,"g":18.6,"c":38.0,"la":2.9,"n":12,"temp":0.0},{"t":"2014-06-08 10","p":782.7,"g":20.9,"c":36.5,"la":2.8,"n":12,"temp":0.0}]}

jQuery Example

If you are using jQuery it's really easy to use these APIs.
	      $.ajax( {   type: "GET",
	                  url: "http://flarmrange.onglide.com/api/1/stations",
	                  data: { station: "UKDUN", start: "2014-06-06" },
	                  timeout:20000,
		          cache: true,
		          error: function (xhr, ajaxOptions, thrownError) {
	                      alert( "oops!" );
		          },
                          success: function(json) {
	                      var result = "";
                              json.stations.forEach( function( station ) {
	                             result += station.s + " is at " + station.lt + "," + station.lg;
	                      });
	                      alert( result );
	                  }});
	

T&Cs

Change Log