Handle API Pagination in Google Apps Script
Channel: Brian Bennett
Date: 2021-03-18

If you're using Google Apps Script to get data from an API, you might have to handle paginated responses. In this video, I show you how to do that using a functional approach, building a recursive request pattern that handles paginated endpoints easily.

This is meant to be used as a library or utility, so grab a copy from the link👇 and stick it in a script file you can grab quickly.

https://gist.github.com/bennettscience/2484d00b8d3f918c75b82bdef99e0bef

If you look closely in the video, there's actually a bug in how query parameters are handled. The bug has been fixed in the script linked.