Pagination
How pagination works
List endpoints use offset-based pagination.
Parameters
limit: number of items to return (default: 100, max: 1000)
offset: number of items to skip (default: 0)
Response fields
total: total items available after filters
limit: the limit you requested/applied
offset: the offset you requested/applied
items: the current page of results
Paging logic
Next page offset =
offset + limitYou’ve reached the end when
offset + items.length >= totalGET /data/bookingsis ordered byreservation_start(asc), thenbooking_date(asc)
Example request
// Server-side (Node 18+). Don’t expose API keys in the browser.
(async () => {
const BASE_URL = 'https://api.okup.ai';
const API_KEY = process.env.OKUPAI_API_KEY;
const res = await fetch(`${BASE_URL}/data/bookings?from=2025-01-01&to=2025-01-31&limit=200&offset=0`, {
headers: { 'X-API-Key': API_KEY },
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const data = await res.json();
console.log(data);
})();import os, requests
BASE_URL = "https://api.okup.ai"
API_KEY = os.environ["OKUPAI_API_KEY"]
r = requests.get(
f"{BASE_URL}/data/bookings",
headers={"X-API-Key": API_KEY},
params={"from": "2025-01-01", "to": "2025-01-31", "limit": 200, "offset": 0},
timeout=30,
)
r.raise_for_status()
print(r.json())Iterate pages
Last updated