Skip to main content

Pagination

How seek-based pagination works in the Visibuild API, including the query parameters and response format for fetching large result sets in chunks.

Written by Louis Grist

Some endpoints use keyset pagination to return data in chunks, rather than all at once.

  • X-Has-Next-Page is true if more data is available; otherwise, it’s false.

  • X-Per-Page indicates the number of items returned in each response.

Paginated endpoints will also return an extra key in the JSON body called pagination. For example, a response might look like this:

X-Has-Next-Page: true
X-Per-Page: 5

{
"data": {...},
"pagination": {
"pageSize": 5,
"next": "01999999-aaaa-bbbb-cccc-123412341234"
}
}

To fetch the next page, use the next query parameter with the ID returned in the pagination.next field.

https://app.apac.visibuild.com/api/core/v1/projects?next=01999999-aaaa-bbbb-cccc-123412341234

If there are no more pages, the next field will be null and X-Has-Next-Page will be false:

X-Has-Next-Page: false
X-Per-Page: 5

{
"data": {...},
"pagination": {
"pageSize": 5,
"next": null
}
}

Query parameters

Parameter

Type

Default

Description

pageSize

integer

1000

Number of records to return per page. Must be between 1 and 5000.

next

string

-

Cursor token from pagination.next to fetch the next page.

updatedBefore

ISO 8601 datetime

-

Filter records updated before this datetime. Only supported on some endpoints.

updatedAfter

ISO 8601 datetime

-

Filter records updated after this datetime. Only supported on some endpoints.

Did this answer your question?