API & Endpoints

This section contains information about the different endpoints in the API, and what values to expect from each endpoint.

Our current response time for 3 endpoints:

  • Available selections <1s

  • Calculation < 1s

  • Calculation Filter <1.5 s

NOTE:

All bet settlements/clearings in CustomBet comes via the Unified Odds Feed, and not directly from the API itself.

POST

/custombet/calculate

Calculate probability (odds) for your selected outcomes.

This is the same list as the one from available_selections, excluding the already picked markets.

GET

Returns all available (and allowed) markets for a sport event.

Response codes

Code
Name
Description

200

Ok

When everything is ok and we return data directly in the http body.

400

Bad request

Possible reasons:

  • Contradiction in selected markets

  • Selecting an unavailable market

  • Creating a combination on markets that is not allowed

  • Malformed request body, etc.

401

Unauthorized

Token is missing or invalid

403

Forbidden

Access to CustomBet not allowed

429

Too many requests

Rate limit was reached

500

Internal server error

Unexpected error. Feel free to contact our support if you see this error.

Contact support...

503

Service unavailable

Returned when the underlying odds producers are temporarily down. Retry again soon.

Common client errors (4xx) that CustomBet API return are mentioned below.

Response Code
Condition
Validation message from custom bet API

400

Contradiction

This combination is not possible, contradictory selections

Bad Bookmaker

Bookmaker is not configured

Bad Condition

The market cannot be created for (Id)

Bad Market

The market is unavailable: (MarketId)

Bad Outcome

The outcome (OutcomeID) is not found

Bookmaker package access error

Bookmaker (bookmakerId) has no access to the Sport (sportId)

Illegal argument

Illegal arguments combination

Illegal market combination

Illegal market combination

Illegal Player combination

Illegal player combination, you cannot combine same players

Illegal selection more than one player market line

Illegal selection, more than one outcome per market line per player!

Illegal selection player markets

Illegal selection, between player markets

Implied market combination

One or more market selections imply a similar outcome to another market selection. Please select different markets

Invalid event state

No state for the event: (match id)

Invalid market outcome combination

Illegal/Implied market and outcome combinations

Invalid matrix event

No matrix data for the event: (match id)

Limit match combination exceeded

Match combination exceed the limit

Malformed body

Request body missing or malformed

Missing specifier

Required specifier is missing: (SpecifierId)

No Specifier

No specifiers when specifiers are required

Number of selections exceeded limit

Number of selections cannot be more than (selectionLimit)

Player Not found (In Multiple anytime goal scorer)

No probabilities for some players:(Player id)

Player probability is higher in Multiple anytime goal scorer

The selected players of a team have a combined scoring-likelihood of more than 100%. This is because a very likely benchplayer was added to the ticket

Probability of the combined selections is too low

Negligible Probability. The combination selected is too unlikely to happen, please select a different combination.

Selection implies another market outcome

One or more market selections imply a similar outcome to another market selection. Please select different markets

Unknown Specifier

Specifier not recognized: (SpecifierId)

Unavailable market selection

Selected market is unavailable: (MarketID), specifier: (SpecifierNameAndValue)

Unsupported specifier value

Unsupported or bad specifier value

Wrong Number of specifiers

Expected (Specifier count) specifier(s) but was (Given specifier count)

For non-total markets, when the market ID is not unique

This combination is not possible, contradictory selections. Duplicate market ID XXX found for match ID XXX.

For total markets, when the same market ID has non-unique outcome IDs.

One or more market selections imply a similar outcome to another market selection. Duplicate outcome ID %d in market ID %d. Please select only one."

For total markets, when the same market ID has over total greater than others down the list.

This combination is not possible, contradictory selections. Under total %f should be greater than over total %f in combination with market ID %d.

For total markets, when the same market ID has totals that are too close in values.

This combination is not possible, contradictory selections. Not sufficient difference between over total %f and under total %f in market ID %d.

404

Invalid event

No data for the event: (match id)

409

API Unavailable

Custom Bet API currently unavailable for prematch data

Betting not available yet

Betting has not started

BetStop event occurred and betting is not allowed

Betstop status (bettingReason)

Limit match combination exceeded

Match combination exceed the limit

Note

Response body should only be parsed in case the server returns 200 (or 400 for specifics about invalid combinations). For any other cases the response body should only serve as a hint during development, as it might be removed later on.

Available selections endpoint

Element
Element Description
Attribute(s)
Attribute Description
Possible values

available_selections

Root element.

xmlns

XML namespace.

generated_at

Date and time of generated response in ISO 8601 format

2019-05-06T12:34:49+00:00

event

Sub-element of <available_selections>

Element containing event-specific attributes

id

This id represents a unique match

sr:match:12345

markets

Sub-element of <event>

Element containing all markets for a specific event

-

-

-

market

Sub-element of <markets>

Element containing all outcomes for a market.

id

The unique id for a specific market.

Integer value:

  • 18

  • 26

  • 551

specifiers

(optional)

Specifiers are a way to uniquely identify a market with additional parameters together with the market id.

Example:

In a total market, the specifier could be seen as specifiers="total=1.5", and the different outcomes would be “under 1.5” or “over 1.5”.

outcome

Sub-element of <market>

Element containing a unique outcome id for a market

id

The identifier of a unique outcome within a specific market.

Integer or string value, depending on a market:

  • 12

  • 70

  • sr:goal_range:7+:1343

  • sr:player:123456

Available selection XML response example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<available_selections xmlns="http://schemas.sportradar.com/custombet/v1/endpoints" generated_at="2019-05-06T12:34:49+00:00">
    <event id="sr:match:14736961">
        <markets>
            <market id="14" specifiers="hcp=1:0">
                <outcome id="1711"/>
                <outcome id="1712"/>
                <outcome id="1713"/>
            </market>
            <market id="26">
                <outcome id="70"/>
                <outcome id="72"/>
            </market>
            <markets>
            <market id="65" specifiers="hcp=0:1">
                <outcome id="1711"/>
                <outcome id="1712"/>
                <outcome id="1713"/>
            </market>
            <market id="90" specifiers="total=0.5">
                <outcome id="12"/>
                <outcome id="13"/>
            </market>
            <market id="91" specifiers="total=1.5">
                <outcome id="12"/>
                <outcome id="13"/>
            </market>
            <market id="25" specifiers="variant=sr:goal_range:7+">
                <outcome id="sr:goal_range:7+:1344"/>
                <outcome id="sr:goal_range:7+:1345"/>
                <outcome id="sr:goal_range:7+:1342"/>
                <outcome id="sr:goal_range:7+:1343"/>
            </market>
        </markets>
    </event>
</available_selections>

Calculation endpoint

This endpoint returns the list of available selections.

Element
Description
Attribute
Description
Possible values

selections

Root element

xmlns

XML namespace.

selection

Sub-element of <selections>

Element containing all the information about a certain selection of markets and outcomes.

id

This id represents a unique match.

sr:match:123456

market_id

The unique id for a specific market.

Integer value:

  • 18

  • 26

  • 551

specifiers

(optional)

Specifiers are a way to uniquely identify a market with additional parameters together with the market id.

Example:

In a total market, the specifier could be seen as specifiers="total=1.5", and the different outcomes would be “under 1.5” or “over 1.5”.

outcome_id

The identifier of a unique outcome within a specific market.

Integer or string value, depending on a market:

  • 12

  • 70

  • sr:goal_range:7+:1343

  • sr:player:123456

odds

(Optional attribute) The odds you used for this market in your main content.

**This attribute is a new feature, only for pilot bookmakers now. If you are not informed as pilot bookmaker, you don't need to add this value, and it won't affect your current usage of Custom Bet API.

To understand the new feature, please see this Doc.

Example:

In a Pre-match 1x2 market, the odds is 1.32, then you can send 1.32.

XML example of making a selection request:

<?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:14736961" market_id="14" specifiers="hcp=1:0" outcome_id="1711"/>
  <selection id="sr:match:14736961" market_id="26" outcome_id="70"/>
</selections>

Calculation response

Element
Element Description
Attribute(s)
Attribute Description
Possible values

calculation_response

Root element

xmlns

XML namespace.

generated_at

Date and time of generated response in ISO 8601 format

2019-05-06T12:34:49+00:00

calculation

Element for calculation requests.

odds

Total calculated odds for the selected custom bet, returned in EU odds format.

Note: This is affected by the chosen ladder.

Number value:

  • 1.34

  • 2.23

  • 0.22

probability

The probability of this outcome returned in decimal

Number value <1:

  • 0.34

  • 0.22

  • 0.12

harmonization

The result of using the harmonization calculation approach.

  • true: We used the odds you sent to calculate Custom Bet odds. The Custom Bet odds is not affected by the chosen ladder.

  • false: We use the original approach to calculate Custom Bet odds. The Custom Bet odds is affected by the chosen ladder.

**The attribute will only be "true" if you are selected as pilot bookmakers and have successfully send us "odds" in the calculation request.

To understand the new feature, please see this Doc.

available_selections

This child element is identical to the element with the same name described in THIS table found above.

-

-

-

Calculated response XML example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<calculation_response xmlns="http://schemas.sportradar.com/custombet/v1/endpoints" generated_at="2019-05-06T12:34:49+00:00">
    <calculation odds="2.0260542763219798" probability="0.444190623492253" harmonization="false"/>
    <available_selections>
        <event id="sr:match:14736961">
            <markets>
                <market id="65" specifiers="hcp=0:1">
                    <outcome id="1711"/>
                    <outcome id="1712"/>
                    <outcome id="1713"/>
                </market>
                <market id="90" specifiers="total=0.5">
                    <outcome id="12"/>
                    <outcome id="13"/>
                </market>
                <market id="91" specifiers="total=1.5">
                    <outcome id="12"/>
                    <outcome id="13"/>
                </market>
                <market id="25" specifiers="variant=sr:goal_range:7+">
                    <outcome id="sr:goal_range:7+:1344"/>
                    <outcome id="sr:goal_range:7+:1345"/>
                    <outcome id="sr:goal_range:7+:1342"/>
                    <outcome id="sr:goal_range:7+:1343"/>
                </market>
            </markets>
        </event>
    </available_selections>
</calculation_response>

Invalid response XML example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns="http://schemas.sportradar.com/custombet/v1/endpoints" response_code="BAD_REQUEST" generated_at="2019-05-06T12:34:49+00:00">
    <message>This combination is not possible, contradictory selections</message>
</response>

Multi-match combos:

Multi-match combos allow users to make combinations across up to 5 different matches, all whilst taking into account the related contingencies for selections in the same match.

Multi-match combos within a single API request is currently limited to Soccer-only, however clients are welcome to create their own multi-match multi-sport accumulators on their end by making separate custombet requests per match and then multiplying the odds together.

Below is an example of a single custombet request that combines the odds across 2 matches. Note that to make multi-match calculations there needs to be at least 2 or more different match IDs passed through the <selection> tags.

<?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"/>
  <selection id="sr:match:23456789" market_id="1" outcome_id="1"/>
  <selection id="sr:match:23456789" market_id="26" outcome_id="70"/> 
</selections>

Multiple Goalscorers

It is possible to combine multiple player selections for goalscorer markets within a CustomBet.

Users can add multiple players for the anytime goal scorer market and combine these with the first scorer and last scorer markets (next scorer in liveodds). Obviously only one player can be included for each of the first/last/next scorer markets.

Note that the same player cannot be selected twice within the same CustomBet

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<selections xmlns="http://schemas.sportradar.com/custombet/v1/endpoints">
    <selection id="sr:match:27866944" market_id="1" outcome_id="1"/>
    <selection id="sr:match:27866944" market_id="40" outcome_id="sr:player:548660" specifiers="type=prematch"/>
    <selection id="sr:match:27866944" market_id="40" outcome_id="sr:player:1399463" specifiers="type=prematch"/>
</selections>
 
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<calculation_response xmlns="http://schemas.sportradar.com/custombet/v1/endpoints" generated_at="2021-08-03T12:16:15+00:00">
    <calculation odds="39.01214221196069" probability="0.014774808745240717"/>
    <available_selections>
        <event id="sr:match:27866944">
            <markets>
             ...
            </markets>
        </event>
    </available_selections>
</calculation_response>

Outcome filtering endpoint

This endpoint can be used to help 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.

A common use case for this would be to filter out contradictory selections in the UI to preemptively stop punters from selecting invalid combinations.

Element

Description

Attribute

Description

Possible values

filterselections

Root element

xmlns

XML namespace.

selection

Sub-element of <filterselections>

Element containing all the information about a certain selection of markets and outcomes.

id

This id represents a unique match.

sr:match:123456

market_id

The unique id for a specific market.

Integer value:

  • 18

  • 26

  • 551

specifiers

(optional)

Specifiers are a way to uniquely identify a market with additional parameters together with the market id.

Example:

In a total market, the specifier could be seen as specifiers="total=1.5", and the different outcomes would be “under 1.5” or “over 1.5”.

outcome_id

The identifier of a unique outcome within a specific market.

Integer or string value, depending on a market:

  • 12

  • 70

  • sr:goal_range:7+:1343

  • sr:player:123456

odds

Same as calculation endpoint.

This is an Optional attribute.

**This attribute is not publicly available yet. Only pilot bookmakers can use the attribute. If you are not informed as pilot bookmaker, you don't need to add this value, and it won't affect your current usage of Custom Bet API.

The odds you used for this market in your main content.

Example:

In a Pre-match 1x2 market, the odds is 1.32, then you can send 1.32.

Request Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<filterSelections xmlns="http://schemas.sportradar.com/custombet/v1/endpoints">
    <selection id="sr:match:17506667">
        <market market_id="1" outcome_id="1"/>
        <market market_id="26" outcome_id="72"/>
    </selection>
</filterSelections>

Available markets and outcomes include an additional attribute that shows if that outcome can be combined with the already selected markets. If an outcome is not combinable it will have conflict=true attribute. If all outcomes for the market is not combinable, market will have conflict=true.

Available selection XML response example with conflict attribute:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response 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/Calculation.xsd"
  generated_at="2019-06-25T06:32:15+00:00">
  <calculation odds="1.34" probability="0.34"/>
  <available_selections>
    <event id="sr:match:34234">
      <markets>
        <market id="18" specifiers="total=5.5" conflict="false">
            <outcome id="12" conflict="false"/>
            <outcome id="13" conflict="false"/>
        </market>
        <market id="34" conflict="true">
            <outcome id="74" conflict="true"/>
            <outcome id="76" conflict="true"/>
        </market>
        <market id="19" specifiers="total=0.5" conflict="false">
            <outcome id="12" conflict="false"/>
            <outcome id="13" conflict="true"/>
        </market>
      </markets>
    </event>
  </available_selections>
</response>

JSON Request Payload

{
  "selection": [{
    "id": "sr:match:17506667",
    "market": [{
        "market_id": 1,
        "outcome_id": "1"
    }, {
        "market_id": 26,
        "outcome_id": "72"
    }]
  }, {
    "id": "sr:match:17506668",
    "market": []
  }]
}

JSON Response

{
    "calculation": {
        "odds": 1.34,
        "probability": 0.34
    },
    "available_selections": {
        "event": [
            {
                "markets": {
                    "market": [
                        {
                            "outcome": [
                                {
                                    "id": "12",
                                    "conflict": false
                                },
                                {
                                    "id": "13",
                                    "conflict": false
                                }
                            ],
                            "id": 18,
                            "specifiers": "total=5.5",
                            "conflict": false
                        },
                        {
                            "outcome": [
                                {
                                    "id": "74",
                                    "conflict": true
                                },
                                {
                                    "id": "76",
                                    "conflict": true
                                }
                            ],
                            "id": 34,
                            "specifiers": null,
                            "conflict": true
                        },
                        {
                            "outcome": [
                                {
                                    "id": "12",
                                    "conflict": false
                                },
                                {
                                    "id": "1",
                                    "conflict": true
                                }
                            ],
                            "id": 19,
                            "specifiers": "total=0.5",
                            "conflict": false
                        }
                    ]
                },
                "id": "sr:match:17506667"
            }
        ]
    },
    "generated_at": "2022-09-26T07:56:40+00:00"
}

Last updated

Was this helpful?