I used Clockify to track roughly every minute of my day for the last 3 months as an experiment. I'm in the process of pulling all of my time entry data from the API so that I can analyze it and make visualizations.
I'd like to avoid getting all of the time entries at once, so I'm writing my code so it respects the default number of entries, then trying to paginate through it. I calculate the total number of pages by taking the entry count I see in the Clockify UI and dividing that by the default number of entries per page.
The Python code for this part looks like this:
num_pages = HARDCODED_VALUE
for pagenum in range(1, num_pages + 1):
newurl = url + '?page={}'.format(pagenum)
r = requests.get(newurl, headers=x_api_header)
// do stuff (save to file, r.json(), etc.)
Though my use case is very specific, and an individual doing this would seemingly follow a similar procedure, I wanted to know if there is a more programmatic way of counting the total number of entries for a given user in a specific workspace? I couldn't find a feature like this, or something akin to pagination indicators, in the response from the Clockify API.