Guides
Pagination
The Liveday API uses offset-based pagination with size and from parameters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
size | integer | 100 | Number of results to return (max: 1000) |
from | integer | 0 | Offset from the beginning of the result set |
Example
Fetch the first 10 results:
curl -G "https://api.liveday.se/analytics_search/api/transactions" \
-H "Authorization: Bearer sk_your_api_key" \
-d "size=10" \
-d "from=0"
Fetch the next 10:
curl -G "https://api.liveday.se/analytics_search/api/transactions" \
-H "Authorization: Bearer sk_your_api_key" \
-d "size=10" \
-d "from=10"
Response
The response includes total_count so you can calculate how many pages remain:
{
"data": {
"total_count": 342,
"orders": [...]
}
}
In this example with size=10, you'd have 35 pages total (Math.ceil(342 / 10)).
Sorting
Results can be sorted using the sort and order parameters:
| Sort field | Description |
|---|---|
date | Order creation date (default) |
price | Total price |
customer_name | Customer name alphabetically |
| Order | Description |
|---|---|
desc | Descending (default) |
asc | Ascending |
curl -G "https://api.liveday.se/analytics_search/api/transactions" \
-H "Authorization: Bearer sk_your_api_key" \
-d "sort=price" \
-d "order=asc" \
-d "size=25"
Maximum results
The API returns a maximum of 1000 results per request. If total_count exceeds your request size, paginate through results using the from parameter.