Betradar - the betting arm of Sportradar

Page tree

Betradar - the betting arm of Sportradar

Skip to end of metadata
Go to start of metadata

Market descriptions and outcome descriptions have a template language that can be used to describe the actual market or outcome. This is easiest described with an example:

XML example
<market id="300" name="Race to {pointnr} points">

NOTE

The SDK takes care of these market description automatically for you, so you don’t have to manage any of the above yourself when using it.

Anything between curly braces {} can be replaced by the actual market information in an odds_change message. Normally what is in between the curly braces is a name of a specifier and should be replaced by that particular specifier value. Consequently, if you receive an odds_change message like this:

XML example
<market id="300" specifiers="pointnr=3">

You should print this market name as “Race to 3 points”.

If the first character after the opening curly brace is an !, followed by a specifier name, then you should replace the curly-braces expression with the specifier as an ordinal number, illustrated below.

XML example
<market id="446" name="{!periodnr} period - total">

And you receive an odds_change message with the following market info:

XML example
<market id="446" specifiers="periodnr=2">

You should display the market name as: “Second period – total”.

If the first character after the opening curly brace is a + followed by a specifier name, then the specifier must be of number type, and you should replace the curly-braces expression with the specifier and add the right +/- sign in front of it.

If the first character after the opening curly brace is a - followed by a specifier name, then the specifier must be of number type and you should replace the curly-braces expression with the negated specifier and add the right +/- sign in front of it.

There are a few special keywords that can also show up within the curly-braces that have a special meaning:

  • {$competitor1} means to replace the expression with the name of the first competitor in the sport event – note this is often occurring in the outcome descriptions.
  • {$competitor2} means to replace the expression with the name of the second competitor in the sport even – note this is often occurring in the outcome descriptions.
  • {$event} means to replace the expression with the name of the event. This is typically used for outright markets.

Pattern

Action

Example market description template:

Example specifiers in a message:

Example market description

{X}

Replace {X} with the value of the specifier X.

“Race to {pointnr} points”

… specifiers=”pointnr=3”

“Race to 3 points”

{!X}

Replace {X} with the ordinal value of the specifier X




{+X}

Replace {X} with the value of the specifier X with a +/- sign in front.




{-X}

Replace {X} with the negated value of the specifier with a +/- sign in front




{(X+/-c)}

Replace the expression with the value of the specifier X + or - the number c.

“{!(inningnr+1)}

inningnr=2

“3rd inning”

{$competitorN}

Replace with the Nth competitor in the event or if you prefer “TeamN” or “PlayerN” as appropriate




{$event}

Replace with the name of the event.

“Winner of {$event}”

Id=”sr:tournament:1”

“Winner of Euro2016”

{%player}

Replace with the name of the specifier (which should be an id typically to a player or competitor)

“{%player} total dismissals"

player=sr:player:1234

“John Rodriquez total dismissals”

NOTE: In some cases, the attribute “product_ids” will be displayed in addition to the normal “product_id” attribute. This is an indication that some mappings are available for multiple odds producers. This is usually the case when the mapping includes both the Live Odds producer and the BetPal producers. In this case, the attribute will display: product_ids=”1|4” (1 is for Live Odds, 4 is for BetPal).

We are moving away from using the “product_id” attribute, and clients should therefor start using “product_ids” instead.

XML example
<mappings> 
    <mapping product_id="1" product_ids="1|4" sport_id="sr:sport:6" market_id="8:232" sov_template="{total}"> 
      <mapping_outcome outcome_id="13" product_outcome_id="2528" product_outcome_name="under"/> 
      <mapping_outcome outcome_id="12" product_outcome_id="2530" product_outcome_name="over"/> 
</mapping>


  • No labels