Simulate a paginated API. Standard input: the allowed requests per minute, then one JSON page per line (in any order) like {"page": 1, "next": 2, "results": [{"id": 1, "pm25": 42}, …]}; the last page has "next": null.
Starting at page 1, follow next links:
- if a page was already visited, print
loop detected at page N, stopping; if it does not exist, printpage N missing (HTTP 404), stopping; - collect records, deduplicating by
id(keep first-seen order).
Then print requests: 3, records received: 6, unique records: 5, ids: 1, 2, 3, 4, 5 and polite schedule: one request every 2 s -> at least 4 s in total (60/rate seconds between requests, (requests − 1) gaps; numbers in :g format).