API Reference / API Parameters / page
Type: integer
Engine default: 0
Parameter syntax
'page' => page_number

Can be used in these methods:

About this parameter

Specify the page to retrieve.

Algolia uses the page and hitsPerPage parameters to control how search results are displayed (paginated).

  • hitsPerPage: sets the number of search results (hits) displayed per page. Choose a value between 1 and 1,000. The default is 20.
  • page: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is page=0, the second is page=1, and so on.

For example, to display 10 results per page starting from the third page, set hitsPerPage to 10 and page to 2.

Usage notes

  • You can see the number of available pages in the value of nbPages in the JSON response to the search query.
  • If you send a request for a page that doesn’t exist, for example, page is greater than or equal to nbPages, Algolia doesn’t respond with an error. Instead, the response has 0 results.

Examples

Access the nth page of results

1
2
3
$results = $index->search('query', [
  'page' => 0
]);
Did you find this page helpful?