Most list endpoints in the Zeeg API return paginated results. Instead of returning every record at once, responses are split into pages that you can iterate through.
Parameters
Every paginated endpoint accepts the following query parameters:
| Parameter | Type | Default | Description |
|---|
count | integer | 20 | Number of items per page. Min 1, max 100. |
page | integer | 1 | The page number to retrieve (1-indexed). |
The /organizations/users endpoint uses per_page instead of count. All other paginated endpoints use count.
Response structure
Paginated responses include a collection array with the requested items and a pagination object with metadata for navigating between pages.
{
"collection": [
{ "...": "..." }
],
"pagination": {
"total": 42,
"count": 20,
"totalPages": 3,
"previousPage": "/v2/scheduled-events?page=1",
"currentPage": 2,
"nextPage": "/v2/scheduled-events?page=3"
}
}
The total number of items across all pages.
The number of items returned in the current page.
The total number of pages available.
The path to the previous page of results. null when you are on the first page.
The path to the next page of results. null when you are on the last page.
Iterating through pages
Use nextPage to walk through all pages until it returns null.
# Fetch page 1
curl "https://api.zeeg.me/v2/scheduled-events?count=20&page=1" \
-H "Authorization: Bearer YOUR_TOKEN"
# Fetch the next page
curl "https://api.zeeg.me/v2/scheduled-events?count=20&page=2" \
-H "Authorization: Bearer YOUR_TOKEN"
import requests
BASE_URL = "https://api.zeeg.me/v2"
headers = {"Authorization": "Bearer YOUR_TOKEN"}
page = 1
all_events = []
while True:
response = requests.get(
f"{BASE_URL}/scheduled-events",
headers=headers,
params={"count": 20, "page": page},
)
data = response.json()
all_events.extend(data["collection"])
if data["pagination"]["nextPage"] is None:
break
page += 1
print(f"Fetched {len(all_events)} events in total.")
const BASE_URL = "https://api.zeeg.me/v2";
const headers = { Authorization: "Bearer YOUR_TOKEN" };
async function fetchAllEvents() {
let page = 1;
const allEvents = [];
while (true) {
const res = await fetch(
`${BASE_URL}/scheduled-events?count=20&page=${page}`,
{ headers }
);
const data = await res.json();
allEvents.push(...data.collection);
if (data.pagination.nextPage === null) break;
page++;
}
return allEvents;
}
Use a smaller count (e.g. 10) if you need faster individual responses, or a larger count (up to 100) to reduce the total number of requests.