> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/uof/custombet-cb/api/calculate-filter.md).

# Calculate-filter

Used this endpoint to get the odds and fair probabilities of the Custom Bet, and **determine which Custom Bet combinations are viable.**

Market and outcome elements will contain an extra "conflict" attribute, which will indicate whether specific markets and outcomes conflict with the current selections or not. The endpoint will return a response that contains the new "conflict" attribute in all the available selections for the selected markets.

{% hint style="success" %}
**Best Practice:**

* Conflict Handling: Use the "conflict" attribute to filter out or visually distinguish conflicting selections in the UI. This helps prevent users from creating invalid bet combinations.
* Selected Items: Any selections already made will be marked as conflict=false. These should remain interactive in the UI. If a user clicks on a selection that is already chosen and marked as conflict=false, treat this as a deselection action, not a new selection.&#x20;
  {% endhint %}

**Request Parameters**

<table data-full-width="true"><thead><tr><th>Element</th><th>Description</th><th>Attribute</th><th>Attribute Description</th><th>Possible Values</th></tr></thead><tbody><tr><td><strong>filterselections</strong></td><td>Root element</td><td><code>xmlns</code></td><td>XML namespace.</td><td>Always <strong>http://schemas.sportradar.com/custombet/v1/endpoints</strong></td></tr><tr><td><strong>selection</strong></td><td>Element containing all the information about a certain selection of markets and outcomes.</td><td><code>id</code></td><td>This id represents a unique match.</td><td><code>sr:match:123456</code></td></tr><tr><td></td><td></td><td><code>market_id</code></td><td>The unique id for a specific market.</td><td>Integer value:<br>• 18<br>• 26<br>• 551</td></tr><tr><td></td><td></td><td><code>specifiers</code> <em>(optional)</em></td><td>Specifiers are a way to uniquely identify a market with additional parameters together with the market id.</td><td>Example:<br>In a total market, the specifier could be seen as <code>specifiers="total=1.5"</code>, and the different outcomes as <code>"under 1.5"</code> or <code>"over 1.5"</code>.</td></tr><tr><td></td><td></td><td><code>outcome_id</code></td><td>The identifier of a unique outcome within a specific market.</td><td>Integer or string value, depending on a market:<br>• 12<br>• 70<br>• <code>sr:goal_range:7+-1343</code><br>• <code>sr:player:123456</code></td></tr><tr><td></td><td></td><td><code>odds</code></td><td>The odds price (odds with key) that you want to use for this selection. If provided, this odds will be used to calculate the Custom Bet odds.<br>You can use any odds sources. Check this page for more #.</td><td><code>1.32</code></td></tr></tbody></table>

**Response**

<table data-full-width="true"><thead><tr><th>Element</th><th>Description</th><th>Attribute(s)</th><th>Attribute Description</th><th>Possible Values</th></tr></thead><tbody><tr><td><strong>calculation_response</strong></td><td>Root element</td><td><code>xmlns</code></td><td>XML namespace.</td><td>Always <strong>http://schemas.sportradar.com/custombet/v1/endpoints</strong></td></tr><tr><td></td><td></td><td><code>generated_at</code></td><td>Date and time of generated response in ISO 8601 format.</td><td><code>2019-05-06T12:34:49+00:00</code></td></tr><tr><td><strong>calculation</strong></td><td>Element for calculation requests.</td><td><code>odds</code></td><td>Total calculated odds for the selected custom bet, returned in EU odds format.<br><strong>Note:</strong> This is affected by the chosen ladder.</td><td>Number value:<br>• 1.34<br>• 2.23<br>• 0.22</td></tr><tr><td></td><td></td><td><code>probability</code></td><td>The probability of this outcome returned in decimal.</td><td>Number value &#x3C; 1:<br>• 0.34<br>• 0.22<br>• 0.12</td></tr><tr><td></td><td></td><td><code>harmonization</code></td><td>The result of using the harmonization calculation approach.</td><td>True/False</td></tr><tr><td><strong>available_selections</strong></td><td>This child element is identical to the available selection endpoint’s response.</td><td><code>conflict</code></td><td>Indicates whether the selection conflicts with the currently selected combo.</td><td>True/False</td></tr></tbody></table>

## Calculate probability with filtered outcomes

> Calculate probability and odds for your selected outcomes and filter out conflicting outcomes.\
> \
> \*\*Note:\*\* Try it out is disabled for this endpoint in Swagger UI.

```json
{"openapi":"3.0.3","info":{"title":"Betradar API","version":"1.0.0"},"servers":[{"url":"https://global.stgapi.betradar.com/v1"}],"security":[{"apiKeyAuth":[]}],"paths":{"/custombet/calculate-filter":{"post":{"summary":"Calculate probability with filtered outcomes","description":"Calculate probability and odds for your selected outcomes and filter out conflicting outcomes.\n\n**Note:** Try it out is disabled for this endpoint in Swagger UI.","operationId":"calculateCustomBetWithFilter","tags":["CustomBet API"],"parameters":[{"name":"Content-Type","in":"header","description":"Defines the media type of the request body. Must be application/xml.","required":true,"schema":{"type":"string","enum":["application/xml"]}}],"requestBody":{"required":true,"content":{"application/xml":{}}},"responses":{"200":{"description":"Successful calculation with filtered conflicting outcomes","content":{"application/xml":{}}},"400":{"description":"Invalid XML request."},"401":{"description":"Unauthorized. Token is missing or invalid."},"403":{"description":"Forbidden. Access to Custom Bet not allowed."},"409":{"description":"Custom Bet API unavailable or betting not allowed."},"429":{"description":"Too many requests. Rate limit reached."},"500":{"description":"Internal Server Error. Retry or contact support."}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportradar.com/uof/custombet-cb/api/calculate-filter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
