I have fixed the scenario however I want to only loop a custom API from page 1 to page 5 (There are some 3 thousand pages in the api) and save the data to a spreadsheet.
However, after this is acomplished, my HTTP Request node starts again to loop through the pages non stop. What am i doing wrong, now?
As @marcus mentioned. The API I shared with you only has two pages to simulate pagination. Since you change the condition in the IF, which checks if there is more data, you get an infinity loop. You should be able to do it with the API you want to work with instead of the demo API.
The pagination in the actual custom API has over 1,000 pages. I fixed the infinite loop by editing the values in the IF node to stop when the value in “next” is equal to 5. ( I only wanted to loop though 5 pages) and in the node options I enabled “Execute once”