The IrriMAX Live API (Application Programming Interface) provides a means to directly access the logger databases belonging to an IrriMAX Live user. It is intended for use by third-party services that need to import data from IrriMAX Live into their systems. It can also be used by IrriMAX Live users who wish to directly access their data in CSV format, or update a local copy of a database for use by the IrriMAX Windows software.
Authentication is by a pre-shared API key. Users can set, change or clear this automatically-generated key by visiting their Settings page. The creator of a User can also maintain this key by visiting the Users page and editing the user.
Use getloggers or getloggersinfo to retrieve a list of loggers/databases and their configurations. Use getreadings or getsdbcsv to download the unaltered readings for a particular logger/database. Use getgraphvalues to get processed values from a graph, getpng to retrieve a PNG image of a graph and getlast to retrieve the last value and budget line values from a graph.
https://www.irrimaxlive.com/api/?cmd=getloggers&key=APIKEY
Returns an XML document listing the details of all databases to which the user with the given API Key has access.
The root element is "User". Each logger (database/probe) has a "Logger" element with an attribute "name" to be used in getreadings command to identify that logger. Within the "Logger" element are nested "Site", "Probe" and "Sensor" elements, with information stored in attributes only.
https://www.irrimaxlive.com/api/?cmd=getloggersinfo&key=APIKEY
Returns a CSV file containing installation and zone information of all databases to which the user with the given API Key has access.
https://www.irrimaxlive.com/api/?cmd=getreadings&key=APIKEY&name=NAME&from=YYYYMMDDHHMMSS&to=YYYYMMDDHHMMSS
Returns a CSV file containing readings and one header row, where:
This command returns an IrriMAX-format CSV file, which can be downloaded by the IrriMAX Data Exchange CSV module to create or update an IrriMAX database (SDB file) on your local machine.
Usage is identical to the getreadings command above. To download only the new readings into your local database, use the $LASTYMDHMS macro supported by IrriMAX 9.1.2 and later versions. To do this, your download source should be a URL of the form:
https://www.irrimaxlive.com/api/?cmd=getsdbcsv&key=APIKEY&name=NAME&from=$LASTYMDHMS
(Data Exchange will replace $LASTYMDHMS with the timestamp of the last reading that you have in your local copy of the database.)
This command returns a CSV containing the values as shown in specified panes of the database's default graph or an arbitrary graph, after any post-processing such as calibration changes or bar-graph resampling. If Event Detection has been run on a pane, the CSV contains the detected events.
https://www.irrimaxlive.com/api/?cmd=getgraphvalues&key=APIKEY&name=NAME&pane=PANE&from=YYYYMMDDHHMMSS&to=YYYYMMDDHHMMSS
https://www.irrimaxlive.com/api/?cmd=getgraphvalues&key=APIKEY&path=PATH/TO/GRAPH.EXT&pane=PANE&from=YYYYMMDDHHMMSS&to=YYYYMMDDHHMMSS
Where:
This command returns a PNG file representing an IrriMAX Live graph. It has two variants. The first returns the default graph from the Loggers folder for the given IrriMAX database. The second returns an arbitrary graph:
https://www.irrimaxlive.com/api/?cmd=getpng&key=APIKEY&name=NAME&pane=PANENO&width=WIDTH&height=HEIGHT&days=DAYS&from=YYYYMMDDHHMMSS&to=YYYYMMDDHHMMSS
https://www.irrimaxlive.com/api/?cmd=getpng&key=APIKEY&path=PATH/TO/GRAPH.EXT&pane=PANENO&width=WIDTH&height=HEIGHT&days=DAYS&from=YYYYMMDDHHMMSS&to=YYYYMMDDHHMMSS
Where:
Please note: Due to the high overhead of this command it is not permitted to invoke it from an automated batch process. You may only use this command to present an image to a human on demand.
This command returns the last value, the full value, the refill value, the stress value, the unit of measure and the last date/time from either the default graph for a database, or an arbitrary graph. The values are comma-separated.
https://www.irrimaxlive.com/api/?cmd=getlast&key=APIKEY&name=NAME&pane=PANENO
https://www.irrimaxlive.com/api/?cmd=getlast&key=APIKEY&path=PATH/TO/GRAPH.EXT&pane=PANENO
Where:
This command returns a KML file containing the boundary for the zone and the location of any loggers within the zone:
https://www.irrimaxlive.com/api/?cmd=getzonekml&key=APIKEY&id=ZONEID
Where ZONEID is the unique identifier of the zone. If you first download the KML manually, the zone id is the number in the filename.
The commands might return the following HTTP response codes for error conditions: