Having issues with API Request and pagination

I need to extract data from an API that allows a maximum of 200 items per page and up to 800 items (4 pages) per request. There’s also a required delay of 5 seconds between each API request.

I’m trying to create an automation process that will:

  1. Fetch all the bundles by iterating through the pages until the total number of pages is reached.
  2. Ensure compliance with the 5-second delay between requests.
  3. Store all the extracted information into a Google Sheet.

Additionally, I want the process to avoid duplicating entries by checking if the data already exists (e.g., using a data store or unique identifiers).

Could you guide me on how to set up such an automation?