Skip to main content
The LENS API uses two pagination patterns depending on the endpoint type:
  • Offset-based (AG-Grid model) — used by POST endpoints that return tabular data. Covered in detail on this page.
  • Typesense page/per_page — used by the /search-public/* endpoints. See the Public Search group for query-string parameters.

Offset-based pagination

Tabular endpoints (companies at an address, watchlist members, person companies, etc.) accept a POST request whose JSON body specifies the row range, sort order, and filters.

Request body

The page size is endRow - startRow. For example, startRow: 0, endRow: 50 returns the first 50 rows.

Response

How to paginate

Use lastrow to determine if there are more pages:
  • lastrow == -1 — more rows available, request the next page
  • lastrow >= 0 — this is the last page, lastrow is the total row count
Example — fetch all rows in pages of 100:

Sorting

Add a sortModel array to sort by one or more columns:

Filtering

Add a filterModel object to filter results server-side. Each key is a column name; the value describes the filter.

Text filter

Number filter

Date range filter

Set filter (match any of the values)

Multiple conditions on the same column

Supported filter operators

Combining conditions

Use the operator field with "AND" or "OR" to combine multiple conditions on the same column.

Endpoints using this pattern

These POST endpoints accept the pagination request body described above: