Pagination

Learn how to navigate with paginated results

Pagination filters

Livestorm's public API uses pagination for list endpoints. Each paginated endpoint can be manipulated using 2 filters:

  • page[number] (optional): The current page's index, which starts at 0 by default.
  • page[size] (optional): The page size (or number of items that must be returned) which will be 20 by default. The maximum allowed value is 50.

Here's an example of an API call using these filters:

curl 'https://api.livestorm.co/v1/events?page\[number\]=2&page\[size\]=10' \
  -H 'authorization: YOUR_API_TOKEN'

Response format

Each paginated endpoint will return a JSON payload that contains 2 top-level attributes:

{
  "data": [],
  "meta": {
    "current_page": 0,
    "previous_page": null,
    "next_page": 1,
    "record_count": 25,
    "page_count": 2,
    "items_per_page": 20
  }
}

data

The actual array of data returned for this endpoint.

meta

This attribute will contain 5 sub-attributes that will give you context about pagination:

  • current_page: The current page. Starts at 0.
  • previous_page: The previous page. If the current page is 0, then the previous page will be null.
  • next_page: The next page. If the current page is also the last one, then the next page will be null.
  • record_count: The total number of items for this endpoint with the specified filters.
  • page_count: The number of pages available for the specified filters.
  • items_per_page: The total number of items sent per page (default would be 20).

📘

Trying to call a page that doesn't exist will result in an HTTP 400 error.