API Records Data and API Graph Data: Difference between pages

From Cumulus Wiki
(Difference between pages)
Jump to navigationJump to search
(Created page with "''Back to Cumulus MX Local API'' == All Time Records == The all time records data response is designed for displaying on a web page, the text is formatted with HTML codes...")
 
mNo edit summary
 
Line 1: Line 1:
''Back to [[Cumulus MX Local API]]''
''Back to [[Cumulus MX Local API]]''


== All Time Records ==
The all time records data response is designed for displaying on a web page, the text is formatted with HTML codes.


The general format of the records data API request is as follows...
The general format of the graph data API request is as follows...
<pre>http://localhost:8998:/api/records/alltime/xxxxx</pre>
<pre>http://localhost:8998/api/graphdata/xxxxx[?start=yyyy-MM-dd]</pre>
Where xxxx is the specific request as below possibly followed by a startdate. If startdate is omitted you get the all data as present in [https://www.cumuluswiki.org/a/Cumulusmx.db#The_Recent_History_Data_Table|The Recent History Data Table]. If startdate is present you get the subset of data present in the daily database starting on that date until the end.
Where xxxx is the specific request as below:


=== temperature.json ===
=== tempdata.json ===
Returns inside temp, dew point, apparent temp, feels like, wind chill, heat index, outdoor temp as a JSON object, each value is an array of timestamp (JavaScript number) and value pairs...
Returns all time temperature records. An example response is given below...
{
{
"intemp": [[timestamp1,value1],[timestamp2,value2]...],
"data": [
"dew": [[timestamp1,value1],[timestamp2,value2]...],
["High temperature", "34.6 &deg;C", "25 July 2019 15:39"],
"apptemp": [[timestamp1,value1],[timestamp2,value2]...],
["Low temperature", "-12.5 &deg;C", "20 December 2010 07:17"],
"feelslike": [[timestamp1,value1],[timestamp2,value2]...],
["High dew point", "23.7 &deg;C", "25 July 2019 16:35"],
"wchill": [[timestamp1,value1],[timestamp2,value2]...],
["Low dew point", "-13.5 &deg;C", "20 December 2010 07:20"],
"heatindex": [[timestamp1,value1],[timestamp2,value2]...],
["High apparent temp", "38.7 &deg;C", "25 July 2019 16:35"],
"temp": [[timestamp1,value1],[timestamp2,value2]...]
["Low apparent temp", "-15.8 &deg;C", "20 December 2010 07:17"],
["High feels like", "37.6 &deg;C", "25 July 2019 16:40"],
["Low feels like", "-12.5 &deg;C", "20 December 2010 07:20"],
["High Humidex", "42.0 &nbsp;", "12 August 2020 14:12"],
["Low wind chill", "-12.5 &deg;C", "20 December 2010 07:17"],
["High heat index", "40.2 &deg;C", "25 July 2019 16:35"],
["Highest minimum temp", "18.8 &deg;C", "06 September 2016 04:07"],
["Lowest maximum temp", "-4.4 &deg;C", "20 December 2010 00:00"],
["High daily temp range", "21.3 &deg;C", "26 March 3912"],
["Low daily temp range", "0.9 &deg;C", "19 January 2017"]
]
}
}
=== winddata.json ===

Same as temp data...
=== humidity.json ===
Returns all time humidity records. An example response is given below...
{
{
"data": [
"wgust": [[,],[,]...],
"wspeed": [[,],[,]...]
["High humidity", "100 %", "23 January 2010 01:10"],
["Low humidity", "17 %", "25 March 2017 14:19"]
]
}
}
=== raindata.json ===

Same as temp...
=== pressure.json ===
{
{
"data": [
"rfall": [[,],[,]...],
"rrate": [[,],[,]...]
["High pressure", "1048.5 hPa", "20 January 2020 00:09"],
["Low pressure", "962.9 hPa", "15 February 2014 00:13"]
]
}
}
=== pressdata.json ===

Same as temp...
=== wind.json ===
{
{
"data": [
"press": [[,],[,]...]
["High gust", "53.0 mph", "12 February 2014 17:32"],
["High wind speed", "25.0 mph", "12 February 2014 17:35"],
["High daily windrun", "352.9 miles", "31 March 2015"]
]
}
}
=== wdirdata.json ===

Same as temp...
=== rain.json ===
{
{
"data": [
"bearing": [[,],[,]...],
"avgbearing": [[,],[,]...]
["High rain rate", "230.4 mm/hr", "29 April 2016 01:52"],
["High hourly rain", "29.0 mm", "16 June 2016 16:09"],
["High daily rain", "44.6 mm", "16 June 2016"],
["Highest monthly rainfall", "170.6 mm", "October 2013"],
["Longest dry period", "26 days", "12 July 2018"],
["Longest wet period", "33 days", "19 January 2014"]
]
}
}
=== humdata.json ===
Same as temp...
{
"hum": [[,],[,]...],
"inhum": [[,],[,]...]
}
=== solardata.json ===
Same as temp...
{
"UV": [[,],[,]...],
"SolarRad": [[,],[,]...],
"CurrentSolarMax": [[,],[,]...]
}
=== sunhours.json ===
Same as temp...
{
"sunshours": [[,],[,]...]
}
=== dailyrain.json ===
Same as temp...
{
"dailyrain": [[,],[,]...]
}
=== dailytemp.json ===
{
"mintemp": [[,],[,]...],
"maxtemp": [[,],[,]...],
"avgtemp": [[,],[,]...]
}
=== units.json or graphconfig.json ===
Returns the units of measurement used for the graph values above.
{
"temp": {"units": "C|F", "decimals": 0|1|2},
"wind": {"units": "windunit", "decimals": N},
"rain": {"units": "rainunit", "decimals": N},
"press": {"units": "pressunit", "decimals": N},
"hum": {decimals": N},
"UV": {decimals": N}
}

== Example response ==
A truncated response for humdata.json...
{"hum":[[1602861480000,75],[1602861540000,75],[1602861600000,75],[1602861660000,74],....]}

Latest revision as of 14:07, 23 September 2025

Back to Cumulus MX Local API


The general format of the graph data API request is as follows...

http://localhost:8998/api/graphdata/xxxxx[?start=yyyy-MM-dd]

Where xxxx is the specific request as below possibly followed by a startdate. If startdate is omitted you get the all data as present in Recent History Data Table. If startdate is present you get the subset of data present in the daily database starting on that date until the end.

tempdata.json

Returns inside temp, dew point, apparent temp, feels like, wind chill, heat index, outdoor temp as a JSON object, each value is an array of timestamp (JavaScript number) and value pairs...

{
   "intemp": [[timestamp1,value1],[timestamp2,value2]...],
   "dew": [[timestamp1,value1],[timestamp2,value2]...],
   "apptemp": [[timestamp1,value1],[timestamp2,value2]...],
   "feelslike": [[timestamp1,value1],[timestamp2,value2]...],
   "wchill": [[timestamp1,value1],[timestamp2,value2]...],
   "heatindex": [[timestamp1,value1],[timestamp2,value2]...],
   "temp": [[timestamp1,value1],[timestamp2,value2]...]
}

winddata.json

Same as temp data...

{
   "wgust": [[,],[,]...],
   "wspeed": [[,],[,]...]
}

raindata.json

Same as temp...

{
   "rfall": [[,],[,]...],
   "rrate": [[,],[,]...]
}

pressdata.json

Same as temp...

{
   "press": [[,],[,]...]
}

wdirdata.json

Same as temp...

{
   "bearing": [[,],[,]...],
   "avgbearing": [[,],[,]...]
}

humdata.json

Same as temp...

{
   "hum": [[,],[,]...],
   "inhum": [[,],[,]...]
}

solardata.json

Same as temp...

{
   "UV": [[,],[,]...],
   "SolarRad": [[,],[,]...],
   "CurrentSolarMax": [[,],[,]...]
}

sunhours.json

Same as temp...

{
   "sunshours": [[,],[,]...]
}

dailyrain.json

Same as temp...

{
   "dailyrain": [[,],[,]...]
}

dailytemp.json

{
   "mintemp": [[,],[,]...],
   "maxtemp": [[,],[,]...],
   "avgtemp": [[,],[,]...]
}

units.json or graphconfig.json

Returns the units of measurement used for the graph values above.

{
   "temp": {"units": "C|F", "decimals": 0|1|2},
   "wind": {"units": "windunit", "decimals": N},
   "rain": {"units": "rainunit", "decimals": N},
   "press": {"units": "pressunit", "decimals": N},
   "hum": {decimals": N},
   "UV": {decimals": N}
}

Example response

A truncated response for humdata.json...

{"hum":[[1602861480000,75],[1602861540000,75],[1602861600000,75],[1602861660000,74],....]}