<%NUMBERING1%>.<%NUMBERING2%>.<%NUMBERING3%> 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

i_round_blueIf you try to use a larger time span than 500 days, PRTG automatically reduces it to 365 days.

i_round_redAPI calls for historic data are limited to 5 requests per minute.

API Calls for Historic Data

i_round_redAuthentication with 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:

i_speechExamples

XML:

/api/historicdata.xml?id=objectid&avg=0&sdate=2018-01-20-00-00-00&edate=2018-01-21-00-00-00

CSV:

/api/historicdata.csv?id=objectid&avg=0&sdate=2018-01-20-00-00-00&edate=2018-01-21-00-00-00

JavaScript Object Notation (JSON):

/api/historicdata.json?id=objectid&avg=0&sdate=2018-01-20-00-00-00&edate=2018-01-21-00-00-00&usecaption=1

i_round_redYou must supply the object ID of a sensor as well as a start date/time sdate and end date/time edate.

i_round_blueIf you use the JSON call, additionally provide the parameter usecaption=1 to get more information than just the raw data table.

API Call for Historic Graphs

Historic graphs are also available (in the PNG format):

i_speechExample

PNG:

/chart.png?id=objectid&avg=15&sdate=2018-01-20-00-00-00&edate=2018-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 value

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 value

width/height

Width and height of the graph in pixels

integer value

graphstyling

baseFontSize='x' sets the size of the font
showLegend='x' enables (1) or disables (0) the graph legend

baseFontSize='x'%20showLegend='x'

Historic Data Query Builder

You can also use the historic data reports to manually generate and analyze historic sensor data via the PRTG web interface.

More

i_square_blueKnowledge Base

How can I export historic data from the PRTG API?

How can I export raw sensor data automatically from PRTG?

Application Programming Interface (API) Definition