Pagination
List endpoints return one page at a time:
{"data": [ ... ], "next_cursor": "eyJvIjo1MCwicyI6Im5ld2VzdCJ9", "has_more": true, "total": 312}
Ask for the next page with ?cursor=<next_cursor> (keep the same filters). has_more is false and next_cursor is null on the last page. limit sets the page size (1-200, default 50). total (where given) is the number of matching items.
url, params, sites = "https://app.pbn.ltd/api/v1/sites", {"limit": 200}, []
while True:
page = requests.get(url, headers=headers, params=params).json()
sites += page["data"]
if not page["has_more"]:
break
params["cursor"] = page["next_cursor"]