Pagination
Every list endpoint in the Conviction API uses offset-based pagination. It's not a cursor or page-number model.
#Query parameters
| Name | Type | Description | Default |
|---|---|---|---|
| limit | number | Number of items to fetch at once. | 20 (or varies by endpoint) |
| offset | number | Number of items to skip. | 0 |
limit is generally capped between 1 and 100 (the upper bound varies by endpoint).
#Response envelope
{
"markets": [ /* ... */ ],
"total": 347,
"limit": 20,
"offset": 0
}| Field | Description |
|---|---|
markets (or orders, deposits...) | The actual data array. The key name varies by endpoint. |
total | Total number of items after filters are applied |
limit | The value received in the request (or the applied default) |
offset | The value received in the request (or 0) |
#Next page
There's no separate next URL. The client computes it itself.
const nextOffset = currentOffset + limit;
if (nextOffset >= total) {
// done
}#Infinite-scroll pattern
function buildUrl(offset: number, limit: number) {
const url = new URL('https://api.conviction.bet/v1/markets');
url.searchParams.set('status', 'ACTIVE');
url.searchParams.set('limit', limit.toString());
url.searchParams.set('offset', offset.toString());
return url.toString();
}
let offset = 0;
const limit = 20;
const all = [];
while (true) {
const res = await fetch(buildUrl(offset, limit)).then((r) => r.json());
all.push(...res.markets);
if (offset + limit >= res.total) break;
offset += limit;
}#Sorting
List endpoints usually accept sortBy and sortOrder together. For the available values, consult each endpoint's spec.
#Next
- REST → Markets — the most-used list endpoint
Was this page helpful?