Public API
Pagination
Cursor-based pagination for Public API list endpoints
List endpoints use cursor pagination. Pass the previous page’s nextCursor until it is null.
Query parameters
| Parameter | Default | Limits | Description |
|---|---|---|---|
limit | 25 | 1–100 | Page size |
cursor | — | opaque id | Continue after this item id |
Response shape
{
"data": [{ "id": "…" }],
"nextCursor": "clx…"
}When there is no further page, nextCursor is null.
Example
# First page
curl "https://api.cowtic.com/api/v1/orders?limit=50" \
-H "X-Api-Key: YOUR_API_KEY"
# Next page
curl "https://api.cowtic.com/api/v1/orders?limit=50&cursor=ORDER_ID" \
-H "X-Api-Key: YOUR_API_KEY"async function listAllOrders(apiKey: string) {
const items = [];
let cursor: string | null = null;
do {
const url = new URL("https://api.cowtic.com/api/v1/orders");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { "X-Api-Key": apiKey },
});
const page = (await res.json()) as {
data: Array<{ id: string }>;
nextCursor: string | null;
};
items.push(...page.data);
cursor = page.nextCursor;
} while (cursor);
return items;
}Do not invent cursors. Always reuse the exact nextCursor value from the previous response.