Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max results per page |
cursor | string | Cursor from previous response |
Response Format
{
"pagination": {
"total": 1250,
"limit": 20,
"has_more": true,
"next_cursor": "eyJpZCI6MTIzfQ=="
}
}
Example
cursor = None
while True:
params = {"provider": "polymarket", "limit": "50"}
if cursor:
params["cursor"] = cursor
data = requests.get(url, params=params, headers=headers).json()
all_markets.extend(data["markets"])
if not data["pagination"]["has_more"]:
break
cursor = data["pagination"]["next_cursor"]