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

You can add a `batch` JSON object in a Sitecore Discover Search and Recommendation request. You can combine multiple requests into a `batch` object and specify the sequence and dependencies between related requests.

For example, when you work with recommendations, group requests for distinct recommendation widgets into a single object instead of creating individual requests. Then, when you have multiple recommendation widgets on the same page, the `batch` object returns non-duplicate results in the response.  This ensures that you do not see the same product twice on a page.

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

```csharp
{
    "batch": [{
	"<request_key>": {
            "<request_key_id>": "<request_value>"
	}
    }]
}
```

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

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

| Key | Type | Description |
| --- | --- | --- |
| `<request_key>` | object | Required.<br><br>Key that Discovers overrides for the batch. The key value is the overridden value. |

</details>

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

The following shows an example of a batch request to override the filter object and the corresponding widget IDs for a batch of 2 requests:

- For the first request, you want to apply a filter to `category_id` *1* and `color` *red*.
- For the second request, you want to apply a filter to `category_id` *2* and `color` *blue*

Here is the sample request:

```csharp
{
    "batch": [{
	"filter": {
    	   "category_id": "1",
	   "colors": "red"
	},
	"widget": {
	    "rfkid": "rfkid_1"
	}
    },
    {
	"filter": {
           "category_id": "2",
	   "colors": "blue"
	},
	"widget": {
	    "rfkid": "rfkid_4"
	}
    }
    ]
}
```

</details>