What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

Historic data or graph API



This are the URLs given in the doc



Is there not a way, also, to use any time range like the one which are provided in the web pages, like 1 day, 7 days, today, yesterday, last week, last month, instead of having to calculate a start date from today's date before to configure the URL.

This could be very helpful for some cases. For example to configure a button with personnal html on a map just to have a look with 1 click on the graph of known periods or known cases without to go back to the PRTG session to do again all the choises.

If there are not such hidden functions, I think all the html and js file are already existing in PRTG to provide such a solution to non programmer customers.

This would lead to very simple API URLs:




api daterange historicdata

Created on Dec 5, 2014 11:06:35 AM

4 Replies



How about this as personal html, it dynamically produces the chart of sensor 2064 for the last three months


<script language="JavaScript">
function prtgdate(date)
  //format date to yyyy-mm-dd-00-00-00
  var twoDigitMonth = date.getMonth()+1+"";
  if(twoDigitMonth.length==1) twoDigitMonth = "0" + twoDigitMonth;
  var twoDigitDay = date.getDate()+"";
  if(twoDigitDay.length==1) twoDigitDay = "0" + twoDigitDay;
  return date.getFullYear() + "-" + twoDigitMonth + "-"+ twoDigitDay + "-00-00-00"


<script language="JavaScript">
var start = new Date();
// set startdate three months back
start.setMonth(start.getMonth() -3);
start = prtgdate(start);
// set enddate to today
end = prtgdate(new Date());
// request chart


Created on Dec 5, 2014 1:57:04 PM

Last change on Aug 10, 2018 9:03:20 AM by  Brandy Greger [Paessler Support]



One note to the solution above, please consider using an average of at least 300 seconds (better 1 hour) as avg parameter in the call. A minute average in 3 months graph results on 129K values (meaning with 1 pixel per value the graph needs to be over 120000 pixel wide).

Created on Dec 5, 2014 2:07:47 PM by  Torsten Lindner [Paessler Support]



any answer for this?

Created on Mar 24, 2021 5:16:07 AM



any upadate on this issue?

Created on Mar 24, 2021 2:49:27 PM

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.