Finding how many times to paginate task search results

I am using the workspaces/{workspace_gid}/tasks/search method to pull and organize tasks from a certain project. I am able to get results from this call, but I realized I would need to paginate in order to get all the search results. I was able to figure out how to do this, but I was wondering if there was a way to know how many times I would need to paginate the results before actually paginating them? For example, if a search provides 250 results, that means I would need to paginate twice to get all the search results. Is there a way to know this beforehand? Thanks.

There’s no way to know the exact count of results before fetching them.

The only count available, is the number of tasks (active, inactive, total) by project.

So, if you look for all tasks of 1 project, and you need a progressbar or something like that, you can estimate the number of total tasks on that project, as described here.

New endpoint: project task counts - Developers & API / Platform News - Asana Community Forum

But, if you search, for example, for tasks assigned to 1 specific user in that project, you have no idea how many results you will get, using any endpoint.

1 Like

Okay thank you for the response.