Pagination
Long lists come back a page at a time, and each page hands you the link to the next one.
How It Works
- Ask for the list. You get the first page.
- Look at
nextat the bottom of the response. It is a complete web address — paste it straight into your browser, your script or your spreadsheet tool. - Fetch that address to get the following page, and keep going until
nextcomes back asnull. That means you have reached the end.
You never have to build the link yourself. It already carries your filters, your page size and the marker for where the next page starts.
Response Format
json
{
"data": [ ... ],
"next": "https://milarki.com/api/v1/tournaments?cursor=eyJpZCI6Im5leHRfZG9jX2lkIn0&limit=10"
}On the last page — and on any list that fits in one page — next is null:
json
{
"data": [ ... ],
"next": null
}Endpoints that return a single thing rather than a list have no next at all — just data.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | How many results you want per page. Default: 20, max: 100. |
cursor | string | Optional | Marks where the next page starts. It is already inside the "next" link, so you should never need to set it by hand. |
Example Request
First page:
bash
curl -H "Authorization: Bearer mlk_v1_your_api_key" \
"https://milarki.com/api/v1/tournaments?limit=10"Next page — the address is the one the first response gave you:
bash
curl -H "Authorization: Bearer mlk_v1_your_api_key" \
"https://milarki.com/api/v1/tournaments?cursor=eyJpZCI6ImFiYzEyMyJ9&limit=10"Validation Errors
limit must be a positive integer— Invalid limit valuelimit must not exceed 100— Limit too largeInvalid cursor— Malformed or expired cursor