Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get bestselling and favorites products in rest API in woocommerce?

I want to get bestselling and favorites products from woocommerce site with rest API .

I read this site but not found any thing about that.

Does it exist any way to get that ?

like image 289
DaVoD Hoseiny Avatar asked Oct 18 '25 21:10

DaVoD Hoseiny


1 Answers

For People Who are Still Stumbling upon this Question

As per WC v3 API. You can now pull Most Popular products through the API (which is the best selling product list as per my understanding);

GET /wp-json/wc/v3/products?orderby=popularity&order=desc

This should get you the most popular products in descending order by the number of sales. This is not currently documented (as of Feb 2, 2021).

Total list of possible orderby params are: date, id, include, title, slug, modified, menu_order, price, popularity, rating

Another part of the question asks for Favorite product API, which woo commerce doesn't have.

like image 119
Sisir Avatar answered Oct 22 '25 05:10

Sisir