LogoLogo
HomeApplicationBlog
  • WELCOME
    • Overview
    • Quickstart
    • Key Features
    • Demo
  • ONBOARDING YOUR DATA
    • Getting started
    • Prerequisites
    • Integrations
      • Prometheus
        • Handling organization_id
        • Privacy and Security
      • CloudWatch
      • Datadog
      • Coming soon
      • Request integration
    • Self-hosting
      • Configuration yaml
      • Running locally with Docker
      • Running with Kubernetes (k8s)
    • Data API
      • Example implementation
    • Filters
      • Open source log parsing library
      • Data hashing & transformation
    • Custom adapters
  • API (BETA)
    • Authentication
    • Pagination
    • API Reference
  • How to's
    • Tutorials
      • Build a SLI
      • Build a SLO
      • Create an Organization
      • Build a SLA
      • Configure a SLA Portal
    • Guides
    • Glossary
  • MISC
    • Changelog
    • Join the Closed Beta
  • Legal
    • Terms of Service
    • Contributor License Agreement
    • Privacy Notice
Powered by GitBook
On this page
  • Pagination limits and page size
  • Example
  1. API (BETA)

Pagination

PreviousAuthenticationNextAPI Reference

Last updated 5 months ago

All top-level API resources have support for bulk fetches through API methods that respond with a list. These list API methods share a common structure and accept, at a minimum, the following two parameters: limit and offset.

Pagination limits and page size

slaOS API uses offset based pagination through the limit and offset parameters. Both parameters accept an existing object ID value (see below) and return objects in chronological order. The limit parameter specifies how many records to fetch per page. The offset parameter indicates where to start fetching data or how many records to skip, defining the initial position within the list.

See details on the parameters below

Parameters
Description

limit

Limit specifies how many records to fetch per page. Default value is 10.

offset

Offset indicates where to start fetching data or how many records to skip, defining the initial position within the list. Default value is 0.

In the response, you will get the total number of items (total) which signifies how many results of data we have for the requested information.

Example

For example, if you call GET https://api.rated.co/v1/slis/ you will get all the SLIs that are currently defined on your workspace.

Example of a paginated response
{
  "total": 100,
  "results": [
    {
      "id": "string",
      "name": "string",
      "type": "value",
      "description": "string",
      "unit_of_measure": "string",
      "queries": {
        "additionalProp1": {
          "select": "string",
          "where": "string",
          "from": "string",
          "limit": 0
        },
        "additionalProp2": {
          "select": "string",
          "where": "string",
          "from": "string",
          "limit": 0
        },
        "additionalProp3": {
          "select": "string",
          "where": "string",
          "from": "string",
          "limit": 0
        }
      },
      "formula": "string",
      "created_at": "2024-12-09T11:08:25.973Z",
      "updated_at": "2024-12-09T11:08:25.973Z"
    }
  ],
  "next": "https://endpoint?limit=100&offset=0",
  "previous": "https://endpoint?limit=100&offset=100"
}

Depending on the request, you can also get more than one page of results. You can navigate between these pages using the previous and next URLs. Just use the URL in next to continue fetching the rest of the data. You will also get a url in previous as you navigate throught pages 2,3,4... and so on. When there's no more data left, the API will stop giving you the next link and show next: null.

👇