andrew_stewart
01/28/2022, 12:42 AMcount
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?edgar_ramirez_mondragon
01/28/2022, 1:46 AMlimit
from the url params. In a bit of pseudocode
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 responseandrew_stewart
01/28/2022, 2:55 AMRESTStream
?edgar_ramirez_mondragon
01/28/2022, 3:18 AMandrew_stewart
01/28/2022, 4:54 AM