Pagination

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specified with the ?per_page parameter:

GET /collections?per_page=15

You can specify further pages with the ?page parameter:

GET /collections?page=2

You may also specify the offset from the first resource using the ?offset parameter:

GET /collections?offset=5

Page number is 1-based and omitting the ?page parameter will return the first page.

The total number of resources and pages are always included in the X-PH-Total and X-PH-TotalPages HTTP headers.

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

Link: <https://www.example.com/wp-json/wc/v1/products?page=2>; rel="next",
<https://www.example.com/wp-json/wc/v1/products?page=3>; rel="last"`

The possible rel values are:

Value

Description

next

Shows the URL of the immediate next page of results.

last

Shows the URL of the last page of results.

first

Shows the URL of the first page of results.

prev

Shows the URL of the immediate previous page of results.

Last updated