---
title: "Create a request to get product listing page data"
slug: "create-a-request-to-get-product-listing-page-data"
abstract: "How to create a request to get product listing page data."
---
# Create a request to get product listing page data

This topic shows you how to make a call to the Sitecore Discover Search and Recommendation API to get product listing page (PLP) data in the following scenario:

- You want to show 24 results on a PLP (`n_item` = 24).
- You want to make a call to get data for the first page of the PLP (`page_number` =1).
- You want all facets.
- The user must be able to sort products by customer ratings.

> [!note]
> Use the [API explorer](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/the-api-explorer-tab.html "The API Explorer tab") to try out requests and see sample responses.

To create a request to get PLP data:

1. In the header, add [cookies](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/cookies-and-personalization-information.md "Cookies and personalization information") and, if required, [authentication](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/api-authentication-and-authorization.md "API authentication and authorization") details.
2. In the request body, add [page context](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/page-context-object.md "Page context object") and [user context](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/user-context-object.md "User context object"). For page context, include the page `uri` and locale information (if applicable). For user context, include either the `uuid` or the `user_ID`.

    ```JSON
    {
        "context": {
            "page": {
                "uri": "/womens/memory-foam"
            },
            "user": {
                "uuid": "sampleUUID"
            }
        }
    }
    ```

3. Add [widget](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/the-widget-request-object.md "The widget request object") information. Here, we want all widgets.

    ```JSON
    {
        "widget": {
            "all": true
        }
    }
    ```

4. Add [pagination](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/the-content-request-object.html#UUID-58f19ac5-2bfe-36e0-7790-e5e48dd687f3_section-idm4560157801720032924396739977 "Related keys") information. Specify the number of items (`n_item`) you want to see in one page of search results. Also, specify the page (`page_number`) you are making the call for.

    ```JSON
    {
        "n_item": 24,
        "page_number": 1
    }
    ```

5. Add [facet](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/the-facet-request-object.md "The facet request object") information to tell Discover how many facets you want. Here, we want all facets.

    ```JSON
    {
        "facet": {
            "all": true
        },
    }
    ```

6. Add [sort](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/the-sort-request-object.md "The sort request object") information to tell Discover how you want to sort. Here, we want the customer to sort products by ratings in descending order.

    ```JSON
    {
        "sort": {
            "value": [
                {
                    "name": "rating",
                    "order": "desc"
                }
            ]
        }
    }
    ```

7. Request [product content](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/integrate-using-the-search-and-recommendation-api/integrating-a-product-listing-page/the-content-request-object.md "The content request object"). Here, we want the entire product.

    ```JSON
    {
        "content": {
            "product": {}
        }
    }
    ```

You can see the complete request with all objects put together and the corresponding response in the sample section.