scope search
type integer
default 0
description

Specify the page to retrieve.

Page-numbering is based on the value of hitsPerPage. If hitsPerPage=20, then page=0 will display the hits from 1 to 20, page=2 will display the hits from 41 to 60.

Page numbers are zero-based. Therefore, in order to retrieve the 10th page, you need to set page=9.

If you send a request for a page that does not exist, or is out-of-range (i.e. when page > nbPages), we do not return an error. Instead, we return 0 results.

In most cases, page/hitsPerPageis the recommended method for pagination. Take a look at our full discussion on pagination.

Examples

Access the nth page of results

<?php
$results = $index->search('query', [
  'page' => 0
]);
results = index.search('query', {
  page: 0
})
index.search({
  query: 'query',
  page: 0,
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
    'page': 0
})
let query = Query(query: "query")
query.page = 0

index.search(query, completionHandler: { (res, error) in
    print(res)
})
index.search(new Query("query").setPage(0));
index.search(
  new Query("query").SetPage(0)
)
index.search(
  new Query("query").setPage(0)
);
res, err := index.Search("query", algoliasearch.Map{
    "page": 0,
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    page = Some(0)
  )
}
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala