Retrieve a Category
List products in a category.
On this page
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 Getting started guide.
React
tsx
JS SDK
ts
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: