Hi there,
I am a Google script developer and will be happy to help you fixing this script, such that it retrieve the offset in each call and use it in the next successive call until all data is read. I have worked with numerous APIs following the same procedure.
Sincerely,
Mohamed