PRTG Manual: Historic Data
You can download the historic monitoring data for one sensor in the Extensible Markup Language (XML) format or the comma-separated values (CSV) format using the following API calls. You can either request the results of each single monitoring request (called raw data) or you can let PRTG calculate averages of the data (for example, hourly or daily averages).
To avoid potential server overload, the number of requestable values per API call is limited by means of automatic averaging as follows:
Minimum Level of Detail (Average Interval) |
Maximum Timeframe per API Call |
---|---|
Raw data (all single monitoring requests) |
For up to 40 days per API request |
60 minutes/1 hour averages |
40 to 500 days per API request If you try to use a larger time span than 500 days, PRTG automatically reduces it to 365 days. |
API calls for historic data are limited to 5 requests per minute.
Authentication with API key or user name and passhash (or user name and password) must always be included in each PRTG API request. See section HTTP API for more information.
The API calls for historic data tables look like this:
Examples XML: /api/historicdata.xml?id=objectid&avg=0&sdate=2023-01-20-00-00-00&edate=2023-01-21-00-00-00 CSV: /api/historicdata.csv?id=objectid&avg=0&sdate=2023-01-20-00-00-00&edate=2023-01-21-00-00-00 JavaScript Object Notation (JSON): /api/historicdata.json?id=objectid&avg=0&sdate=2023-01-20-00-00-00&edate=2023-01-21-00-00-00&usecaption=1 |
You must supply the object ID of a sensor as well as a start date/time sdate and end date/time edate.
If you use the JSON call, additionally provide the parameter usecaption=1 to get more information than just the raw data table.
Historic graphs are also available (in the PNG format):
Example PNG: /chart.png?id=objectid&avg=15&sdate=2023-01-20-00-00-00&edate=2023-01-21-00-00-00&width=850&height=270&graphstyling=baseFontSize='12'%20showLegend='1'&graphid=-1 |
Common Parameters for Historic Data API Calls
You can use the following parameters for the graphs and the data tables:
Parameter |
Description |
Possible Values |
---|---|---|
id |
ID of the specific sensor |
integer |
sdate |
Start of the time span (date and time) |
yyyy-mm-dd-hh-mm-ss |
edate |
End of the time span (date and time) |
yyyy-mm-dd-hh-mm-ss |
avg |
Average interval in seconds; use 0 to download raw data (= results of all single monitoring requests) |
integer |
width/height |
Width and height of the graph in pixels |
integer |
graphstyling |
baseFontSize='x' sets the size of the font |
baseFontSize='x'%20showLegend='x' |
You can also use the historic data reports to manually generate and analyze historic sensor data via the PRTG web interface.
KNOWLEDGE BASE
How can I export historic data from the PRTG API?
How can I export raw sensor data automatically from PRTG?