How to get only products from a particular category using the API?

i would like to get all products from a particular category using the API, i am using the https://xxxxxxx.com/api/v1/product to get all products from the shop but is there a way of getting only products from one category not all products using the API.

Hi ssali,

If you need the products for exactly one category (not a category path) there is an easy way. You just need turn around you  search. So instead of searching for products and check what category they are assigned to you can query the products of a category itself:

The api endpoint would be 

POST https://shop.domain/api/v{version}/search/category/014c55d9156e40188f34b6b99e957069/products

 

This is also described in the shopware documentation.

https://docs.shopware.com/en/shopware-platform-dev-en/admin-api-guide/reading-entities?category=shopware-platform-dev-en/admin-api-guide

Hope this helps you :) 

You can easily get a list of products from a certain category by using product.list method provided by API2Cart. This method allows filtering products by category_id parameter. Using this API solution you will be able to get products not only from Shopware but also from other popular eCommerce platforms via one unified API.