Retrieve a Category's Products in Storefront

In this guide, you'll learn how to retrieve a category's products in the storefront.

In your storefront, you may want to allow customers to browse products by category. To do so, you can retrieve the products that belong to a category and display them in your storefront.

To retrieve a category's products in the storefront, send a request to the List Products API route passing it the category_id query parameter:

Tip: Learn how to install and configure the JS SDK in the JS SDK documentation.

In this example, you retrieve the products that belong to a category by passing the category's ID as a query parameter to the List Products API route. You can also pass other query parameters to filter or paginate the products, such as limit and offset.

The response has a products field, which is an array of products.

To learn more about displaying the products and their variants, refer to the following guides:

Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break