Query All Your Documents

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

Before Reading

This page assumes that you've already imported the Prismic library and retrieved the api object. If you want to learn how to do this, then refer to the How to Query the API page.

Without Options

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

Copy
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
api.query('', { pageSize : 100 }).then(function(response) {
    // response is the response object, response.results holds the documents
});