As previously indicated in a similar question you asked, the recursive loop is the way to go here
One of the keypoints here would be to extract the startAt per iteration and determine if the exit condition of the recursive loop should be triggered based on startAt + maxResults > total.
Is the API public/easily accessible? It would make it a lot easier to help you if the syntax of the URL and the actual response is known.