Question on pagination with the RESTStream. If th...
# singer-tap-development
a
Question on pagination with the RESTStream. If the response from the API returns a
count
of the records returned, and the request parameters include the
limit
of records to return and the number of records to
skip
, does that offer enough information to use the pagination functionality in RESTStream?
e
Yup, and I think you can even do without getting
limit
from the url params. In a bit of pseudocode
Copy code
skip = 0

loop
    response = make_request(skip)
    process(response)
    if response.count > 0
        skip += count
    else
        break
end
Basically, while the API returns at least one record, you continue paginating. So you could even do without the
count
in the response and simply count (
len(...)
) the number of records in the response
a
Thanks @edgar_ramirez_mondragon - Do you know what that might look like using
RESTStream
?
a
Thank you!