# Calculate

## Calculate probability

> Calculate probability and odds for your selected outcomes.

```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":{"post":{"summary":"Calculate probability","description":"Calculate probability and odds for your selected outcomes.","operationId":"calculateCustomBet","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","content":{"application/xml":{}}},"400":{"description":"Invalid XML request."},"401":{"description":"Unauthorized. Token is missing or invalid."},"403":{"description":"Forbidden. Access to 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."}}}}}}
```

**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 <a href="http://schemas.sportradar.com/custombet/v1/endpoints">http://schemas.sportradar.com/custombet/v1/endpoints</a></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.</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>-</td><td>-</td><td>-</td></tr></tbody></table>

**Multi-match Request Example**

Multi-match combos allow users to make combinations across up to 5 different matches, all whilst taking into account the correlation of selections in the same match. You can use this for ACCA bets.&#x20;

If the sport is not supported, you want to combine more matches, or you want to combine multi-sports, you are welcome to create your own accumulators on your end by making separate Custom Bet requests per match and then multiplying the odds together.

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<selections xmlns="http://schemas.sportradar.com/custombet/v1/endpoints"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://schemas.sportradar.com/custombet/v1/endpoints http://schemas.sportradar.com/custombet/v1/endpoints/Selections.xsd">
  <selection id="sr:match:12345678" market_id="14" specifiers="hcp=1:0" outcome_id="1711"/>
  <selection id="sr:match:12345678" market_id="26" outcome_id="70" odd="1.2"/>
  <selection id="sr:match:23456789" market_id="1" outcome_id="1"  odd="1.5"/>
  <selection id="sr:match:23456789" market_id="26" outcome_id="70"  odd="2.3"/> 
</selections>
```
