The v2 API uses two pagination styles, each fitting the underlying data model. Knowing which style applies to which endpoint lets you build a uniform client that handles both.
Pattern
Query params
Used by
Offset
take, skip
Most list endpoints (audit logs, reporting, creatives, test cohorts, …)
async function* listAllAuditLogs() { const take = 100; let skip = 0; while (true) { const res = await fetch( `https://api.apostra.com/api/v2/buyer/audit-logs?take=${take}&skip=${skip}`, { headers: { Authorization: `Bearer ${process.env.SCOPE3_API_KEY}` } }, ); const { data, meta } = await res.json(); yield* data.logs; if (!meta.pagination.hasMore) return; skip += take; }}
def list_all_audit_logs(): take, skip = 100, 0 while True: res = requests.get( "https://api.apostra.com/api/v2/buyer/audit-logs", params={"take": take, "skip": skip}, headers={"Authorization": f"Bearer {SCOPE3_API_KEY}"}, ) body = res.json() for log in body["data"]["logs"]: yield log if not body["meta"]["pagination"]["hasMore"]: return skip += take
Custom offset (discovery)
Discovery returns nested results — product groups, each containing several products — so it exposes two independent offsets. This lets you page through groups without re-fetching products you’ve already seen, and vice versa.
hasMoreGroups tells you whether to advance groupOffset for another page of groups. summary.totalProducts is the full denormalized total across all groups.
When in doubt, inspect the response. Offset endpoints expose
meta.pagination.hasMore; discovery exposes hasMoreGroups directly on
data.
Don’t assume total is cheap to compute. For high-cardinality endpoints
(audit logs, reporting metrics) prefer to consume pages with hasMore rather
than computing Math.ceil(total / take) and looping — the count may be an
estimate.