Skip to main content

Overview

Several Lindo AI API endpoints support cursor-based pagination to help you efficiently browse through large datasets. You can safely navigate lists with guaranteed stability, even if new objects are created or deleted while you’re still requesting pages. Paginated endpoint responses include:
  • data: the list of returned items.
  • has_more: indicates whether there are more elements available.
  • next_cursor: the cursor to use for fetching the next page (only present when has_more is true).

Parameters

All paginated endpoints support the following query parameters:
number
The number of items to return per page. Default is 20, maximum is 100, and minimum is 1.
string
The cursor from which to start retrieving items. Use the next_cursor value from the previous response to get the next page.

Response Format

Paginated endpoints return responses in the following format:
array
An array containing the actual resources for the current page.
boolean
Indicates whether there are more items available beyond the current page.
string
The cursor to use for fetching the next page. Only present when has_more is true.

Example Usage

First Page

Response:

Next Page

Code Examples

JavaScript

Python

Best Practices

Choose a limit that balances performance and usability. Smaller pages (20-50 items) are good for real-time applications, while larger pages (100 items) work better for bulk processing.
Always check the has_more field before attempting to fetch additional pages. This prevents unnecessary API calls when you’ve reached the end of the dataset.
Be mindful of API rate limits when paginating through large datasets. Implement appropriate delays between page requests if processing many pages.
Cursors are designed for immediate pagination use. Don’t store them for later use as they may expire or become invalid.

Error Handling

Pagination requests may return the following validation errors: Example error response: