Skip to main content
The offset parameter specifies the zero-based index of the first record to return. Use it with length to retrieve a specific subset of results. This is useful when implementing offset-based pagination—an alternative to using page and hitsPerPage. For example, to fetch records 50 through 80, set offset to 49 and length to 30.

Usage

  • Zero-based: the tenth record is at offset 9.
  • If offset is omitted, length is ignored.
  • If offset is specified but length omitted, the number of records returned is equal to hitsPerPage.
With offset and length, the response includes these fields:
 {
   // ...
   "offset": 5,
   "length": 10,
   // ...
 }

Example

Current API clients

var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(new SearchParamsObject { Query = "query", Offset = 4 })
);
index.Search(new Query("query")
{
    Offset = 4
});
I