Pagination
Collection endpoints paginate with Pagy and expose page metadata in response headers.
Request
Section titled “Request”Append ?page=N to the URL — N is 1-indexed:
curl -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://hypemarket.ai/organizations/3/collabs.json?page=2"Items per page is fixed at the Pagy default (20). The API does not currently accept a per_page parameter.
Response headers
Section titled “Response headers”| Header | Description |
|---|---|
Current-Page | Page number returned |
Page-Items | Items per page |
Total-Count | Total items across all pages |
Total-Pages | Total pages |
Iterating
Section titled “Iterating”A simple pattern for walking every page:
page=1while :; do resp=$(curl -sS -D /tmp/headers \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ "https://hypemarket.ai/organizations/3/collabs.json?page=$page") echo "$resp" total=$(grep -i '^total-pages:' /tmp/headers | awk '{print $2}' | tr -d '\r') [ "$page" -ge "$total" ] && break page=$((page + 1))doneIn Python:
import httpx
page, total = 1, 1with httpx.Client(headers={"Authorization": f"Bearer {token}", "Accept": "application/json"}) as c: while page <= total: r = c.get(f"https://hypemarket.ai/organizations/3/collabs.json", params={"page": page}) r.raise_for_status() yield from r.json() total = int(r.headers["Total-Pages"]) page += 1