I have setup Woo-Commerce which have more than 1000 products. Using Woocommerce rest api php library I am trying to get all products.
But it gives me 10 products. If I use filter[limit] it gives me around 400 products not more than this.
$res = $wc_api->get_products(array( 'filter[limit]' => 400 ) );
Can anyone say me how can I get all products from woocommerce?
This isn't the latest API endpoint:
You have to fetch page per page to get all the products:
Source
For the latest version of the WC API, use
If it's not working try replacing the limit with posts_per_page as follows:
Depending on your server specs and the total number of products this type of query might need a lot of memory so if you get any error or the query doesn't finish be sure that the memory limit in php.ini is high enough.