Get specific values in Woocommerce Rest API

Woocommerce rest API is an extension of WordPress rest API, so you should first check global parameters and specifically “_fields” in the REST API Handbook of WordPress.org.

I will give you an example of the data that you want, price and quantity, but also the id and the name of the products for the response to be more human friendly.

/wp-json/wc/v3/products?per_page=100&_fields=id,name,regular_price,stock_quantity

The “_fields” attribute is used for every attribute you want to get.

The “per_page” attribute with value of “100” is used to get 100
products which is the max acceptable value of this attribute and if
you leave it empty the default is only “10”.

Sorry for the 10 months later answer, but I hope that helped you and any other that is facing the same issue.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)