Skip to content

Magento 2: How get All products (2000 products) using Rest API?

  1. I use Magento2.
  2. I have 2000 products.
  3. I try to get all products, using Rest API.

My request str.:
GET https:///rest/default/V1/products?searchCriteria[pageSize]=1000.
But this is not enough because the total quantity of products is 2000.

If I try to use:

  • GET https:///rest/default/V1/products?searchCriteria[pageSize]=0
    or
  • GET https:///rest/default/V1/products?searchCriteria.

I received error or empty response. I think the response data is too large. So I think, that I need to use pages.

QUESTION: How can I create a Next page, that will start from the last data of the previous page?
EXAMPLE:

  • I have 20 products;
  • 1-st Page includes 10 products (From 1 to 10);
  • 2-nd Page should include 11 products(From 10 to 20);