Zoho API getRecords

Zoho API getRecords

I'm calling the getRecords from the API but upon inspecting the documentation, I noticed that the fromIndex and toIndex are supposed to be supplied or else you will only get 20 results.

I am trying to retrieve 980+ records looking at the documentation there is no way for me to fetch all of these records in one call. It seems like I have to loop and continuously call the API supplying a different fromIndex and toIndex (by increments of 20) until I encounter an error code.

Is there a way for me to do this more efficiently?