Categories
Announcements

“Response Time Data” Is Now Available With The API

With the new version of Uptime Robot’s front-end, response time data was also added as a new feature.

However, it was not available in the API until today as we were experimenting ways to keep this huge data. Things look pretty stable now and response times can now be reached via API.

As expected, the feature is a parameter for the getMonitors method. There are actually 2 parameters:

  • responseTimes: if set to 1 (responseTimes=1), the response time for all the checks in the last 24 hours is returned
  • responseTimesAverage (optional): the API can also return the values as averages for given minutes (for ex: the dashboard averages the values as 30 minutes). This parameter will be very handy once the data for longer periods will be available and we’ll be able to get averages for hours/days/weeks, etc.

Hope that this new addition will enable you to provide more useful data in your site and/or apps.

12 replies on ““Response Time Data” Is Now Available With The API”

Hi there.
First of all thank you for the good work you are doing with uptimeRobot.
There seems to be a bug in the code that produces the responseTimes json data:

For a query like:

getMonitors?apiKey=&format=json&noJsonCallback=1&responseTimes=1

it returns valid responsetime elements for the first few monitors, but then at one stage it the raw data returned is:

“responsetime”:[{“datetime”:”02/21/2014 16:11:51″,”value”:”1342″}{“datetime”:”02/21/2014 16:01:51″,”value”:”1293″}]

The missing comma between the two elements means this is not recognized as valid json.

Can you please fix this?

Cheers
Michael Keller

Hi admin.

Thanks for this, I can confirm that it works now.

Unfortunately I have another bug that I’d like to report. It is not related to response times, but I could not find a better place to put it. (Hint: Maybe put a bug reporting page onto the todo list. ;-))

For one of my monitors, when I look at the log in the web interface, I get:

Event Date-Time Reason Duration
Up 13-03-2014 08:52:34 OK 16 hrs, 59 mins
Down 13-03-2014 08:49:02 — 0 hrs, 3 mins
Up 03-03-2014 03:53:35 OK 244 hrs, 55 mins

When I look at the api data that is returned for the same monitor I get:

“log”:[
{“type”:”2″,”datetime”:”03/13/2014 08:52:34″},
{“type”:”1″,”datetime”:”03/13/2014 08:49:02″},
{“type”:”2″,”datetime”:”03/03/2014 03:53:35″}]

For what I can tell, the dates that are returned by the web page are correct, and the api log dates are wrong.

Cheers
Michael Keller

It would be really cool, if you could allow to limit the responseTimes returned. I really only need to see the last responseTime captured. If I use getMonitors with responseTime:1 the feed is to large to be handled on the client side only, and I’ll have to create some server side to handle the large feed.

Leave a Reply

Your email address will not be published. Required fields are marked *