Skip to main content

Pagination

List endpoints use keyset (cursor) pagination. There is no offset/page parameter — cursor seeks stay fast at any depth.

Request parameters

ParamTypeDefaultNotes
page_sizeinteger50Results per page, 1100.
cursorstringOpaque cursor from the previous response's next_cursor. Omit for the first page.

Response envelope

Every list response wraps results in data and includes a pagination block:

{
"data": [ /* … */ ],
"pagination": {
"next_cursor": "eyJpZCI6MTAwNDF9",
"page_size": 50
}
}
  • next_cursor is an opaque token encoding the last row's sort position. Pass it back as ?cursor=… to fetch the next page.
  • When next_cursor is null, you've reached the last page.
note

Cursors are tied to the sort you requested. If you change sort or filters mid-pagination, start over without a cursor. A malformed cursor returns 400 invalid_cursor.

Looping through all pages

import requests

url = "https://api.pikaqian.com/v1/cards"
headers = {"X-API-Key": "pk_live_your_key_here"}
params = {"set_id": "csv6c", "page_size": 100}

while True:
body = requests.get(url, headers=headers, params=params).json()
for card in body["data"]:
print(card["name"])
cursor = body["pagination"]["next_cursor"]
if not cursor:
break
params["cursor"] = cursor

The /cards/{id}/variants endpoint honours the same page_size/cursor contract, but a card's variant group is small (usually one or two prints), so in practice it fits in one page and next_cursor is null.