Skip to main content

Pagination

List endpoints return results one page at a time using cursor-based pagination. Results are ordered by document id, which is stable as the underlying data changes.

Request parameters

ParameterDescription
limitMaximum items per page. Default 50, maximum 200.
cursorOpaque token from a previous response's next_cursor. Omit it for the first page.

Response shape

Every list response wraps its results in the same envelope:

{
"items": [
{ "id": "7Hb2Kp9QvL3mNx0R8tZ4", "name": "Acme Podcast Network" }
],
"next_cursor": "eyJpZCI6IjdIYjJLcDlRdkwzbU54MFI4dFo0In0"
}
  • items — the page of results.
  • next_cursor — pass this back as ?cursor= to fetch the next page. When it is null, you have reached the last page.
Treat the cursor as opaque

Do not parse, construct, or modify the cursor. Pass back exactly what you received. Its format may change without notice.

Iterating all pages

Follow next_cursor until it comes back null:

cursor=""
while : ; do
resp=$(curl -s -G "https://api.adbridge.ai/v1/networks" \
--data-urlencode "limit=100" \
--data-urlencode "cursor=$cursor" \
-H "Authorization: Bearer $ADBRIDGE_API_KEY")
echo "$resp" | jq -c '.items[]'
cursor=$(echo "$resp" | jq -r '.next_cursor // empty')
[ -z "$cursor" ] && break
done

An invalid or malformed cursor returns 400 Bad Request with the standard error envelope.