Loop over Google Places NextPageToken and save all results

Describe the problem/error/question

So, I’m trying to fetch data using Google Places API. But I need to repeat the HTTP request as long as the NextPageToken exists. I know that Google Places API only allows 3 pages to be fetched so I could do this sequential but I really want to do it in a loop. I.e if nextPageToken exists, fetch the next page and append the new results to the existing list of results.

Is this doable? I can’t seem to find a way of doing this as I can’t hold the results in an variable from the first request to the next?

You could just loop while there is a next page token present

After adding a reset to the loop over item node with

{{ $node["Loop Over Items"].context["done"] }}

And adding the aggregate node to prevent 20x the next loop it seems to be working!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.