---
title: "The content request object"
slug: "the-content-request-object"
abstract: "Describes the structure and properties of the content object in a Search and Recommendation request."
---
# The content request object

Add a `content` JSON object in a Sitecore Discover Search and Recommendation request to specify the type of content you want to see in the search results. To further customize results, you can specify the maximum number of results, sorting type, and fields displayed for each `<content_type>` in the request.

The following shows the structure of the `content` object in a request:

```csharp
{
    "content": {
	"<content_type>": {
		"max": 10,
		"sort": {
			"type": "text",
			"order": "asc"
		},
		"get_fields": false,
		"field": {
			"value": [
                            "<content_field>"
                        ]
		}
	}
    }
}
```

<details>
<summary><h2>Keys</h2></summary>

The following table describes the key that the `content` object contains.

| Key | Type | Description | Value |
| --- | --- | --- | --- |
| `content_type` | [Content type object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/search-and-recommendation-data-model/request-structure-and-objects/the-content-request-object.html#UUID-58f19ac5-2bfe-36e0-7790-e5e48dd687f3_section-idm4571165033108833213538960563 "Content type object") | Required.<br><br>Type of content that can be queried one at a time or multiple instances at a time.<br><br>Each content type requires a feed or another data source.<br><br>The only out-of-the-box `content_type` we support is `product`.<br><br>Default: `product` | `product` |

### Content type object

The following table describes the keys in the `content type` object:

| Key | Type | Description |
| --- | --- | --- |
| `max` | integer | Optional.<br><br>Limits the number of results of the content returned per page.<br><br>Default: `n_item` |
| `sort` | [Sort object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/search-and-recommendation-data-model/request-structure-and-objects/the-content-request-object.html#UUID-58f19ac5-2bfe-36e0-7790-e5e48dd687f3_section-idm4589559270384033213539827108 "Sort object") | Optional.<br><br>Determines the sort order of the `<content_type>`<br><br>Example:<br><br>```csharp<br>{"type": "text",<br> "order": "asc"}<br>``` |
| `get_fields` | Boolean | Optional.<br><br>If you set this to `true`, the response returns a list of all possible content field names.<br><br>Default: `false` |
| `field` | array of strings | Optional<br><br>The available `<content_field>` per `<content_type>` in the query. |

### Sort object

The following table describes the keys in the `sort` object:

| Key | Type | Description | Value |
| --- | --- | --- | --- |
| type | string | Required.Whether you want to sort content alphabetically or by the number of items that have this value.For example, a search result has five red and four blue items. If you specify the sort type as count, the red items appear first because there are more red items than blue. | count (default)text |
| order | string | Required.Whether you want to sort content in an ascending or descending order. | desc (default)asc |

</details>

<details>
<summary><h2>Related keys</h2></summary>

The following table describes the keys related to the `content` object:

| Key | Type | Description |
| --- | --- | --- |
| n_item | integer | Optional.Total number of the items to be returned for all <content_types> requested in the content object.NoteThe n_item you specify impacts the latency of the request. We recommend you use a value of less than or equal to 48, typically, between 10 and 24. Any number greater than 48 might degrade the latency of the request, and SLAs cannot be guaranteed.Default: 10 |
| page_number | integer | Optional.Page number to be returned. The page contains a maximum of n_item items.NoteThe page_number does not return the maximum number of n_item items if there are not enough items on the last page or if querying content does not have enough pages.Default: 1Example:A request for page_number 5 gives you content to be shown on the 5th page. |

</details>

<details>
<summary><h2>Example</h2></summary>

The following code shows a request to get the `name` and `price` of 10 products:

```csharp
{
    "n_item": 10,
    "content": {
        "product": {
            "field": {
                "value": [
                    "price"
                ]
            }
        }
    }
}
```

</details>