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

Use a `context` object to specify the [types of context](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-context-request-object.html#UUID-8fcb74eb-68b4-e5d6-4c8c-251e1b859160_section-idm4656582311502433166567572289 "Context type objects") you want to retrieve in the response. You can add different `<context_types>` in your request, such as information about the user, browser, geographic location, store, fitment, page, campaign, and channel to make results more relevant.

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

```csharp
{
    "context": {
	"<context_type>": {
            "<context_key>": {<context_key_values>}
	}
    }
}
```

<details>
<summary><h2>Key</h2></summary>

The following table describes the keys that the `context` object contains:

| Key | Type | Description | Values |
| --- | --- | --- | --- |
| context_type | Context type object | Optional.Contains the supported context object type.You can have more than one context_type. | channelcampaignpagefitmentstoregeobrowseruser |
| context_key | array | Optional.Contains the <context_key_values> that correspond to the fields in each context object type.You can have more than one context_key. | n/a |

</details>

## Context type objects

The following table describes the supported context objects:

| Object | Type | Description |
| --- | --- | --- |
| `user` | [User context 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-context-request-object/user-context-object.html "User context object") | User details including IDs, gender, email address, and group. |
| `browser` | [Browser context 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-context-request-object/browser-context-object.html "Browser context object") | User device or browser information. |
| `geo` | [Geo context 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-context-request-object/geo-context-object.html "Geo context object") | User location including geographic information and IP address. |
| `store` | [Store context 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-context-request-object/store-context-object.html "Store context object") | Store ID associated with the user. |
| `fitment` | [Fitment context 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-context-request-object/fitment-context-object.html "Fitment context object") | User fitment information. |
| `page` | [Page context 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-context-request-object/page-context-object.html "Page context object") | Page details including URL, title, IDs, list of products, and locale information. |
| `campaign` | [Campaign context 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-context-request-object/campaign-context-object.html "Campaign context object") | Campaign information including `utm_source` and `utm_campaign`. |
| `channel` | [Channel context 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-context-request-object/channel-context-object.html "Channel context object") | Channel information. |

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

In this example, you apply a user context for gender:

}

```csharp
{
  "query": {
    "keyphrase": [["red", "shorts"]]
  },
  "n_item": 3,,
  "content": {},
  "context": {
    "user": {
      "gender": "female"
    }
  }
```

</details>