Usage API suddenly not working anymore with page parameter

I’ve had this problem too.

It seems that when the length of the requested period matches exactly the end, it now gives this error. (used to be fine in the past)

The solution for me was to set an increased window length in the limit parameter.

For example, when requesting for 2 days of log:

import time
days = 2
start_time = int(time.time()) - (days * 86400) #x days ago

params = {
    "start_time": start_time,
    "bucket_width": "1d",
    "group_by":["model"],
    "limit": days+1 # increased the length of results
}

Since I changed this, I’ve had no further issues and the rest of the code remains the same.

1 Like