<%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

icon-i-roundIf you try to use a larger time span than 500 days, PRTG automatically reduces it to 365 days.

icon-i-round-redAPI calls for historic data are limited to 5 requests per minute.

API Calls for Historic Data

icon-i-round-redAuthentication with username and passhash (or username and password) must always be included in each PRTG API request. See section Authentication for more information.

The API calls for historic data tables look like this:

icon-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

icon-i-round-redYou must supply the object ID of a sensor as well as a start date/time sdate and end date/time edate.

icon-i-roundIf 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):

icon-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

The following parameters can be used 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 function to manually generate and analyze historic sensor data via the PRTG web interface.

More

Knowledge Base: How can I export historic data from the PRTG API?

Knowledge Base: How can I export raw sensor data automatically from PRTG?

Application Programming Interface (API) Definition—Topics

Keywords: