Pagination

In this guide, we will look at how to work with paginated responses when querying the Virlo API. List endpoints use offset-based pagination. You request results using the limit and page query parameters; the API converts page to offset internally. If you are using one of the official Virlo API client libraries, pagination is handled for you behind the scenes.

When an API response returns a list of objects, the results appear inside a data object alongside pagination metadata: total, limit, and offset. These fields describe the total number of items, how many were requested, and the starting position.

Pagination parameters

Use the limit and page parameters to control how many results you receive and which page you're viewing. The response includes total, limit, and offset fields inside the data object.

  • Name
    limit
    Type
    integer
    Description

    Number of items per page. Value between 1 and 100. Default is 50.

  • Name
    page
    Type
    integer
    Description

    The page number to fetch. 1-indexed. Default is 1.

Paginated request using cURL

curl -G https://api.virlo.ai/v1/videos \
  -H "Authorization: Bearer virlo_tkn_<your_key>" \
  -d limit=25 \
  -d page=2

Paginated response

{
  "data": {
    "total": 97,
    "limit": 25,
    "offset": 25,
    "videos": [
      {
        "id": "WAz8eIbvDR60rouK",
        "..."
      },
      {
        "id": "hSIhXBhNe8X1d8Et",
        "..."
      }
    ]
  }
}

Pagination metadata

The data object includes pagination metadata alongside the results:

  • total — Total number of items across all pages
  • limit — The number of items per page (requested via limit parameter)
  • offset — The starting position for the current page (e.g., page 1 = offset 0, page 2 with limit 50 = offset 50)

Was this page helpful?