I am currently working with JSON data that contains multiple pages. For each iteration, I need to provide a new base URL, calculated as follows: (startat + MaxResult + 1 = 51, 101, 151, 201) until the value is equal to “Total.”
I am seeking assistance with the logic for this task and would like to know which loop would be best suited for this exercise.
Please refer to the attached image for better clarity:
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.