Query All Your Documents with Javascript

This page shows examples of how to query all the documents in your prismic.io repository.

Without Options

If you need to query all of the documents in your repository, you can just run an empty query.

Copy
// To retrieve the API object, check out the How to Query the API page
api.query('').then(function(response) {
    // response is the response object, response.results holds the documents
});

With Options

You can add options to this query. In the following example we allow 100 documents per page for the query response.

Copy
// To retrieve the API object, check out the How to Query the API page
api.query('', { pageSize : 100 }).then(function(response) {
    // response is the response object, response.results holds the documents
});