Magento – how to get product list of specified category using rest API

magento2rest

I want to access specified product list. for example access all the products in Jacket's category.

Best Answer

You can get the list of products of specific categories using search criteria concept of rest api.

Below is the url for that .

www.yoururl/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=category_id& searchCriteria[filterGroups][0][filters][0][value]=2& searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[sortOrders][0][field]=created_at& searchCriteria[sortOrders][0][direction]=DESC& searchCriteria[pageSize]=10& searchCriteria[currentPage]=1

Here i am getting products which having category id : 2

Here Id 2 is for jacket.

Same way you can pass your category id with the given criteria.

Note : Assuming you are aware about how to get token for rest api and how to call rest api.

Related Topic