OddsMatrix Feed API Documentation ENGLISH
OddsMatrix Feed API Documentation ENGLISH
3
XML - SDQL
SDQL (short for Sports Data Query Language) is a language for retrieving sports data managed by the Sports Engine using XML
documents.
If you're not using one of the provided connectors, you have to use the Sports Data Query Language constructs in order to communicate
with the server.
The SDQL language consists of SDQL constructs. An SDQL construct is an XML document.
All SDQL XML documents have the following structure and content:
sports-model-object
The sports-model-object SDQL construct contains the representation of a sports model object. The general format of this SDQL construct is:
Here is an example of sports-model-object SDQL construct for a betting offer (not all the properties are present):
1 <BettingOffer id="41"
2 providerId="3000388"
3 sourceId="4"
4 outcomeId="180"
5 bettingTypeId="4"
6 statusId="2"
7 isLay="false"
8 isLive="true"
9 odds="51.0"
10 multiplicity="0"
11 slotNum="1"
12 lastChangedTime="2009-10-15 11:41:57.0" />
Please note that all the properties of the type date are expressed in GMT.
sports-model-object-change
The sports-model-object-change SDQL construct is used to communicate that a sports model object was created, updated or deleted.
The general format of the SDQL construct which represents a created sports model object is:
4
The general format of the SDQL construct which represents an updated sports model object is:
The general format of the SDQL construct which represents a deleted sports model object is:
subscribe-request
The subscribe-request SDQL construct is used by the client to create a new subscription with the Sports Engine.
Example:
1 <SubscribeRequest subscriptionSpecificationName="test"/>
subscribe-response
The subscribe-response SDQL construct is a response to a subscribe-request.
Example:
5
1 <SubscribeResponse subscriptionId="8cf74ac6-5702-4421-9735-ec05dd85e27d"
2 subscriptionChecksum="BCB7687137CB458B1A3F1D00171E7F64"/>
initial-data
Initial data dump is sent by the Sports Engine to the client in batches. The initial-data SDQL construct represents a batch of the initial data
dump.
batchesLeft Attribute (int) Specifies how many batches will be sent until the end of the initial data dump.
dumpComplete Attribute (boolean) Specifies whether the initial data dump is complete or not.
Example:
get-next-initial-data-request
The client sends a get-next-initial-data-request SDQL construct when he wants to retrieve the next initial data dump batch.
subscripti Attribute The id received by client with the subscribe-response SDQL construct.
onId (String)
Example:
1 <GetNextInitialDataRequest subscriptionId=”8cf74ac6-5702-4421-9735-ec05dd85e27d”/>
get-next-initial-data-response
get-next-initial-data-response SDQL construct is the response to a get-next-initial-data-request and it encloses an initial-data SDQL
construct.
Example:
1 <GetNextInitialDataResponse>
6
2
3 <InitialData batchId=”123” batchesLeft=”20” dumpComplete=”false”>
4
5 <entities>
6
7 <!-- sports-model-object constructs -->
8
9 </entities>
10
11 </InitialData>
12
13 </GetNextInitialDataResponse>
update-data
The update-data SDQL construct contains 1..n updates on the Sport Data entities.
Note that the order of the sports-model-object-change elements is important. They must be applied to the subscription state in
the same order as they appear in the update-data.
Example:
7
Please note that the batchId(s) are not necessary consecutive. In the example above, the client will receive the batchId= 12 and
then batchId=14.
update-data-resume-request
The update-data-resume-request construct is sent by a client that wants to resume updates after some period of inactivity.
Example:
1 <UpdateDataResumeSinceRequest subscriptionId="454f696d-7e2d-4f46-9611-576009de23b1"
2 subscriptionSpecificationName="your_subscription_name"
3 subscriptionChecksum="BCB7687137CB458B1A3F1D00171E7F64" sinceDate="2024-06-19 12:34:56.789" />
get-next-update-data-request
The client sends a get-next-update-data-request SDQL construct when he wants to retrieve the next updates.
Example:
1 <GetNextUpdateDataRequest subscriptionId=”454f696d-7e2d-4f46-9611-576009de23b1”/>
8
get-next-update-data-response
The get-next-update-data-response SDQL construct is the response to a get-next-update-data-request and it encloses none, one or more
update-data SDQL constructs.
Example:
1 <GetNextUpdateDataResponse>
2
3 <UpdateData batchId="12" batchUuid="41730026382|2" createdTime="2010-03-18 09:05:40.665">
4
5 <!-- sports-model-object-change elements will go here -->
6
7 </UpdateData>
8
9 <UpdateData batchId="13" batchUuid="41730026012|0" createdTime="2010-03-18 09:05:40.665">
10
11 <!-- sports-model-object-change elements will go here -->
12
13 </UpdateData>
14
15 <!-- Other update-data SDQL constructs will go here-->
16
17 </GetNextUpdateDataResponse>
unsubscribe-request
The unsubscribe-request SDQL construct is used by a client to unsubscribe a subscription.
Example:
1 <UnsubscribeRequest subscriptionSpecificationName=”test”
2 subscriptionId=”454f696d-7e2d-4f46-9611-576009de23b1”/>
unsubscribe-response
The unsubscribe-response SDQL construct is a response to an unsubscribe-request.
code Attribute (int) "0" indicates that the operation was successful.
9
"1" indicates that the operation was not successful.
Example:
1 <UnsubscribeResponse code="0"
2 message=”Unsubscription was successful.”/>
ping-request
The ping-request SDQL construct is used by the Sports Engine to check if the TCP/IP connection with the client is still valid.
ping-response
The ping-response SDQL construct must be sent by the client as response to a ping-request SDQL construct.
id Attrib Copied from the ID of the ping-request. Might be used for debugging purposes.
ute
(Strin
g)
Example:
1 <PingResponse id=”96d-7e2d”/>
error
The error SDQL construct can be sent at any time by the Sports Engine to indicate that something has gone wrong.
10
"400" indicates that the update-data-resume-request was unsuccessful,
the client must do a subscribe-request if it gets this error code
"1000" indicates any other type of error.
Example:
1 <error code="300"
2 message=”Too many active subscriptions. Max active subscription number is 2”/>
11
XML example
This example contains the most important entities from the feed, limited to a single football match.
1. Initial data
1 <InitialData batchId="7" batchesLeft="165" dumpComplete="false">
2 <entities>
3 ....
4 <Provider id="3000984" version="0"
5 name="OMBE2 odds" locationId="226" url="http://www.betbrain.com" isBookmaker="true"
6 isBettingExchange="false" bettingCommissionVACs="0.0" isLiveOddsApproved="true"
7 isNewsSource="false" isEnabled="true"/>
8 ...
9 </entities>
10 </InitialData>
12
3 <entities>
4 ...
5 <Participant id="1" version="0" typeId="2"
6 name="Arsenal" countryId="77"/>
7 ...
8 <Participant id="13" version="0" typeId="2"
9 name="Newcastle United FC" countryId="77"/>
10 ...
11 <Participant id="66355" version="4" typeId="1" name="Mesut Ozil"
12 firstName="Mesut" lastName="Ozil" isMale="true" countryId="54"/>
13 ...
14 </entities>
15 </InitialData>
13
8 description="The event has been interrupted after start, will continue later."/>
9 <EventStatus id="3" version="0"
10 name="Ended"
11 description="The event has ended."/>
12 <EventStatus id="2" version="0"
13 name="In Progress"
14 description="The event is in progress."/>
15 <EventStatus id="1" version="0"
16 name="Pending"
17 description="The event has not started yet."/>
18 <EventStatus id="8" version="0"
19 name="Retired"
20 description="The event has been abandoned after start, will not continue.
21 A played has retired."/>
22 <EventStatus id="7" version="0"
23 name="Abandoned"
24 description="The event has been abandoned after start, will not continue."/>
25 <EventStatus id="6" version="0"
26 name="Walkover"
27 description="The event has been canceled before start, will not be played later.
28 A player wins by walkover"/>
29 </entities>
30 </InitialData>
14
13 typeId="1" isComplete="true"
14 sportId="1" parentId="109299123939856384"
15 parentPartId="1"
16 name="Arsenal vs Newcastle United FC" startTime="2021-01-18 20:00:00.000"
17 deleteTimeOffset="172800000"
18 statusId="1" hasLiveStatus="false" rootPartId="2"/>
19 ...
20 </entities>
21 </InitialData>
15
26 lastCollectedTime="2021-01-15 13:26:37.257"/>
27 </entities>
28 </InitialData>
16
15 paramParticipant2MustBeRoot="false"
16 hasParamParticipantId3="false"
17 paramParticipant3MustBePrimary="false"
18 paramParticipant3MustBeRoot="false"
19 hasParamEventPartId1="false"/>
20 ...
21 <OutcomeType id="13" version="2" name="Total Score Over"
22 description="The total score is greater than a certain threshold." hasParamFloat1="true"
23 paramFloat1Description="The threshold." hasParamFloat2="false"
24 hasParamFloat3="false" hasParamBoolean1="false"
25 hasParamString1="false"
26 hasParamParticipantId1="false"
27 paramParticipant1MustBePrimary="false"
28 paramParticipant1MustBeRoot="false"
29 hasParamParticipantId2="false"
30 paramParticipant2MustBePrimary="false"
31 paramParticipant2MustBeRoot="false" hasParamParticipantId3="false"
32 paramParticipant3MustBePrimary="false"
33 paramParticipant3MustBeRoot="false"
34 hasParamEventPartId1="false"
35 hasParamScoringUnitId1="true"/>
36 ...
37 <OutcomeType id="14" version="2" name="Total Score Under"
38 description="The total score is less than a certain threshold."
39 hasParamFloat1="true" paramFloat1Description="The threshold."
40 hasParamFloat2="false" hasParamFloat3="false"
41 hasParamBoolean1="false"
42 hasParamString1="false" hasParamParticipantId1="false"
43 paramParticipant1MustBePrimary="false"
44 paramParticipant1MustBeRoot="false"
45 hasParamParticipantId2="false" paramParticipant2MustBePrimary="false"
46 paramParticipant2MustBeRoot="false" hasParamParticipantId3="false"
47 paramParticipant3MustBePrimary="false" paramParticipant3MustBeRoot="false"
48 hasParamEventPartId1="false" hasParamScoringUnitId1="true"/>
49 ...
50 </entities>
51 </InitialData>
17
21 For example, in horse racing it is possible to bet on the (yet unknown) odds prevailing
22 in the on-course fixed-odds betting market at the time a race begins."/>
23 <BettingOfferStatus id="1"
24 version="0"
25 name="Standard"
26 isAvailable="true"
27 description="The betting offer has odds and is available for betting."/>
28 <BettingOfferStatus id="6"
29 version="0"
30 name="Resolved"
31 isAvailable="false"
32 description="The betting offer is resolved because the associated outcome is resolved."/>
33 </entities>
34 </InitialData>
18
8 <MarketOutcomeRelation id="126682153423603200"
9 version="0" marketId="126682153423602688"
10 outcomeId="125799081678447872"/>
11 ...
12 <MarketOutcomeRelation id="126682153423603456"
13 version="0" marketId="126682153423602688"
14 outcomeId="125799081678448384"/>
15 ...
16 </entities>
17 </InitialData>
19
1 <UpdateData batchId="187319635" batchUuid="52327996529|0"
2 createdTime="2021-01-15 13:30:20.713">
3 <Outcome type="create" id="127067929377546240"
4 version="0" typeId="13"
5 isNegation="false" statusId="1"
6 eventId="125799081630027776"
7 eventPartId="3" paramFloat1="2.5"
8 paramScoringUnitId1="28" name="Over 2.5"/>
9 <Outcome type="create" id="127067929378594816"
10 version="0" typeId="14"
11 isNegation="false" statusId="1"
12 eventId="125799081630027776"
13 eventPartId="3" paramFloat1="2.5"
14 paramScoringUnitId1="28" name="Under 2.5"/>
15 </UpdateData>
20
JSON - SDQL
See XML - SDQL for message documentation.
Subscribe request:
1 {
2 "SubscribeRequest": {
3 "subscriptionSpecificationName": "subscriptionName"
4 }
5 }
Ping Response:
1 {
2 "PingResponse": {
3 "id": "1"
4 }
5 }
Resume:
1 {
2 "UpdateDataResumeSinceRequest": {
3 "subscriptionId": "5e68f56c-b372-4bd9-a14c-88b192640649",
4 "subscriptionSpecificationName": "subscriptionName",
5 "subscriptionChecksum": "23C5004A2D4F904DCBFC014C75821906",
6 "sinceDate": "2024-06-19 12:34:56.789"
7 }
8 }
All message are send without white spaces, we added them in documentation for readability (ie: PingRequest message is :
{"PingRequest":{"id":"1"}} )
Push messages
Subscribe response:
1 {
2 "SubscribeResponse": {
3 "subscriptionChecksum": "23C5004A2D4F904DCBFC014C75821906",
4 "subscriptionId": "5e68f56c-b372-4bd9-a14c-88b192640649"
5 }
6 }
Ping Request:
1 {
2 "PingRequest": {
3 "id": "1"
4 }
21
5 }
Initial Data:
1 {
2 "InitialData": {
3 "dumpComplete": false,
4 "entities": [
5 {
6 "entityClass": "Sport",
7 "name": "Football",
8 "id": "1",
9 "version": 2
10 },
11 {
12 "entityClass": "Sport",
13 "name": "Tennis",
14 "id": "3",
15 "version": 0
16 }
17 ],
18 "batchId": 1,
19 "batchesLeft": "103"
20 }
21 }
Update Data:
1 {
2 "UpdateData": {
3 "changes": [
4 {
5 "lastChangedTime": "Mon Feb 03 10:37:07 GMT 2020",
6 "entityClass": "BettingOffer",
7 "odds": 20,
8 "id": "93182940718131712",
9 "type": "update",
10 "version": 41
11 },
12 {
13 "entityClass": "Source",
14 "id": "93560747352743936",
15 "type": "delete"
16 },
17 {
18 "lastChangedTime": "Mon Feb 03 10: 37:07 GMT 2020",
19 "entityClass": "BettingOffer",
20 "odds": 4.37,
21 "id": "93182940718131968",
22 "type": "update",
23 "version": 41
24 }
25 ],
26 "createdTime": "Mon Feb 03 10:37:07 GMT 2020",
27 "batchId": "1030",
28 "batchUuid": "50112421962|0"
29 }
30 }
22
Unsubscribe Response:
1 {
2 "UnsubscribeResponse": {
3 "code": 0,
4 "message": "Unsubscription was successful."
5 }
6 }
Error message:
1 {
2 "error": {
3 "code": 100,
4 "message": "No subscriptionSpecificationName found for subscriptionId 12345"
5 }
6 }
Pull messages
GetNextInitialDataResponse:
1 {
2 "GetNextInitialDataResponse": {
3 "InitialData": [
4 {
5 "dumpComplete": false,
6 "entities": [
7 {
8 "entityClass": "Sport",
9 "name": "Football",
10 "id": "1",
11 "version": 2
12 },
13 {
14 "entityClass": "Sport",
15 "name": "Tennis",
16 "id": "3",
17 "version": 0
18 }
19 ],
20 "batchId": 1,
21 "batchesLeft": "103"
22 }
23 ]
24 }
25 }
GetNextUpdateDataResponse:
1 {
2 "GetNextUpdateDataResponse": {
3 "UpdateData": [
4 {
5 "changes": [
6 {
7 "lastCollectedTime": "2020-02-03 12:37:07.000",
8 "entityClass": "Source",
9 "providerId": "3000000",
23
10 "collectorId": "123",
11 "id": "123456789",
12 "type": "create",
13 "version": 0
14 },
15 {
16 "entityClass": "BettingOffer",
17 "id": "93182940718131968",
18 "type": "update",
19 "version": "41"
20 },
21 {
22 "entityClass": "Source",
23 "id": "93560747352743936",
24 "type": "delete"
25 }
26 ],
27 "createdTime": "2020-02-03 12:37:07.000",
28 "batchId": "1030",
29 "batchUuid": "50112421962|0"
30 },
31 {
32 "changes": [
33 {
34 "entityClass": "BettingOffer",
35 "id": "93182940718131968",
36 "type": "delete"
37 }
38 ],
39 "createdTime": "2020-02-03 12:37:08.000",
40 "batchId": "1031",
41 "batchUuid": "50112421963|0"
42 }
43 ]
44 }
45 }
24
Client-Server Communication
Pull and Push Subscriptions
A client can communicate with the server in two ways: Pull and Push.
In Pull mode, the client initiates the communication and then, it keeps asking the server for updates. In Pull mode, the clients connect using HTTP.
In Push mode, the client initiates the communication and then, the server keeps pushing the updates to the client. In Push mode, the clients connect using TCP/IP
sockets.
Here is the Access Matrix:
You can find more details on these two types of subscriptions in the following sections: Push Subscription and Pull Subscription.
25
Pull Subscription
An easy-to-use alternative to sockets is to access the Sports Engine using HTTP GET requests. Simple URLs can be used to invoke the following actions: subscribe,
get-next-initial-data, get-next-update-data and unsubscribe. Please note that all the Sports Engine responses will be compressed using the GZIP algorithm.
SDQL constructs exchanged between Sports Engine and Client are depicted in the use case below.
Use Case: Normal Flow
1. Client sends to Sports Engine a subscribe-request.
2. Sports Engine sends to Client a subscribe-response.
3. Client sends to Sports Engine a get-next-initial-data-request.
4. Sports Engine sends to Client a get-next-initial-data-response.
5. Repeat steps 3 and 4 until the initial data dump is over.
6. Client sends to Sports Engine a get-next-update-data-request.
7. Sports Engine sends to Client a get-next-update-data-response.
8. Repeat steps 6 and 7 until Client sends an unsubscribe-request.
Here is an example: using HTTP GET requests, the Normal Flow looks like:
1. Client sends a subscribe-request:
XML: http://server:8081/xmlfeed?requestType=SubscribeRequest&subscriptionSpecificationName=test
JSON: http://server:8081/jsonfeed?requestType=SubscribeRequest&subscriptionSpecificationName=test
2. Sports Engine sends to Client a subscribe-response construct from which the client gets the subscriptionId. Let's suppose that the subscriptionId = 12.
See XML - SDQL or JSON - SDQL for the responses format.
3. Client sends a get-next-initial-data-request:
XML: http://server:8081/xmlfeed?requestType=GetNextInitialDataRequest&subscriptionId=12
JSON: http://server:8081/jsonfeed?requestType=GetNextInitialDataRequest&subscriptionId=12
4. Sports Engine sends to Client the first batch from the initial data dump. One of the attributes is dumpComplete.
5. If dumpComplete=false, Client repeats from step 3. If dumpComplete=true , it means that Client got the whole initial data dump and moves on to step 6.
6. Client sends to Sports Engine a get-next-update-data-request SDQL construct:
XML: http://server:8081/xmlfeed?requestType=GetNextUpdateDataRequest&subscriptionId=12
JSON: http://server:8081/jsonfeed?requestType=GetNextUpdateDataRequest&subscriptionId=12
7. Sports Engine sends to Client a get-next-update-data-response SDQL construct.
8. Steps 6 and 7 repeats until client unsubscribes:
XML: http://server:8081/xmlfeed?requestType=UnsubscribeRequest&subscriptionSpecificationName=test&subscriptionId=12
JSON: http://server:8081/jsonfeed?requestType=UnsubscribeRequest&subscriptionSpecificationName=test&subscriptionId=12
Usage restrictions
1. Client is allowed to send no more than 1 subscribe-request per hour for each active subscription.
2. Client is allowed to send no more than 24 subscribe-request per 24 hours no matter how many subscriptions he has.
3. Client is allowed to send no more than 1 get-next-update-data-request per 30 seconds for each active subscription.
4. Client must send at least 1 get-next-update-data-request every 5 minutes, otherwise the subscription times out.
26
Push Subscription
When subscribing to the Sports Engine in push mode, the client opens a TCP/IP connection to the Sports Engine.
To choose between XML - SDQL and JSON - SDQL, all you have to do is send the subscribe-request message in the chosen format and the server will respond with
the same format.
SDQL constructs exchanged between Sports Engine and Client are depicted in the use case below.
Use Case: Normal Flow
1. Client sends to Sports Engine a subscribe-request SDQL construct.
2. Sports Engine sends to Client a subscribe-response SDQL construct.
3. Sports Engine keeps sending to Client initial-data SDQL constructs until the initial data dump is over.
4. Sports Engine keeps sending to Client update-data SDQL constructs until Client sends an unsubscribe-request or the Client closes the connection.
Use case: Network connection is broken for a few minutes between client and SportsEngine
1. Client disconnects
2. After a few minutes network connection is reestablished
3. Client sends to Sports Engine an update-data-resume-request SDQL construct to get the updates missed during the outage
4. Sports Engine sends to Client the missing update-data SDQL constructs and after them the new update-data SDQL constructs
At this time SportsEngine is able to give the missing updates for about 30 minutes. This limit might change in the future.
Client is allowed 5 minutes to read all missing updates, otherwise it is disconnected. Client may try again to resume the subscription.
If the client remains disconnected for long time or if the update-data-resume-request returns error code 400 (cannot return missing updates), the client must do a new
subscribe-request.
To verify that the TCP/IP connection between the client and the Sports Engine is still valid, Sports Engine regularly sends ping-request SDQL constructs to which the
client must answer with ping-response SDQL constructs. If ping-response SDQL constructs are not received by the Sports Engine in a certain time, the Sports Engine
will close the connection. The exact time after which the Sports Engine will close the connection is client dependent, the default is set to 1 minute.
Usage restrictions
Client must send ping-response SDQL constructs, otherwise the subscription will time out.
Client is allowed to send no more than 24 subscribe-request SDQL constructs per 24 hours no matter how many subscriptions he has.
Client is allowed to send no more than 1 subscribe-request SDQL construct per corresponding time threshold for each active subscription.
SubscribeRequest thresholds (minutes) are [1, 2, 5, 10, 15, 30, your_threshold*] since the last successful SubscribeRequest. The current threshold will be
reset after your_threshold* time passed since last successful SubscribeRequest.
Example: 1st request - 1 minute, 2nd request - 2 minutes, 3rd request - 5 minutes, etc.
Implementation pseudocode
27
6. Write on the socket a zero byte (a byte whose value is 0)
7. Write on the socket the gzipped message
The example below shows how to read a SDQL construct from the server.
return readFromPushStream(gzipis); //Get the SDQL construct by parsing the XML represented by the gzipped bytes
}
The example below shows how to send a SDQL construct to the server.
public static void writePDU(OutputStream os, SDQLConstruct sdqlConstruct) throws IOException, XMLStreamException {
os.write(sqdlConstructLengthBytes);
os.write(0);
os.write(sqdlConstructAsGzippedBytes);
os.flush();
}
28
Sports Model Entities
Welcome to the Sports Model Entities
The Sports Model is OddsMatrix's domain model for the sports domain. It details and defines all important sports concepts, such as events, participants, outcomes,
and bets.
The goal and purpose of the Sports Model is to model (i.e. express) all concepts relevant to the sports domain, both those existing now and those that will be
introduced in the future.
This flexibility and extendability is achieved by explicitly modelling only the primary concepts (e.g. Event and Participant) and their relationships (e.g. EventParticipant),
and then model their sub-concepts (e.g. matches and leagues) as data (of e.g. an EventType) rather than as their own explicitly modelled concepts.
The Sports Model described here is a conceptual one, although special effort has been taken to ensure that it transforms easily into a database design. Therefore, it
closely resembles an Entity/Relation (E/R) diagram.
For further reading, see the individual diagrams for Event, Participant, Outcome, Betting, etc. With each diagram, start with the main entity type (e.g. the Event entity
type in the Event diagram) and work your way "outwards" to associated entity types.
Enjoy!
Sample database
Check out database sample for reference. To keep small size, it contains few Football, Tennis and Basketball events and related data only.
Disclaimer:
1. It is intended to be a starting point in feed integration. While we aim to keep it updated, please check if db schema is compatible to the actual data you receive.
2. There are no foreign keys defined, because we validate model consistency at application level. Feel free to add them in case you need them.
3. There are no indexes defined, feel free to add them according to your use-cases.
db_sample.zip
29
Event
1. Diagram
2. Classifiers
2.1 Class Event
Represents a real-world sports event.
Each event has a type that determines its properties.
When splitting an event into sub-events (or event parts), we can choose to model these sub-events either as events or as event parts. We use the following
guidelines:
* Model as an event if the sub-event is normally regarded as its own event, e.g. matches within a league.
* Model as an event part if the sub-event is a part of a (fixed) structural breakdown of the (parent) event, e.g. a set within a tennis match.
The concept of rounds (primarily for use with leagues) is modelled as round event parts. See EventPart for more details.
30
2.1.1 Event attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version
by 1.
isComplete(boolean) True if the event is structurally complete, and false otherwise. It cannot be null. An event is
structurally complete if all relevant EventParticipantRelation entities exist, and false otherwise.
templateId(Long) A reference to the event template, or null if none, unknown or not applicable.
categoryId(Long) A reference to the event category, or null if none, unknown or not applicable.
promotionId(Long) A reference to the event to which participants of this event may promote, or null if unknown or
not applicable. This is normally used with promotion (and relegation) within league systems.
For example, within the English football league system the "Football League One" (level 3)
promotes to "Football League Championship" (level 2) which promotes to "Premier League"
(level 1).
The promotionId can be used to e.g. order league systems into a tree structure for improved
user navigation.
parentId(Long,readOnly) A reference to the parent of this event, or null if none, unknown or not applicable. For example:
If a match is part of a cup, then the cup will be the parent of the match.
parentPartId(Long) A reference into the parent's event part hierarchy at which this event takes/took place, or null if
none, unknown, or not applicable.
For example, if a match takes/took place within "Round 13" of a league, then the parentPart will
refer to "Round 13".
name(String) The name of the event. Can be null. Its maximum length is 255 characters. For matches, the
name will be null, as it can (and should) be automatically inferred from the home/away
participant names.
shortCode(String) Alpha numerical ID, as short as possible, up to 5-6 characters, assigned to this event. Can be
null. Two events cannot have the same (not-null) shortCode at the same time. After event is
deleted, its short code will be assigned to other event later on.
startTime(Date) The planned start time (in GMT) of the event, or null if unknown or not applicable.
endTime(Date) The planned end time (in GMT) of the event, or null if unknown or not applicable.
deleteTimeOffset(long) Specifies the number of milliseconds after event end (according to the statusId property) that
this event can be safely deleted (or moved to history). Cannot be null. Must be 0 or greater.
There are two primary use cases for having deleteTimeOffset > 0:
1) Results. Adding event results (after event end) requires that the event outcomes are still
present in the system, or can still be created. This requires that the event itself is still present in
the system.
2) Event creation. Many events (e.g. tournaments) are seasonal and quite similar from one
season to another. To make event creation is easy (e.g. by copy'n'paste) we want to keep old
events in the system until their newer counterparts have been created.
venueId(Long) A reference to the venue (Location entity) at which the event takes place, or null if unknown or
not applicable.
If the event takes place a several venues, then the event venue is the smallest aggregate
venue. For example: The "English Premiership 2008/2009" league will take place in England.
hasLiveStatus(boolean) True if the event status is (or will be) updated live, and false if not. Cannot be null. The event
status is represented by the statusId and currentPartId properties.
rootPartId(long,readOnly) A reference to the root event part that describes the (fixed) part structure of this event. Cannot
be null. A default "empty" root event part hierarchy will be provided. Events with an unknown
event part hierarchy can then reference to this.
The rootPartId must be determined at event creation time. The creator can determine the
rootPart in three ways:
(1) Use the rootPartId property of an associated event template (if any).
(2) Use EventPartDefaultUsage.
(3) Custom, i.e. use whatever.
currentPartId(Long) Refers to the part within the rootPart that is the current part. Is null if the event is not currently
taking place, or if the exact current part is not known.
31
Name Description
For example, for the "Champions League 2008/2009" event, the currentPart can be "Group
Phase", "Knockout 1/8", etc.
For example, for a football match, the currentPart can be "First Half", "Second Half", etc.
url(String) A URL associated with the event, or null if none or unknown. If not null then url must be a valid
URL. Its maximum length is 255 characters.
popularity(Integer) A measure of the popularity of this event, or null if unknown. The value (if any) will be zero or
greater. The higher the number the more popular the event is.
The popularity measure is entirely BetBrain-specific and is used to order events for improved
user navigation. It is primarily used to order league systems (within a given sport and country),
and to order leagues that promote to the same league (i.e. have the same promotionId).
note(String) An internal-use-only note. May be null. The maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the event type, for example "League" or "Match". It cannot be null or empty, and is unique among event types. The maximum
length is 255 characters.
description(String) A description of the event type, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
minPrimaryParticipantTimeBetweenEvents(Long) The minimum time (in milliseconds) between events (of same sport and event type) that share a primary
participant. Must be 0 or greater, or null if no limit.
minEventDuration(long) The primary concept here is the Event, which models a real-world event. Through the use of the generic
EventType, we can model any type of event.
maxEventDuration(long) The maximum event duration (in milliseconds). Must be greater than or equal to minEventDuration.
Cannot be null.
32
It is specific to the event type how the restrictions are interpreted in regards to sub-events. The normal interpretation, however, is as follows: A participant in a sub-
event must satisfy the first constraint meet on the path of events from the sub-event to the (root) super event.
The tuple (eventId, participantTypeId) must be unique.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the
entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
33
Name Description
parentParticipantId(Long) A reference to the parent participant of this
participant, or null if none. This property is
typically used with team players.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be
null.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity
will increment the version by 1.
description(String) A description of this status. May be null. The maximum length is 255
characters.
34
The properties contain the current values. These will be copied as needed to the event instances as they are created. Therefore, event template properties can
change without affecting the history of event instances.
The tuple (name, eventTypeId, sportId) must be unique among event templates.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
name(String) The name of the event class. It cannot be null or empty. Its
maximum length is 255 characters.
url(String) A url, or null if none. If not null then it must be a valid URL.
Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this
entity. Cannot be null.
note(String) An internal-use-only
note. May be null. The
maximum length is 255
characters.
35
2. Lookup rootPartId by {eventTypeId, sportId}. There must always be a hit here.
If parentEventId is null then eventTypeId and sportId must both be non-null. And if parentEventId is not null then sportId and eventTypeId must both be null.
The tuples {parentEventId} and {eventTypeId, sportId) must be unique.
Name Description
id(long,readOnly) The unique id of this entity.
Cannot be null.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will
increment the version by 1.
name(String) The name of the event part, e.g. "First Half". The name cannot be null or
empty. Its maximum length is 255 characters.
description(String) A description of this event part. May be null. The maximum length is 255
characters.
parentId(Long,readOnly) A reference to the parent event part, or null if none. Will be null only for root
event parts.
36
Name Description
orderNum(int) A sequential number used to time-order event parts with the same parent.
Cannot be null. For example, the orderNum of "First Half" can be 1 while the
orderNum of "Second Half" can be 2. This indicates that "Second Half"
comes after "First Half".
isDrawPossible(Boolean,readOnly) True if the event part can end in a draw, false if the event part cannot end in
a draw, or null otherwise.
Name Description
id(long,readOnly) The unique id of this
entity. Cannot be
null.
eventTypeId(long,readOnly) A reference to an
event type. Cannot
be null.
sportId(long,readOnly) A reference to a
sport. Cannot be
null.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the
entity will increment the version by 1.
channel(String, readOnly) The channel where the streaming provider broadcasts the
event. Cannot be null.
The channel may be used with StreamingProvider.urlTemplate
to find out streaming URL
Example: channel="pro_cast2",
StreamingProvider.urlTemplate="https://www.twitch.tv/{channel}"
=> streaming URL="https://www.twitch.tv/pro_cast2"
37
2.15.1 StreamingProvider attributes
Name Description
id(long,readOnly) The unique id of this entity.
Cannot be null.
38
Participant
1 Diagram
2 Classifiers
2.1 Class Participant
Represents a real-world participant.
The term participant should be understood broadly and includes any (real-world) entity that can (theoretically) participate in an event.
A participant's properties, and the semantics thereof, is determined by the participant type.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the participant. It is not null and non-empty, and its maximum length is 255 characters.
firstName(String) The first name of the participant, including middle-names (if any). It is null if unknown or not applicable. If it is not null, then
it is non-empty and its maximum length is 255 characters.
lastName(String) The last name of the participant. It is null if unknown or not applicable. If it is not null, then it is non-empty and its
maximum length is 255 characters.
shortName(String) The shortened/abbreviated/commonly used name of the participant (if any). If it is not null, then it is non-empty and its
maximum length is 255 characters.
isMale(Boolean) Indicates the gender of the participant: True if male, false if female, and null if unknown or not applicable.
birthTime(Date) The time of birth for this participant, or null if unknown or not applicable.
countryId(Long) A reference to the location (which must be a country) that is the nationality of this participant. It is null if unknown or not
applicable.
It is also null if the participant has a multiple nationality. [Design note: In time we'll need to represent this in its own
relational table.]
url(String) A URL associated with the participant, or null if none or unknown. If not null then url must be a valid URL. Its maximum
39
Name Description
length is 255 characters.
logoURL(String) An URL of the participant logo/crest, or null if none or unknown. If not null then url must be a valid URL. Its maximum
length is 255 characters.
retirementTime(Date) The time of retirement (in GMT) for this participant, or null if not retried, unknown, or not applicable.
Aside from its direct information value, this property is useful in determining which participants are "current" and which can
be moved to the history.
lastEventParticipationTime(Date) Indicates when the participant last participated in an event, or null if currently participating in an event.
[not published to clients]
note(String) An internal-use-only note. May be null. The maximum length is 255 characters.
Name Desciption
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
participantRoleId(long) A reference to a role that the participant plays/played in the event. Cannot be null.
Note that every participant plays at least one role in an event. However, this role may not be known (to us). If so, then a more
general/abstract role must be chosen.
parentParticipantId(Long) A reference to the parent participant of this participant, or null if none. This property is typically used with team players.
40
2.4 Class ParticipantRole
A ParticipantRole defines a specific role that a Participant can "play" (or have/had) in an event.
[Design note: We do not currently organize participant roles in a hierarchical manner, e.g. "Player" is a parent of "Attacker". We can add this later, if needed, using a
parentId property or by adding a ParticipantRoleRelation entity type.]
Examples : Home, Away, Attacker, Player, Midfielder, Defender, Keeper, Substitute, Referee, Coach
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the role. It is not null and not empty, and it must be unique among participant roles.
description(String) A description of the participant role, or null if none. Its maximum length is 255 characters.
isPrimary(boolean,readOnly) True if this role is a primary (in-game) role, and false otherwise. Cannot be null.
Participants that participate in an event in a primary role constitute that event's primary (i.e. actual and in-game) participants.
For example, "Attacker" and "Player" are primary roles, while "Coach" and "Referee" are not.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the participant type. It cannot be null or empty, and it must be unique among participant types.
description(String) A description of the participant type, or null if none. Its maximum length is 255 characters.
isIndividual(boolean,readOnly) True if participants of this type are individuals, and false if not.
hasName(Boolean,readOnly) True if the participant's name property will be non-null, false if null, and null if either null or non-null.
hasFirstName(Boolean,readOnly) True if the participant's firstName property will be non-null, false if null, and null if either null or non-null.
hasLastName(Boolean,readOnly) True if the participant's lastName property will be non-null, false if null, and null if either null or non-null.
hasIsMale(Boolean,readOnly) True if the participant's isMale property will be non-null, false if null, and null if either null or non-null.
hasBirthTime(Boolean,readOnly) True if the participant's birthTime property will be non-null, false if null, and null if either null or non-null.
hasNationalityId(Boolean,readOnly) True if the participant's nationalityId property will be non-null, false if null, and null if either null or non-null.
hasRetirementTime(Boolean,readOnly) True if the participant's retirementTime property will be non-null, false if null, and null if either null or non-null.
41
2.7 Class ParticipantRelation
Defines a relationship between two participants, including the associated roles, in a certain time period.
The nature of the relationship is defined by the relation type.
All relations are unidirectional. However, depending on type, some reversals may hold semantic meaning, for example the reverse of "Owns" is "Owned By".
The primary use of the ParticipantRelation is to express player-team relations, along with the role(s) that the player have in the team.
The tuple (typeId, fromParticipantId, toParticipantId, paramParticipantRoleId) must be unique within the same time period.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
startTime(Date) The start of the time period of the relation, or null if unknown or "always applied in past".
endTime(Date) The end of the time period of the relation, or null if unknown or "always applies in future".
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the relation type. The name cannot be null or empty, and it must be unique among participant
relation types. Its maximum length is 255 characters.
description(String) A description of the participant relation type, or null if none. Its maximum length is 255 characters.
hasParamParticipantRoleId(Boolean,readOnly) True if the participant relation's paramParticipantRoleId property will be non-null, false if null, and null if either
null or non-null.
paramParticipantRoleIdDescription(String) A description of the paramParticipantRoleId property, or null if none. Its maximum length is 255 characters.
42
Stats And Scores
1. Diagram
2. Classifiers
2.1 Class Event
Represents a real-world sports event. See Event.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
eventId(long,readOnly) A reference to the event in which the action occurs. Cannot be null.
providerId(long,readOnly) A reference to the provider (source) that originally created this action. Cannot be null.
paramFloat1(Float,readOnly) A generic parameter slot whose value and semantics is determined by the event action type.
paramParticipantId1(Long,readOnly) A generic parameter slot whose value and semantics is determined by the event action type. If not null then it is a
reference to a participant.
43
Name Description
paramParticipantId2(Long,readOnly) A generic parameter slot whose value and semantics is determined by the event action type. If not null then it is a
reference to a participant.
isManuallySet(boolean) True if the event action was created/updated manually or false otherwise.
Published to internal clients only.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the status. Cannot be null or empty, and must be unique among all statuses. Its maximum length is 255
characters.
isAvailable(boolean,readOnly) True if the associated event action is available, and false otherwise. Cannot be null.
description(String) A description of this status. May be null. The maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the type. The name cannot be null or empty, and it must be unique among types. Its maximum
length is 255 characters.
description(String) A description of the event action type, or null if none. Its maximum length is 255 characters.
hasParamFloat1(Boolean,readOnly) True if the event action's paramFloat1 property will be non-null, false if null, and null if either null or non-null.
paramFloat1Description(String) A description of the paramFloat1 property, or null if none. Its maximum length is 255 characters.
hasParamParticipantId1(Boolean,readOnly) True if the event action's paramParticipantId1 property will be non-null, false if null, and null if either null or non-
null.
paramParticipantId1Description(String) A description of the paramParticipantId1 property, or null if none. Its maximum length is 255 characters.
hasParamParticipantId2(Boolean,readOnly) True if the event action's paramParticipantId2 property will be non-null, false if null, and null if either null or non-
null.
paramParticipantId2Description(String) A description of the paramParticipantId2 property, or null if none. Its maximum length is 255 characters.
44
2.5.1 EventActionTypeUsage attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
paramFloat1(Float) A generic parameter slot whose value and semantics is determined by the event action detail type.
paramFloat2(Float) A generic parameter slot whose value and semantics is determined by the event action detail type.
paramParticipantId1(Long) A generic parameter slot whose value and semantics is determined by the event action detail type. If not null then it is a reference
to a participant.
paramString1(String) A generic parameter slot whose value and semantics is determined by the event action detail type.
paramBoolean1(Boolean) A generic parameter slot whose value and semantics is determined by the event action detail type.
isManuallySet(boolean) True if the event action detail was created/updated manually or false otherwise.
Published to internal clients only.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the status. Cannot be null or empty, and must be unique among all statuses. Its maximum length is 255
characters.
isAvailable(boolean,readOnly) True if the associated event action detail is available, and false otherwise. Cannot be null.
description(String) A description of this status. May be null. The maximum length is 255 characters.
45
* Scoring Method (by string1)
* Assist (by participant1)
* Timer (by float1)
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the event action detail type. Cannot be null or empty, and must be unique among all event action
detail types. Its maximum length is 255 characters.
description(String) A description of the event action detail type, or null if none. Its maximum length is 255 characters.
hasParamFloat1(Boolean,readOnly) True if the event action detail's paramFloat1 property will be non-null, false if null, and null if either null or non-
null.
paramFloat1Description(String) A description of the paramFloat1 property, or null if none. Its maximum length is 255 characters.
hasParamFloat2(Boolean,readOnly) True if the event action detail's paramFloat2 property will be non-null, false if null, and null if either null or non-
null.
paramFloat2Description(String) A description of the paramFloat2 property, or null if none. Its maximum length is 255 characters.
hasParamParticipantId1(Boolean,readOnly) True if the event action detail's paramParticipantId1 property will be non-null, false if null, and null if either null
or non-null.
paramParticipantId1Description(String) A description of the paramParticipantId1 property, or null if none. Its maximum length is 255 characters.
hasParamString1(Boolean,readOnly) True if the event action detail's paramString1 property will be non-null, false if null, and null if either null or non-
null.
paramString1Description(String) A description of the paramString1 property, or null if none. Its maximum length is 255 characters.
paramString1PossibleValues(String,readOnly) Contains the possible (non-null) values of the event action detail's paramString1 property. The values are listed
in CSV format. Whether null is a possible value is determined by the hasParamString1 property.
hasParamBoolean1(Boolean,readOnly) True if the event action detail's paramBoolean1 property will be non-null, false if null, and null if either null or
non-null.
paramBoolean1Description(String) A description of the paramBoolean1 property, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
46
Name Description
statusId(long) A reference to the status. Cannot be null.
paramFloat1(Float) A generic parameter slot whose value and semantics is determined by the event info type.
paramFloat2(Float) A generic parameter slot whose value and semantics is determined by the event info type.
paramParticipantId1(Long) A generic parameter slot whose value and semantics is determined by the event info type. If not null then it is a reference
to a participant.
paramParticipantId2(Long) A generic parameter slot whose value and semantics is determined by the event info type. If not null then it is a reference
to a participant.
paramEventPartId1(Long) A generic parameter slot whose value and semantics is determined by the event info type. If not null then it is a reference
to an event part.
paramString1(String) A generic parameter slot whose value and semantics is determined by the event info type.
paramBoolean1(Boolean) A generic parameter slot whose value and semantics is determined by the event info type.
paramEventStatusId1(Long) A generic parameter slot whose value and semantics is determined by the event info type. If not null then it is a reference
to an event status.
paramTime1(Date) A generic parameter slot whose value and semantics is determined by the event info type.
isManuallySet(boolean) True if the event info was created/updated manually or false otherwise.
Published to internal clients only.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the status. Cannot be null or empty, and must be unique among all statuses. Its maximum length is 255
characters.
isAvailable(boolean,readOnly) True if the associated event info is available, and false otherwise. Cannot be null.
description(String) A description of this status. May be null. The maximum length is 255 characters.
47
2.12.1 EventInfoType attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the type. The name cannot be null or empty, and it must be unique among types. Its
maximum length is 255 characters.
description(String) A description of this type. May be null. The maximum length is 255 characters.
hasParamFloat1(Boolean,readOnly) True if the event info's paramFloat1 property will be non-null, false if null, and null if either null or non-
null.
paramFloat1Description(String) A description of the paramFloat1 property, or null if none. Its maximum length is 255 characters.
hasParamFloat2(Boolean,readOnly) True if the event info's paramFloat2 property will be non-null, false if null, and null if either null or non-
null.
paramFloat2Description(String) A description of the paramFloat2 property, or null if none. Its maximum length is 255 characters.
hasParamParticipantId1(Boolean,readOnly) True if the event info's paramParticipantId1 property will be non-null, false if null, and null if either null
or non-null.
paramParticipantId1Description(String) A description of the paramParticipantId1 property, or null if none. Its maximum length is 255
characters.
hasParamParticipantId2(Boolean,readOnly) True if the event info's paramParticipantId2 property will be non-null, false if null, and null if either null
or non-null.
paramParticipantId2Description(String) A description of the paramParticipantId2 property, or null if none. Its maximum length is 255
characters.
hasParamEventPartId1(Boolean,readOnly) True if the event info's paramEventPartId1 property will be non-null, false if null, and null if either null
or non-null.
paramEventPartId1Description(String) A description of the paramEventPartId1 property, or null if none. Its maximum length is 255
characters.
hasParamString1(Boolean,readOnly) True if the event info's paramString1 property will be non-null, false if null, and null if either null or
non-null.
paramString1Description(String) A description of the paramString1 property, or null if none. Its maximum length is 255 characters.
paramString1PossibleValues(String,readOnly) Contains the possible (non-null) values of the event info's paramString1 property. The values are
listed in CSV format. Whether null is a possible value is determined by the hasParamString1
property.
hasParamBoolean1(Boolean,readOnly) True if the event info's paramBoolean1 property will be non-null, false if null, and null if either null or
non-null.
paramBoolean1Description(String) A description of the paramBoolean1 property, or null if none. Its maximum length is 255 characters.
hasParamEventStatusId1(Boolean,readOnly) True if the event info's paramEventStatusId1 property will be non-null, false if null, and null if either
null or non-null.
paramEventStatusId1Description(String) A description of the paramEventStatusId1 property, or null if none. Its maximum length is 255
characters.
hasParamTime1(Boolean,readOnly) True if the event info's paramTime1 property will be non-null, false if null, and null if either null or non-
null.
paramTime1Description(String) A description of the paramTime1 property, or null if none. Its maximum length is 255 characters.
paramParticipantIdsMustBeOrdered(boolean,readOnly) Specifies if the event info's paramParticipantId1 and paramParticipantId2 properties must be
ascending ordered. It can be true only if hasParamParticipantId1 and hasParamParticipantId2 are
true.
hasParamScoringUnitId1(boolean,readOnly) True if the event info's paramScoringUnitId1 property will be non-null, false if null, and null if either
null or non-null.
paramScoringUnitId1Description(String) A description of the paramScoringUnitId1 property, or null if none. Its maximum length is 255
characters.
48
2.13.1 EventInfoTypeUsage attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
isManuallySet(boolean) True if the event participant info was created/updated manually or false otherwise.
Published to internal clients only.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the status. Cannot be null or empty, and must be unique among all statuses. Its maximum length is 255
characters.
isAvailable(boolean,readOnly) True if the associated event participant info is available, and false otherwise. Cannot be null.
description(String) A description of this status. May be null. The maximum length is 255 characters.
49
2.16.1 EventParticipantInfoType attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the type. The name cannot be null or empty, and it must be unique among types. Its maximum length is 255 characters.
description(String) A description of this type. May be null. The maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
paramFloat1(Float) A generic parameter slot whose value and semantics is determined by the event participant info detail type.
paramParticipantId1(Long) A generic parameter slot whose value and semantics is determined by the event participant info detail type. If not null
then it is a reference to a participant.
paramBoolean1(Boolean) A generic parameter slot whose value and semantics is determined by the event participant info detail type.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the status. Cannot be null or empty, and must be unique among all statuses. Its maximum length is 255
characters.
50
isAvailable(boolean,readOnly) True if the associated event participant info detail is available, and false otherwise. Cannot be null.
description(String) A description of this status. May be null. The maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the type. The name cannot be null or empty, and it must be unique among types. Its maximum
length is 255 characters.
description(String) A description of this type. May be null. The maximum length is 255 characters.
hasParamFloat1(Boolean,readOnly) True if the event participant info detail's paramFloat1 property will be non-null, false if null, and null if either null or
non-null.
paramFloat1Description(String) A description of the paramFloat1 property, or null if none. Its maximum length is 255 characters.
hasParamParticipantId1(Boolean,readOnly) True if the event participant info detail's paramParticipantId1 property will be non-null, false if null, and null if either
null or non-null.
paramParticipantId1Description(String) A description of the paramParticipantId1 property, or null if none. Its maximum length is 255 characters.
hasParamBoolean1(Boolean,readOnly) True if the event participant info detail's paramBoolean1 property will be non-null, false if null, and null if either null
or non-null.
paramBoolean1Description(String) A description of the paramBoolean1 property, or null if none. Its maximum length is 255 characters.
hasParamString1(Boolean,readOnly) True if the event participant info detail's paramString1 property will be non-null, false if null, and null if either null
or non-null.
paramString1Description(String) A description of the paramString1 property, or null if none. Its maximum length is 255 characters.
paramString1PossibleValues(String) Contains the possible (non-null) values of the participant info detail's paramString1 property. The values are listed
in CSV format. Whether null is a possible value is determined by the hasParamString1 property.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
51
2.22.1 ScoringUnit attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the scoring unit. The name cannot be null or empty, and it must be unique among types. Its maximum length is 255
characters.
description(String) A description of this scoring unit. May be null. The maximum length is 255 characters.
52
Event Info Types
Id Name
1 Score
2 Yellow Cards
3 Yellow-Red
Cards
4 Red Cards
5 Free kicks
6 Offsides
7 Goal Kicks
8 Throw-ins
9 Corners
10 Penalty Kicks
11 Suspensions
12 Substitutions
13 Penalty Kicks
Missed
14 Penalty Kicks
Scored
15 Points Won
16 Drives
17 Passes
18 Turnovers
19 Coach
Challenges
20 One-Point
Conversions
21 Two-Points
Conversions
22 Touchdowns
23 Safeties
24 Field Goals
26 Penalties Total
Time
27 Penalty Shots
28 Two Minutes
Penalties
29 Two-Plus-Two Minutes
Penalties
30 Five Minutes
Penalties
31 Active Penalties
33 Race To 5 Points
Score
34 Race To 10 Points
Score
35 Race To 15 Points
Score
53
Id Name
36 Race To 20 Points
Score
37 Serve
38 Game Points
39 Set Points
40 Possession
41 Assists
42 Fouls
43 Free Throws
Missed
44 Free Throws
Scored
45 Free Throws
Pending
46 Free Throws
Awarded
47 Rebounds
48 Three Pointers
49 Two Pointers
51 Number of event
parts
53 Aces
54 Double Faults
55 Breaks
57 Deciding point
rule
59 Surface
60 Number of Points in
Tiebreak
62 Hits
63 Errors
64 Misses
65 Tries
66 Four points
67 Six points
68 Overs
69 Extras
70 Wickets
71 Yards
Distance
72 Active Down
73 Yards To Next
Down
76 Penalty Throw
Missed
77 Penalty Throw
Scored
54
Id Name
78 Games
Won
79 Runs
80 Home
Runs
81 One Runs
83 Two Runs
84 Three Runs
85 One Home
Runs
86 Two Home
Runs
87 Three Home
Runs
88 Grand
Slams
89 Outs
90 Race To 3 Points
Score
91 Minutes per
quarter
92 Current event
status
94 Coverage
95 Match Time
96 Remaining time in
period
98 Highest
Breaks
100 Shots On
Target
102 Possession
Percentage
110 Goals
111 Behinds
112 180s
55
Id Name
118 Team
Declared
119 Number Of
Runners
127 Number Of
Rounds
139 Frags
140 Towers
141 Barracks
142 Aegis
144 Kills
145 Inhibitors
146 Dragons
147 Barons
149 Gold
151 Decision
153 Dangerball
154 Roshans
160 Bomb
Planted
162 Wides
163 Boundaries
165 Penalties
Taken
166 Penalties
Converted
167 Rushing
Yards
168 Sacks
170 Checkouts
171 Centuries
173 Service
Breaks
174 Headshots
175 Damage
56
Id Name
177 Attempted Field
Goals
178 Blocks
181 Steals
182 Offensive
Rebounds
183 Defensive
Rebounds
193 Punts
194 Rushing
Touchdowns
195 Passing
Touchdowns
196 Turnover
Touchdowns
197 Interceptions
Thrown
203 Dangerball 2
204 Chosen
Round
57
Event Actions Types and Details Types
Event Action Types
Id Name
7 Goal
Scored
8 Yellow Card
Shown
9 Yellow-Red Card
Shown
10 Red Card
Shown
11 Substitution
12 Penalty Kick
Awarded
13 Penalty Kick
Missed
14 Corner Kick
15 Drive
16 Touchdown
Scored
18 Extra Point
Scored
19 Field Goal
Scored
20 Safety
Scored
21 Point Scored
22 Timeout
23 Game
Point
24 Set Point
25 Two Points
Scored
26 Three Points
Scored
27 Free Throw
Scored
28 Free Throw
Missed
29 Game
Won
30 Tie-break
Won
31 Set Won
32 Point Won
33 Suspension
34 Try Scored
35 Conversion
Scored
58
Id Name
36 Drop Goal
Scored
37 Exclusion
38 Penalty Throw
Awarded
39 Penalty Throw
Scored
40 Penalty Throw
Missed
41 Penalty Round
Kick
44 Race to X
Points
45 End Of
Over
46 Race to X
Frames
47 Race to X
Games
48 Race to X
Goals
49 Baron Slain
50 Dragon Slain
51 Roshan
Slain
52 Tower
Destroyed
53 Worker Killed
54 Barrack
Destroyed
55 Inhibitor
Destroyed
57 Kill
58 Power-up Rune
Spawned
59 Race to X Kills
60 Race to X
Rounds
61 Round
Won
63 Dragon
Spawned
64 Ball Potted
65 Turnover
Commited
66 180 Scored
67 Foul
Commited
69 Leg Won
70 Match
Ended
71 Jump Ball
Winner
72 Missed Field
Goal
59
Id Name
73 Single
Scored
74 First Basket
Scored
76 First Touchdown
Scored
77 First Points
Scored
Id Name
1 Team
2 Timer
3 Player
4 Drive Result
5 Suspension
Minutes
6 Break
7 Losing
Points
8 Scoring
Method
9 Assist
10 Secondary
Assist
11 Converted
12 First Participant To
X
13 Runs
Scored
14 Wickets
Lost
15 Method Of
Scoring
16 Power-up Rune
Type
17 Victim
18 Headshot
20 Dragon
Type
21 Colour
22 Result
Type
23 Basketball Method Of
Scoring
60
Event Participant Info Types and Detail Types
Event Participant Info Types
Id Name
1 Lineup
2 Performance
4 Batsman Performance
5 Bowler Performance
Id Name
1 Shirt Number
2 Player Team
3 Substitute
4 Finish Position
5 Starting position
6 Points Scored
7 Starting Price
8 Non Runner
9 Number
10 Draw
11 Number of Players
12 Run
13 Balls Faced
14 Fours
15 Sixes
16 Strike Rate
17 Overs
18 Maiden
19 Runs Conceded
20 Wicket
22 Wide
23 No Ball
24 Zeros
25 Economy Rate
27 Form
28 Deaths
29 Kills
30 Assists
31 Level
61
Id Name
32 Hero Healing
33 Hero Damage
34 Gold
35 Worth
36 Tower Damage
37 Rush Yards
38 Passing Yards
39 Rebounds
40 Three Pointers
41 Blocks
42 Steals
44 Field Goals
46 Two Pointers
49 Free Throws
51 Plus/Minus Points
52 Offensive Rebounds
53 Deffensive Rebounds
54 Fouls
55 Turnovers
56 Blocked Shots
57 Blocks Against
58 Technical Fouls
59 Minutes Played
61 Kicking Points
62 Receiving Yards
63 Rushing Attempts
66 Receptions
68 Passing Touchdowns
69 Interceptions
70 Touchdowns
62
Betting
1. Diagram
2. Classifiers
2.1 Class BettingOffer
A betting offer represents an opportunity for a bet between two parties: the odds/bet provider and a better/punter (typically a private person). A betting offer is tied to a
Source from which it is collected.
A betting offer can either back or lay an outcome. A back bet is on the outcome to happen. A lay bet is on the outcome NOT to happen. Hence, a betting offer is a lay
bet if its associated outcome's isNegation property is true, and is a back bet otherwise.
For reasons given below, all betting offers are modelled as back bets. A lay bet is then a back bet on the outcome not to happen. The negation of the outcome lies with
the outcome, not with the betting offer. Thus the back and lay bets on the same (conceptual) outcome will be modelled here as bets on two different outcomes, i.e. the
back outcome and the (negated) lay outcome. Note that the betting offer odds value always holds the back odds, so lay odds will need to be converted. (See the odds
property for more information.)
When finding outcome partitions (and finding e.g. surebets and valuebets), it is much preferred if all betting offers are back bets. We can do this by converting lay bets
to back bets by creating negated outcomes and converting the lay odds to back odds.
For example, in Home-Draw-Away, if we have a back bet on Home, and a lay bet on Home, then we can convert the lay bet to a back bet on one (or both) of the
following two outcomes:
63
(1) "Draw-Away"
(2) Not "Home"
These two outcomes are semantically equivalent.
Note that outcome partitions can then be found without looking at the betting offer, which is how it should be.
In the example above, Home and Not Home will obviously form an outcome partition. This outcome partition will be easily identified because:
(1) The back bet on "Home" will point to "Home" outcome.
(2) The back bet on "Not Home" will point to "Not Home" outcome.
In fact, we can quickly (and generically) find all back/lay-based (in fact: all negation-based) outcome partitions by simply pairing outcomes with their negations. The
following tuple must be unique: (providerId, outcomeId, bettingTypeId, multiplicity, slotNum)
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
sourceId(long) A reference to the source that this betting offer was collected from. Cannot be null.
bettingTypeId(long,readOnly) A reference to the betting type. Cannot be null. This betting type equals the betting type that the betting offer is associated with in
the source.
isLive(Boolean) True if the betting offer is available during a live event. It can only be true if the event is currently in progress or interrupted.
False if the betting offer is not available when the event starts.
Null if the betting offer will be available both before and after the event starts.
When the event is finished (Ended, Cancelled, Abandoned, Retired, Walkover), the IsLive property will not change value.
multiplicity(Integer,readOnly) Represents the multiplicity of the bet. Null if unknown. 0 if single. >0 if the bet requires X more bets (from the same provider) to
be taken in addition to this one. Among several bets, the highest multiplicity constraint must be satisfied.
For example, if a provider lists the following three bets:
Bet 1 with multiplicity 0 (i.e. single)
Bet 2 with multiplicity 1
Bet 3 with multiplicity 2
Bet 4 with multiplicity 1
Then a punter can take Bet 1 alone. If he wants to take Bet 2 (or Bet 4), he must take at least one other bet. If he wants to take
Bet 3, he must take at least two other bets.
The multiple bet is settled as one bet. To win the multiple bet, all the individual (contained) bets must be won, otherwise the
multiple bet is lost. For example, if a multiple bet has a multiplicity of 2, and the bets taken have the odds 1.5, 2.0, 3.5 then - if
the multiple bet is won - the punter gets 1.5 x 2.0 x 3.5 = 10.5 times his money back.
volume(Float) The Volume specifies the amount of money available for winning, or null if not applicable (e.g. with bookmakers). Not null for
betting exchanges. Cannot be negative.
volumeCurrencyId(Long) A reference to the currency of the volume property. Must be null if volume is null. And must be non-null if volume is not null.
couponKey(String) The couponKey is used to generate the betting slip URL. May be null if none or unknown. The process of how the couponKey is
turned into a betting slip URL is considered outside the scope of the Sports Model. Its maximum length is 255 characters.
slotNum(int,readOnly) For use with betting exchanges only where there are three back/lay bets on each outcome, each with separate odds and
amounts. With bookmakers the value is always 1. With betting exchanges it is (normally) 1, 2, or 3. Cannot be null and must be
positive.
lastChangedTime(Date) The time (in GMT) at which one of the following properties was last updated: statusId, odds, multiplicity, volume,
volumeCurrencyId. If none if these properties have ever been updated, then the betting offer creation time is used. The property
is never null.
64
2.2 Class BettingOfferStatus
Provides the status (and availabilty) of a betting offer.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the status. Cannot be null or empty, and must be unique among all statuses. Its maximum length is 255
characters.
isAvailable(boolean,readOnly) True if the associated betting offer is available for betting, and false otherwise. Cannot be null.
description(String) A description of this status. May be null. The maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
collectorId(long,readOnly) A reference to the data source collector. Cannot be null or non-positive. Note that the Sports Model does not contain a Collector
entity. The collectorId is hence a remote reference whose meaning is determined by the creator of the source entity.
sourceKey(String,readOnly) Represents a unique key for this source, such as a (static) XML feed URL. Cannot be null or empty. Its maximum length is 255
characters.
Not published to clients and hence it is null on client's side.
lastCollectedTime(Date) The time (in GMT) at which data was last collected from the source.
lastUpdateTime(Date) The time (in GMT) at which the source was last updated, or null if unknown. Some sources may be updated regularly, e.g. every
minute, rather than on-demand, and make the time of update available for collection. If so, then this property is set to that time.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the provider. Cannot be null or empty. Its maximum length is 255 characters.
locationId(long) A reference to the Location (typically a nation) to which the provider is most closely affiliated. Cannot be null.
url(String) A URL to the provider's web site. Can be null. If not null then the url must be a valid URL. Its maximum length is 255
characters.
isBookmaker(boolean) True if the provider is a bookmaker, and false otherwise. Cannot be null.
isBettingExchange(boolean) True if the provider is a betting exchange, and false otherwise. Cannot be null.
bettingCommissionVACs(float) The commission used internally by the betting VACs. It cannot be null or negative, and is expressed as a percentage. In
practice, most commissions are between 0% (for bookmakers) and 5% (for low-volume punters on betting exchanges).
isEnabled(boolean) True if this provider is enabled (i.e. is active), and false if disabled (i.e. is inactive). Cannot be null.
65
Name Description
note(String) An internal-use-only note. May be null. The maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the betting type. Cannot be null or empty, and must be unique among all betting types. Its maximum length is 255 characters.
description(String) A description of the betting type, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The id of this entity.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity.
Cannot be null.
66
Name Description
Cannot be null.
67
Name Description
settlementRequired(Boolean) Internal only property. True if
we offered OM odds on the
outcome and settlement is
required or false otherwise.
Published to internal clients
only. Null for external clients.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the outcome status. Cannot be null or empty, and must be unique across all outcome statuses. Its maximum length is 255
characters.
description(String) A description of this status. May be null. The maximum length is 255 characters.
Please note that the following outcome statuses are NOT used unless you have settlement included in your subscription.
id name description
2 Did Happen The outcome did happen, i.e. it is an event result.
6 Half Won Half of the wagered sum is multiplied by the quota, the other half is reimbursed.
7 Half Lost Half of the wagered sum is reimbursed, the other half is lost.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
68
* TOTAL SCORE, e.g. number of goals
* TOTAL SCORE IS LESS THAN
* TOTAL SCORE IS LESS THAN OR EQUAL TO
* TOTAL SCORE IS GREATER THAN
* TOTAL SCORE IS GREATER THAN OR EQUAL TO
* TOTAL SCORE BY PLAYER, e.g. number of goals by player
* FIRST TO SCORE, e.g. first goal scorer
* NEXT TO SCORE, e.g. next goal scorer
* LAST TO SCORE, e.g. last goal scorer
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the outcome type. Cannot be null or empty, and must be unique across all outcome types.
Its maximum length is 255 characters.
description(String) A description of the outcome type, or null if none. Its maximum length is 255 characters.
hasParamFloat1(Boolean,readOnly) True if the outcome's paramFloat1 property will be non-null, false if null, and null if either null or non-
null.
paramFloat1Description(String) A description of the paramFloat1 property, or null if none. Its maximum length is 255 characters.
hasParamFloat2(Boolean,readOnly) True if the outcome's paramFloat2 property will be non-null, false if null, and null if either null or non-
null.
paramFloat2Description(String) A description of the paramFloat2 property, or null if none. Its maximum length is 255 characters.
hasParamFloat3(Boolean,readOnly) True if the outcome's paramFloat3 property will be non-null, false if null, and null if either null or non-
null.
paramFloat3Description(String) A description of the paramFloat3 property, or null if none. Its maximum length is 255 characters.
hasParamFloat4(Boolean,readOnly) True if the outcome's paramFloat4 property will be non-null, false if null, and null if either null or non-
null.
paramFloat4Description(String) A description of the paramFloat4 property, or null if none. Its maximum length is 255 characters.
hasParamFloat5(Boolean,readOnly) True if the outcome's paramFloat5 property will be non-null, false if null, and null if either null or non-
null.
paramFloat5Description(String) A description of the paramFloat5 property, or null if none. Its maximum length is 255 characters.
hasParamBoolean1(Boolean,readOnly) True if the outcome's paramBoolean1 property will be non-null, false if null, and null if either null or non-
null.
paramBoolean1Description(String) A description of the paramBoolean1 property, or null if none. Its maximum length is 255 characters.
hasParamString1(Boolean,readOnly) True if the outcome's paramString1 property will be non-null, false if null, and null if either null or non-
null.
paramString1Description(String) A description of the paramString1 property, or null if none. Its maximum length is 255 characters.
paramString1PossibleValues(String,readOnly) Contains the possible (non-null) values of the outcome's paramString1 property. The values are listed
in CSV format. Whether null is a possible value is determined by the hasParamString1 property.
hasParamParticipantId1(Boolean,readOnly) True if the outcome's paramParticipantId1 property will be non-null, false if null, and null if either null or
non-null.
paramParticipantId1Description(String) A description of the paramParticipantId1 property, or null if none. Its maximum length is 255 characters.
paramParticipant1MustBePrimary(boolean,readOnly) True if the outcome's paramParticipantId1 property must refer to a participant that has a primary role in
the event, and false if there is no such constraint.
paramParticipant1MustBeRoot(boolean,readOnly) True if the outcome's paramParticipantId1 property must refer to a participant that is a root participant
in the event, and false if there is no such constraint.
paramParticipant1MustHaveRoleId(Long,readOnly) Refers to a participant role that the participant refered to by the outcome's paramParticipantId1
property must have, or null if there is no such constraint.
hasParamParticipantId2(Boolean,readOnly) True if the outcome's paramParticipantId2 property will be non-null, false if null, and null if either null or
non-null.
paramParticipantId2Description(String) A description of the paramParticipantId2 property, or null if none. Its maximum length is 255 characters.
paramParticipant2MustBePrimary(boolean,readOnly) True if the outcome's paramParticipantId2 property must refer to a participant that has a primary role in
the event, and false if there is no such constraint.
69
Name Description
paramParticipant2MustBeRoot(boolean,readOnly) True if the outcome's paramParticipantId2 property must refer to a participant that is a root participant
in the event, and false if there is no such constraint.
paramParticipant2MustHaveRoleId(Long,readOnly) Refers to a participant role that the participant refered to by the outcome's paramParticipantId2
property must have, or null if there is no such constraint.
hasParamParticipantId3(Boolean,readOnly) True if the outcome's paramParticipantId3 property will be non-null, false if null, and null if either null or
non-null.
paramParticipantId3Description(String) A description of the paramParticipantId3 property, or null if none. Its maximum length is 255 characters.
paramParticipant3MustBePrimary(boolean,readOnly) True if the outcome's paramParticipantId3 property must refer to a participant that has a primary role in
the event, and false if there is no such constraint.
paramParticipant3MustBeRoot(boolean,readOnly) True if the outcome's paramParticipantId3 property must refer to a participant that is a root participant
in the event, and false if there is no such constraint.
paramParticipant3MustHaveRoleId(Long,readOnly) Refers to a participant role that the participant refered to by the outcome's paramParticipantId3
property must have, or null if there is no such constraint.
hasParamEventPartId1(Boolean,readOnly) True if the outcome's paramEventPartId1 property will be non-null, false if null, and null if either null or
non-null.
paramEventPartId1Description(String) A description of the paramEventPartId1 property, or null if none. Its maximum length is 255 characters.
hasParamScoringUnitId1(Boolean,readOnly) True if the outcome's paramScoringUnitId1 property will be non-null, false if null, and null if either null or
non-null.
paramScoringUnitId1Description(String) A description of the paramScoringUnitId1 property, or null if none. Its maximum length is 255
characters.
Name Description
id(long,readOnly) The id of this entity.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
outcomeTypeId(long,readOnly) A reference to the outcome type to which this outcome validation applies. Cannot be null.
eventTypeId(long,readOnly) A reference to the event type to which this outcome validation applies. Cannot be null.
eventPartId(long,readOnly) A reference to the event part to which this outcome validation applies. Cannot be null.
70
Name Description
sportId(long,readOnly) A reference to the sport to which this outcome validation applies. Cannot be null.
paramString1(String) A generic parameter slot whose value and semantics is determined by the outcome validation type. Its maximum length is 255
characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the outcome parameter validation type. Cannot be null or empty, and must be unique among all outcome
validation types. Its maximum length is 255 characters.
description(String) A description of the outcome validation type, or null if none. Its maximum length is 255 characters.
hasParamString1(Boolean,readOnly) True if the outcome validation entity's paramString1 property will be non-null, false if null, and null if either null or non-
null.
paramString1Description(String) A description of the paramString1 property, or null if none. Its maximum length is 255 characters.
71
Betting Types
Examples of how to retrieve odds for specific markets can be found in our Using Sports Model Data section.
Asian Handicap
For 2 way Handicaps, the two outcomes have opposite handicap values (for instance 1.5, -1.5).
For HAD, the two outcomes that refer to Home and Away participants have opposite handicap values (for instance 1, -1).
Draw will have as Outcome.paramParticipantId1 the participant with lowest id, while paramFloat1 will refer to the handicap corresponding to that participant.
Correct Score
For Correct Score, ParticipantId1 and ParticipantId2 do not reflect the Home Away order. Instead, ParticipantId1 will hold the participant with the lowest id, while
ParticipantId1 the participant with the highest id.
Pay extra attention to how float1 - float2 are set (the exact score), as they'll need to follow the participants order, which, as stated above, can be reversed.
- a direct comparison, a duel between two participants (which of two teams will be placed higher in the tournament, which of the two players will score most in the
tournament, etc)
For H2H, ParamParticipantId1 will hold the participant with the lowest id, while ParamParticipantId2 the participant with the highest id.
paramString1 defines the winner of the 'duel'. 1 - participant in ParamParticipantId1 will win, 2 - participant in ParamParticipantId2 will win.
72
Market
1 Diagram
2 Classifiers
2.1 Class Market
Represents a real-world sports betting market.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
73
numberOfOutcomes(Integer, The number of outcomes (i.e. selections) in
readOnly) market. Or null for markets with unknown number
of outcomes.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
74
Location
1. Diagram
2. Classifiers
2.1 Class Location
Represents a location in the real world, such as the entire world, country regions, countries, stadiums, horse racing tracks, golf courts, etc.
Every Location has a type that defines the semantics of the location, e.g. whether it is a country or not. Also, the type determines which properties apply to a Location
instance.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the location. The name cannot be null or empty. The maximum length is 255 characters.
code(String) The unique code of the location, or null if unknown, none, or not applicable. If the code is not null, then is must be non-empty and unique
within the location type. The maximum length is 255 characters.
isHistoric(boolean) True if this location is an historic location that no longer exists, and false if it still exists.
url(String) A URL to the official website of the location, or null if unknown, none, or not applicable. If not null, then the url must be a valid URL. The
maximum length is 255 characters.
note(String) An internal-use-only note. May be null. The maximum length is 255 characters.
75
World - fx. World (i.e. the plant Earth)
Continent - fx. Africa, Europe
Country - fx. Denmark
- properties: the ISO 3166 country code, optionally appended with a single number for sub-countries, e.g. "GB1" for England (part of Great Britain) (Countries
are downloaded from http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm)
Miscellaneous - Groups of Regions fx. North and Central America, UK and Ireland.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the location type, for example "Country" or "City". The name cannot be null or empty, and is unique among location
types.
description(String) A description of the location type, or null if none. Its maximum length is 255 characters.
hasCode(Boolean,readOnly) True if the location's code property will be non-null, false if null, and null if either null or non-null.
codeDescription(String) A description of the code property, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the relation. It cannot be null or empty, and it must be unique among relations. Its maximum length is 255 characters.
description(String) A description of the location relation type, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
76
Name Description
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
77
Property
1 Diagram
The primary concept here is the EntityProperty, which models an entity property as data and hence allow for the dynamic addition and removal of properties.
2 Classifiers
2.1 Class EntityPropertyType
The property type defines the property value type.
Examples: Integer, Long, Float, Boolean, String, and Date.
The tuple (name) must be unique.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the entity property type. It cannot be null or empty, and it must be unique. The maximum length is 255 characters.
description(String) A description of the entity property type, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
78
Name Description
entityTypeId(long,readOnly) A reference to the entity type. Cannot be null.
name(String) The name of the entity property. It cannot be null or empty. The maximum length is 255 characters.
description(String) A description of the entity property, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the entity type. This name must match exactly the name of the entity type, for example "Event" and "Participant". It cannot be
null or empty, and it must be unique. The maximum length is 255 characters.
description(String) A description of the entity type, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
entityId(long,readOnly) A reference to the entity. Cannot be null. The type of the entity can be determined via the entity property.
value(String) The property value, represented as a String. The property value must valid according to the property type.
79
Other entities
1 Diagram
2 Classifiers
2.1 Class Currency
Represents a real-world currency, such as US Dollars (USD), British Pounds (GBP), Euros (EUR), and Danish Crowns (DKK).
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the currency, for example "US Dollar" or "Pound Sterling". It cannot be null or empty, and it must be unique. The maximum
length is 255 characters.
code(String,readOnly) The three letter ISO 4217 currency code, for example "DKK", "USD", "EUR", and "GBP". It cannot be null, contains exactly three
characters, and is unique among currencies.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
80
Name Description
providerId(long,readOnly) A reference to the data source provider. Cannot be null.
sourceKey(String,readOnly) Represents a unique key for this source, such as a (static) XML feed URL. Cannot be null or empty. Its maximum length is 255
characters.
[not published to clients]
lastCollectedTime(Date) The time (in GMT) at which data was last collected from the source.
lastUpdateTime(Date) The time (in GMT) at which the source was last updated, or null if unknown.
Some sources may be updated regularly, e.g. every minute, rather than on-demand, and make the time of update available for
collection. If so, then this property is set to that time.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the sport, for example "Football" or "Baseball". It cannot be null or empty and is unique among sports. The maximum
length is 255 characters.
description(String) A description of this sport. May be null. The maximum length is 255 characters.
parentId(Long,readOnly) A reference to a parent sport, or null if none. Sports without parents are known as root (or top-level) sports. Sports with a parent are
known as sub-sports. Sports that have sub-sports are normally abstract.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the provider. Cannot be null or empty. Its maximum length is 255 characters.
locationId(long) A reference to the Location (typically a nation) to which the provider is most closely affiliated. Cannot be null.
url(String) A URL to the provider's web site. Can be null. If not null then the url must be a valid URL. Its maximum length is 255
characters.
isBookmaker(boolean) True if the provider is a bookmaker, and false otherwise. Cannot be null.
isBettingExchange(boolean) True if the provider is a betting exchange, and false otherwise. Cannot be null.
isEnabled(boolean) True if this provider is enabled (i.e. is active), and false if disabled (i.e. is inactive). Cannot be null.
note(String) An internal-use-only note. May be null. The maximum length is 255 characters.
81
2.5.1 SystemMessageType attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the system message type. It cannot be null or empty, and it must be unique. The maximum length is 255
characters.
description(String) A description of the system message type, or null if none. Its maximum length is 255 characters.
hasParamLong1(Boolean,readOnly) True if the system message's paramLong1 property will be non-null, false if null, and null if either null or non-null.
paramLong1Description(String) A description of the paramLong1 property, or null if none. Its maximum length is 255 characters.
hasParamTime1(Boolean,readOnly) True if the system message's paramTime1 property will be non-null, false if null, and null if either null or non-null.
paramTime1Description(String) A description of the paramTime1 property, or null if none. Its maximum length is 255 characters.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
description(String,readOnly) A brief description of the system message. It cannot be null or empty. The maximum length is 255 characters.
createdTime(Date,readOnly) The time (in GMT) at which the system message was created. Cannot be null.
paramLong1(Long,readOnly) A generic parameter slot whose value and semantics is determined by the system message type.
paramTime1(Date,readOnly) A generic parameter slot whose value and semantics is determined by the system message type.
Name Desciption
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
providerId(long,readOnly) A reference to the provider to which this mapping applies. Cannot be null.
providerEntityTypeId(String,readOnly) A provider-unique identifier for the entity type, e.g. "Event" or "Player". Cannot be null.
providerEntityId(String,readOnly) A provider-unique identifier for the entity, e.g. "e19412". Cannot be null.
entityTypeId(long,readOnly) A reference to the entity type (in the Sports Model). Cannot be null.
entityId(long,readOnly) A reference to the entity (in the Sports Model). Cannot be null.
82
2.8.1 StreamingProvider attributes
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The name of the streaming platform. Cannot be null or empty. Its maximum length is 255 characters.
locationId(long) A reference to the Location (typically a nation) to which the provider is most closely affiliated. Cannot be null.
urlTemplate(String) A URL template to the streaming platform's web site. Cannot be null or empty. Its maximum length is 255 characters.
83
Translation
If you use our JAVA connector, in order to get Translation related entities, you must use version 3.0.9 or newer.
1 Diagram
2 Classifiers
2.1 Class Translation
Represents a translation for a specific Sports Model entity.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
name(String) The translation. The name cannot be null or empty. The maximum length is 255 characters.
entityTypeId(long) A reference to an EntityType. Must be used to get the referenced translated entity class. Cannot be null.
lastChangedDate(Date) The date when this translation was last changed. Cannot be null.
Name Description
id(long,readOnly) The unique id of this entity. Cannot be null.
version(int) The current version of this entity. Any changes applied to the entity will increment the version by 1.
code(String) The language code. (ex: en-US, en-GB, de-DE etc.). Cannot be null.
createDate(Date) The date when the language was created in our system. Cannot be null.
84
All Statuses Explained
Event Statuses
These are the possible values for the Event Status entity.
Id Name Description
1 Pending The event has not started yet.
4 Interrupted The event has been interrupted after start, will continue later.
5 Canceled The event has been canceled before start, will not be played later.
6 Walkover The event has been canceled before start, will not be played later.
A player wins by walkover.
7 Abandoned The event has been abandoned after start, will not continue.
8 Retired The event has been abandoned after start, will not continue. A
played has retired.
Important:
The property Event.hasLiveStatus is indicating if the status of the event is covered live (hasLiveStatus = true) or it is estimated from Event.startTime (hasLiveStatus =
false).
Important:
While, in theory, some transitions from one state to another should not be possible, in practice, depending on the data we receive, all transitions are possible.
Most common transitions:
Pending → In progress → Ended
Pending → In progress → Interrupted → In progress → Ended
Pending → Canceled
Pending → Walkover
Pending → In progress → Abandoned
Pending → In progress → Retired
Less common transitions:
In progress → Ended → In progress (our data sources update/correct the status of the event)
Outcome Statuses
These are the possible values for the Outcome Status entity.
4 Unknown Settled, but is not The outcome is resolved (no odds available for
But known betting on this outcome) but it is unknown
Resolved whether it happened or not.
e.g. 1st half ends, all outcomes on 1st half are
set to this status. Later, the status can change,
for example, to 'Did Happen'.
6 Half Won Half Won Half of the wagered sum is multiplied by the
quota, the other half is reimbursed.
7 Half Lost Half Lost Half of the wagered sum is reimbursed, the
other half is lost.
85
Id Name Settlement Description
e.g: For a Home Away market, if the result was
Draw, then the home and away outcomes are
voided. The entire wagered sum is
reimbursed.
Important:
All transitions are possible.
Most common transitions:
Can happen → Did Happen (or Did not happen, or Half Won, or Half Lost, or Void)
Can happen → Unknown but resolved (when the event part ends and there is no settlement info yet) → Did Happen (or Did not happen, or Half Won, or Half Lost, or
Void)
Can happen → Canceled
Less common transitions:
Did Happen (or Did not happen, or Half Won, or Half Lost, or Void) → Can happen (in case of canceling previous settlement)
Did Happen → Did not happen (in case of resettlement)
BettingOffer Statuses
These are the possible values for the BettingOfferStatus entity.
2 Starting true The betting offer has no odds (yet) but bets
Price can still be placed. For example, in horse
racing it is possible to bet on the (yet
unknown) odds prevailing in the on-course
fixed-odds betting market at the time a race
begins.
Important:
While, in theory, some transitions from one state to another should not be possible, in practice, depending on the data we receive, all transitions are possible.
Most common transitions:
Standard → Removed (odds are suspended) → Standard
Standard → Suspended → Standard
Standard → Suspended → Removed
Standard → Invalid (odds are manual invalidated or a match moves from non-live to live) → Standard
Starting Price → Removed
Standard → Non Participant
All → Resolved
Less common transitions:
Resolved → Removed → Standard (when the outcome moves from Did Happen, etc → Can happen)
Outcome-BettingOffer Relationship:
When an outcome becomes settled, the BettingOffer.statusId moves to 6 (Resolved).
86
Stats and Scores Statuses
These are the possible values for EventActionStatus,EventActionDetailStatus,EventInfoStatus,EventParticipantInfoStatus,EventParticipantInfoDetailStatus entities.
Id Name Is Description
available
1 Standard true The entity (EventAction, EventInfo, etc) is
active and it could be relied on.
Important:
While, in theory, some transitions from one state to another should not be possible, in practice, depending on the data we receive, all transitions are possible.
Most common transitions:
Standard → Resolved
Standard → Removed (data source does not cover the corresponding event anymore)
Less common transitions:
Standard → Invalid (correction)
Resolved → Standard (correction on Event status, e.g.: an Event moves from Ended → In Progress, or from 2nd Half to 1st Half)
87
Java Connector
The Sports Engine Publication Component (SEPC) is the component to which clients connect in order to get the Sports Engine data.
We provide a Java-based connector which knows how to connect to and communicate with the SEPC:
Current version: SEPC-connector-4.0.0.jar. The java sources can be downloaded here: SEPC-connector-4.0.0-sources.jar
On EveryMatrix Community, the connectors can be downloaded from: Knowledge Center > Document Library > OddsMatrix > API documentation >
OddsMatrix Feed Documentation.
Depending on the type of communication with the Sports Engine, you can use a pull connector or a push connector.
The pull connector uses an HTTP connection and the push connector uses a Socket based connection.
Both constructors take the SEPC host and port as arguments.
Push connector
Pull connector
A ConnectorListener should be used to get data from SportsEngine if the initial dump data doesn't contain too many entities
Usage:
The connector listener interface contains two notify methods that are called by the connector during its execution:
notifyInitialDump called after successfully obtaining the initial data from the SEPC.
notifyEntityUpdates called after successfully obtaining an update data batch from the SEPC.
88
}
@Override
public void notifyPartialInitialDumpRetrieved(List<? extends Entity> entities) {
@Override
public void notifyInitialDumpRetrieved() {
@Override
public void notifyEntityUpdatesRetrieved(EntityChangeBatch entityChangeBatch) {
connector.addConnectorListener(connectorListener);
or
connector.addStreamedConnectorListener(streamedConnectorListener)
connector.start("subscriptionName");
89
The connector will start a background thread and will make requests to the SEPC.
The connector class is not thread safe, so it is not recommended to make multiple parallel calls to the start() method.
The connector will call the execution flow for the given subscription and Listener will be called with the initial dump and updates.
connector.startWithResume
("subscriptionName", "subscriptionId", "subscriptionChecksum", "lastEntityChangeBatchTime");
The connector will call the execution flow for the given subscription and Listener will be called with updates.
Provide values for subscriptionId, subscriptionChecksum and lastAppliedEntityChangeBatchTime from the last EntityChangeBatch you have processed:
EntityChangeBatch
@Override
public void notifyEntityUpdatesRetrieved(EntityChangeBatch entityChangeBatch) {
entityChangeBatch.getSubscriptionId();
entityChangeBatch.getSubscriptionCheckSum();
entityChangeBatch.getUuid();
}
To make sure no change gets lost, connector requests resume data from last EntityChangeBatch time you provided minus 2 minutes. This means some recent
updates will be sent again by server and it's client responsibility to filter it out / ignore data already received.
5. Stop the connector
To stop the connector thread, call the stop() method on the connector. Do this before you close your application.
Between the start() and stop() method calls, any other client logic unrelated to the connector can be called.
connector.stop();
6. Connector Logging
To see the logs produced by the connector during its execution, you must define a log4j appender for the library, e.g.
90
C# Connector
The Sports Engine Publication Component (SEPC) is the component to which clients connect in order to get the Sports Engine data.
We provide a C#-based connector which knows how to connect to and communicate with the SEPC.
Current version: om-connector-dotnet-2.0.0.zip
To add the library to your project, add a local source with the path to where you download the om-connector.2.0.0.nupkg file and add it like a normal Nuget package
to the project.
On EveryMatrix Community, the file can be downloaded from: Knowledge Center > Document Library > OddsMatrix > API documentation > OddsMatrix Feed
Documentation.
Changelog
91
}
b. IStreamedConnectorListener
The connector streamed listener interface contains four notify methods that are called by the connector during its execution:
NotifyInitialDumpToBeRetrieved called before getting the initial data from the SEPC
NotifyPartialInitialDumpRetrieved called after successfully obtaining each initial data batch from the SEPC
NotifyInitialDumpRetrieved called after successfully obtaining the initial data from the SEPC
NotifyEntityUpdatesRetrieved called after successfully obtaining an update data batch from the SEPC. Implementation details for push connector:
notifyEntityUpdates call is made from a separate thread, to decouple data reading from data processing.
if data processing is slow, update data (transformed later into EntityChangeBatch) objects will accumulate in a blocking queue, increasing client
integration memory footprint or even blocking data reading when the queue fills up.
update data queue capacity is 1 000 000 entries by default, but it is configurable (SEPCPushConnector#setUpdateDataConstructsQueueCapacity).
connector periodically logs update data queue size, client is encouraged to actively monitor it
(SEPCPushConnector#getNumberOfPendingUpdateDataConstructs) because accumulation means slow data processing which translates into delayed
data.
connector.AddConnectorListener(connectorListener);
connector.AddStreamedConnectorListener(streamedConnectorListener);
connector.Start("subscriptionName");
The connector will start a background thread and will make requests to the SEPC.
The connector class is not thread safe, so it is not recommended to make multiple parallel calls to the Start() method.
The connector will call the execution flow for the given subscription and Listener will be called with the initial dump and updates.
4.1. Start the connector with resume (requires version 1.0.14 or newer)
92
SubscriptionId and SubscriptionChecksum can be retrieved by SEPCPushConnector::GetSubscriptionId and SEPCPushConnector::GetSubscriptionChecksum
methods just before closing the connection.
connector.Stop();
6. Connector Logging
To see the logs produced by the connector during its execution, you must define a log4net appender for the library (log4net.config.xml), e.g.
<log4net debug="false">
<appender name="ConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender">
<mapping>
<level value="ERROR" />
<foreColor value="Red" />
</mapping>
<mapping>
<level value="WARN" />
<foreColor value="Yellow" />
</mapping>
<mapping>
<level value="ALL" />
<foreColor value="White" />
</mapping>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %logger{2} [%thread] %message %newline" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
For this file to be used at runtime, please add the following block inside <Project> tag in your *.csproj file
<ItemGroup>
<None Update="log4net.config.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
93
Client-Server Communication Errors
1. Error message: "No subscriptionSpecificationName found for subscriptionId 450055 Either the subscriptionId is invalid or you might have been disconnected"
2. Error message: "Too many active subscriptions. Max active subscriptions is 1"
3. Error message: "SubscribeRequest sent too often. Allowed: 1 per 3600 seconds."
4. Error message: " SubscribeRequest sent too often. Maximum Number of Subscribe Requests exceeded. Closest time for next request Wed Oct 16 08:35:45
GMT 2013"
1. Error message: "No subscriptionSpecificationName found for subscriptionId 450055 Either the subscriptionId is invalid or you might have been disconnected"
Cause: You receive this error because the Sports Engine was restarted or you got disconnected. Most of the times, a client is disconnected when it has no activity. For
the Pull mode restrictions, please check the Pull Subscription Page. For the Push mode restrictions, please check the Push Subscription Page.
What you can do: Re-subscribe (subscribe-request SDQL construct).
2. Error message: "Too many active subscriptions. Max active subscriptions is 1"
Cause: You receive this error when the number of active subscriptions you are allowed to have in the same time is exceeded. Please note that a subscription remains
active until it times out, unless you explicitly unsubscribe.
What you can do: Use only the max number of allowed subscriptions. If the number of maximum simultaneous active subscription is set too low for you, contact our
tech team.
3. Error message: "SubscribeRequest sent too often. Allowed: 1 per 3600 seconds. SubscribeRequest sent too often. Closest time for next request Tue Oct 15
11:14:09 GMT 2013"
Cause: You receive this error because you tried to resubscribe (subscribe-request SDQL construct) more often than a certain threshold (in this case 3600 sec).
What you can do: Wait until you're allowed to resubscribe.
4. Error message: "SubscribeRequest sent too often. Maximum Number of Subscribe Requests exceeded. Closest time for next request Wed Oct 16 08:35:45 GMT
2013"
Cause: You receive this error because you tried to resubscribe (subscribe-request SDQL construct) more than X times in 24 h. For the Pull mode restrictions, please
check the Pull Subscription Page. For the Push mode restrictions, please check the Push Subscription Page.
What you can do: Wait until you're allowed to resubscribe.
'
94
Client integration test scenarios
Event Related scenarios
Scenario 1: Pre-live match creation
1. The server receives information that the match goes back from live to pre-live.
2. The server invalidates all available live betting offers.
Tech details: BettingOffer.statusId is updated from 1 (Standard) → 5 (Invalid), for betting offers with BettingOffer.isLive=true.
3 The match status is updated to 'Pending'.
Tech details Event.statusId is updated from 2 (In Progress) → 1 (Pending).
4. The server receives match pre-live odds
5.1 Some of the already existing betting offers are updated as pre-live.
95
Tech details: BettingOffer.statusId is updated from 5 (Invalid) → 1 (Standard) and BettingOffer.isLive is updated from true → false.
5.2. Some betting offers are created (they were not offered in live)
Expected behavior: Live odds are not shown anymore, pre-live odds shown when available on the client front-end.
1. The server receives information that the match goes back from ended to live.
2. The server re-opens all outcomes which have the status 'Unknown but resolved'.
Tech details: Outcome.statusId is updated to from 4 (Unknown but resolved) → 1 (Can happen).
1.2 The match status is updated to 'In progress'.
Tech details: Event.statusId is updated from 3 (Ended) → 2 (In progress).
Expected behavior: Live odds shown when available on the client front-end.
1. The server receives information that the match has been abandoned.
2. The match status is updated to 'Abandoned'
Tech details: Event.statusId is updated from 2 (In progress) → 7 (Abandoned)
3. The server resolves all outcomes that are not yet settled.
Tech details: Outcome.statusId is updated to from 1 (Can happen) → 4 (Unknown but resolved).
4. The server resolves all betting offers.
Tech details: BettingOffer.statusId is updated to 6 (Resolved).
Expected behavior: Live odds are not shown anymore on the client front-end.
1. The server receives information that the match has been abandoned.
2. The match status is updated to 'Retired'
Tech details: Event.statusId is updated from 2 (In progress) → 8 (Retired)
3. The server resolves all outcomes that are not yet settled.
Tech details: Outcome.statusId is updated to from 1 (Can happen) → 4 (Unknown but resolved).
4. The server resolves all betting offers.
Tech details: BettingOffer.statusId is updated to 6 (Resolved).
Expected behavior: Live odds are not shown anymore on the client front-end.
96
3. The server deletes the match.
Expected behavior: The match is no longer available on client front-end.
*We usually delete events 1 day after they were ended.
1. The server receives a request to delete an event because of an error in the event information (wrong tournament, wrong participants etc.)
2. The server deletes betting offers, markets, outcomes and all entities associated to the match in step 1.
3. The server deletes the match.
4. The match is recreated with the correct information. Follow Scenario 1 (non-live) or Scenario 2 (live)
Expected behavior: The old match is no longer available and the new match is available on client front-end.
Scenario 17: Current Event Part is Updated (ex. for a Football Match from 1st Half → Halftime → 2nd Half)
Scenario: Current Event Part is changed to a previous value (ex. for a Football Match from 2nd Half → 1st Half)
97
Tech details: Outcome.statusId is updated to from 4 (Unknown but resolved) → 1 (Can happen).
Expected behavior: The current event part of the match match is updated to 1st Halft and live odds are shown when available on the client front-end.
Some market have variable number of outcome and it noes not have the isComplete notion. Exemple: Correct score - some outcome can be added or removed during
a game and it does not have a set of predefined outcome (like Home/Away)
1. Market is created with Market.isComplete = 'false' and Market.numberOfOutcomes = null.
2. MarketOutcomeRelations are created.
Market.isComplete is never updated to true because Market.numberOfOutcome = null.
Expected behavior: Market should be used.
98
2. Server changes the status of the Betting Offer to removed.
Tech details: BettingOffer.statusId is updated from 1 (Standard) → 4 (Removed).
Expected behavior: Odds are removed from client front-end.
99
Tech details: If now - Source.lastCollectedTime > XX Seconds then find all the BettingOffers with souceId = source from 1 and remove them.
Expected behavior: Betting offers with old source are removed from client front-end.
Scenario: Outcome is closed - outcome is settled, but the settlement is unknown yet
100
Scenario: Outcome is reopen
1. Server sends delete for a settled outcome (all betting offers related to this outcome are already deleted).
Expected behavior: Outcome is not available on client front-end.
1. Server sends delete for a not settled outcome (all betting offers related to this outcome are already deleted).
Expected behavior: Outcome is not available on client front-end. Clients must do manual settlement for all the bets linked to this outcome.
1. Server sends delete for an outcome (all betting offers related to this outcome are already deleted).
2. Server sends create for the same outcome but with a different id.
101
Expected behavior: Score is updated on client front-end for given eventPart.
102
Scenario: Displaying Remaining time in period (ex. Ice Hockey)
Scenario: 4th Goal of the match is scores. Details will be send as Event Actions and Event Action Details
1. Server sends Event Action for 4th Goal with details about which team scored, the time of the goal and the method of scoring.
Tech details: EventAction is created with typeId = 7 (Goal Scored) and paramFloat1 = 4
EventActionDetails is created with typeId = 1 (Team), paramParticipantId = the participant who scored and eventActionId = the eventAction from
above
EventActionDetails is created with typeId = 2 (Times), paramFloat1 = 48 (min 48) and eventActionId = the eventAction from above
EventActionDetails is created with typeId = 15 (Method Of Scoring), paramString1 = "Penalty" and eventActionId = the eventAction from above
Expected behavior: If the Event Actions are used, the message about the goal being scored with the details will be shown on client front-end.
Others scenarios:
Scenario: Participant name is updated
Scenario: Adding a player into a game: adding Mesut Ozil playing for Arsenal in the game Chelsea vs Arsenal
Scenario: Remove a player from a game: removing Mesut Ozil from Arsenal in the game Chelsea vs Arsenal
In some cases, the server will send delete on a betting offer than create the same betting offer with the same id or a different id (both being possible).
1. Betting offer with id 12 is deleted.
Tech details: BettingOffer with id 12 is deleted.
4. Betting offer with id 12765is created with the same properties as betting offer 12 had when deleted.
Tech details: BettingOffer with id 12 is deleted.
3. Betting offer with id 765 is deleted.
Tech details: BettingOffer with id 12 is deleted.
4. Betting offer with id 12 is created with the same properties as betting offers 12 and 765 had when deleted, except for the odds, that were changed.
Tech details: BettingOffer with id 12 is deleted.
103
Using Sports Model Data
Check out sample database from Sports Model Entities page.
At this moment, there are two types of events: match and tournament (or league).
Query
104
id name
1 Generic Match
2 Generic
Tournament
Suppose we have the event(match) with the id 180315003979616256 (this is the id for the match: Bayern Munchen - Ratiopharm Ulm).
Query
Query
105
You can retrieve the players:
Query
Query
Query
106
B1. How to find all the event parts for a tennis match?
Event parts are organized in hierarchies. For each sport, there is a hierarchy root for matches and a hierarchy root for tournament.
Suppose you are interested in the hierarchy root for tennis matches.
Query
4 1 3 20
The root event part for tennis matches has the id = 20. Once you know the hierarchy root, you can navigate in the hierarchy. Here is the root
event part:
Query
id name parentId
Query
id name parentId
21 1st Set 20
22 2nd Set 20
23 3rd Set 20
24 4th Set 20
25 5th Set 20
Query
107
id name parentId
B2. How to find all the event parts for a basketball tournament?
Event parts are organized in hierarchies. For each sport, there is a hierarchy root for matches and a hierarchy root for tournament.
Suppose you are interested in the hierarchy root for basketball tournaments.
Query
13 2 8 1
The root event part for basketball tournaments has the id = 1. Once you know the hierarchy root, you can navigate in the hierarchy. Here is
the root event part:
Query
id name parentId
108
1 Whole Event NULL
Query
id name parentId
Note: Right now, for tournaments, the event part hierarchy contains only one event part, Whole Event.
Query
C2. How to get the 1x2 odds offered by provider P for a football match? (Version 1)
Suppose you want to retrieve the 1x2 odds for the event part "Ordinary Time" offered by OddsMatrix for the match with the id
181613058696728576 (Manchester City vs Manchester United).
We know that: 1x2 bet type id is 69, OddsMatrix id is 3000984 , 'Ordinary Time' id is 3.
Query
109
providerId bettingTypeId odds eventId outcomeId
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramPart paramParti paramParti paramEve
eId mFloa mFloa mFloa oolean1 String icipantId1 cipantId2 cipantId3 ntPartId1
t1 t2 t3 1
1816130587492236 11 NULL NULL NULL NULL NULL NULL NULL NULL NULL
80
Note that there are 3 outcomes: two of type 10 and one of type 11.
Query
Query
10 Winner The winner of the event. The id of the participant to win the event.
Money lost on no-win.
The generic parameter paramParticipantId1 refers to the 'id of the participant to win the event'.
110
The outcome 181613058745029120, refers to the participant with id 50. The outcome 181613058749222912 refers to the participant with id
11.
Query
id name
11 Manchester United
50 Manchester City
Query
C3. How to get the 1x2 odds offered by provider P for a football match? (Version 2)
Suppose you want to retrieve the 1x2 odds for the event part "Ordinary Time" offered by Bet365 for the match with the id
181613058696728576 (Manchester City vs Manchester United).
We know that: 1x2 bet type id is 69, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
Query
111
Home Draw Away, Ordinary Time 181613058745029120 1.3846154
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ paramF paramFloat para paramB param paramPart paramParti paramParti paramEve
eId loat1 2 mFloa oolean1 String icipantId1 cipantId2 cipantId3 ntPartId1
t3 1
181613058 11 NULL NULL NULL NULL NULL NULL NULL NULL NULL
749223680
Note that there are 3 outcomes: two of type 10 and one of type 11.
Query
10 Winner The winner of the event. Money lost on no-win. The id of the participant to win the event.
The generic parameter paramParticipantId1 refers to the 'id of the participant to win the event'.
The outcomes with typeId = 10 refer to the participants with ids 50 and 11
Query
id name
11 Manchester United
112
50 Manchester City
Query
C4. How to get the Over/Under odds offered by provider P for a football match?
Suppose you want to retrieve the Over/Under odds for the event part "Ordinary Time" offered by Bet365 for the match with the id 206795928
(Newcastle United FC - Chelsea).
We know that: Over/Under bet type id is 47, Bet3655 id is 3000181, 'Ordinary Time' id is 3.
Query
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId3 ntPartId1
113
at1 at2 at3 1
1816130587397857 13 2.25 NULL NULL NULL NULL NULL NULL NULL NULL
28
1816130587397859 14 2.25 NULL NULL NULL NULL NULL NULL NULL NULL
84
Note that there are 2 outcomes: one of type 13 and one of type 14.
Query
13 Total Score Over The total score is greater than a certain threshold. The threshold.
14 Total Score Under The total score is less than a certain threshold. The threshold.
The outcome of type 13 refers to Over and the outcome of type 14 refers to Under. For both outcomes the generic parameter paramFloat1
refers to 2.25
Query
C5. How to get the Over/Under odds offered by provider P for a football match? (Version 2)
Suppose you want to retrieve the Over/Under odds for the event part "Ordinary Time" offered by Bet365 for the match with the id
181613058471284736 (West Ham United - Wolverhampton Wanderers).
We know that: Over/Under bet type id is 47, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
114
Query
Market entities, as Outcome entities, are modeled in a generic fashion. For Over/Under, the Market.paramFloat1 describes the threshold.
So, let's see how to retrieve odds for Over/Under 1.5
Query
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId3 ntPartId1
at1 at2 at3 1
1816130585269263 13 1.5 NULL NULL NULL NULL NULL NULL NULL NULL
36
115
1816130585332170 14 1.5 NULL NULL NULL NULL NULL NULL NULL NULL
24
Note that there are 2 outcomes: one of type 13 and one of type 14.
13 Total Score Over The total score is greater than a certain threshold. The threshold.
14 Total Score Under The total score is less than a certain threshold. The threshold.
The outcome of type 13 refers to Over and the outcome of type 14 refers to Under. For both outcomes the generic parameter paramFloat1
refers to 1.5
Query
C6. How to get the Asian Handicap odds offered by provider P for a football match (version 1)?
Suppose you want to retrieve the Asian Handicap odds for the event part "Ordinary Time" offered by OddsMatrix for the match with the id
181613058696728576 (Manchester City - Manchester United).
We know that: Asian Handicap bet type id is 48, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
Query
116
providerId bettingTypeId odds eventId outcomeId
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId2 ntPartId1
at1 at2 at3 1
Query
60 Handicap Winner With Money Back on Draw The handicap value. The id of the participant to win the event.
The generic parameter paramFloat1 refers to 1.75, respectively to -0.5. Within a market, for Asian Handicap, the two outcomes have
opposite handicap values (in our case 1.75, -0.5).
The generic parameter paramParticipantId1 refers to the 'id of the participant to win the event'.
The outcome 181613058747125760 refers to the participant with id 11. The outcome 181613058742931456 refers to the participant with id
50.
Query
id name
11 Manchester United
50 Manchester City
117
In the end, let's see everything in one query:
Query
C7. How to get the Asian Handicap odds offered by provider P for a football match? (Version 2)
Suppose you want to retrieve the Asian Handicap odds for the event part "Ordinary Time" offered by OddsMatrix for the match with id
181613058696728576 (Manchester City - Manchester United).
We know that: Asian Handicap bet type id is 48, Bet3655 id is 3000181, 'Ordinary Time' id is 3.
Query
Market entities, as Outcome entities, are modeled in a generic fashion. For Asian Handicap, the Market.paramFloat1 describes the handicap
value. So, let's see how to retrieve odds for Asian Handicap 1.5
118
Query
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId3 ntPartId1
at1 at2 at3 1
Query
60 Handicap Winner With Money Back On Draw The handicap value. The id of the participant to win the event.
The generic parameter Outcome.paramFloat1 refers to 1.5, respectively to -1.5. Within a market, for Asian Handicap, the two outcomes
have opposite handicap values (in our case 1.5, -1.5).
The generic parameter paramParticipantId1 refers to the 'id of the participant to win the event'.
The outcome 181613058745028608 refers to the participant with id 11. The outcome 181613058747127040 refers to the participant with id
50.
119
Query
id name
11 Manchester United
50 Manchester City
Query
C8. How to get the Home Draw Away With Handicap (HAD) odds offered by provider P for a football match?
Suppose you want to retrieve the Home Draw Away With Handicap odds for the event part "Ordinary Time" offered by Bet365 for the match
with id 181613058696728576 (Manchester City - Manchester United).
Query
Home Draw Away with Handicap (-1), Ordinary Time 8 1 NULL NULL 11
Home Draw Away with Handicap (-3), Ordinary Time 8 3 NULL NULL 11
120
Home Draw Away with Handicap (1), Ordinary Time 8 -1 NULL NULL 11
Home Draw Away with Handicap (-4), Ordinary Time 8 4 NULL NULL 11
Home Draw Away with Handicap (-2), Ordinary Time 8 2 NULL NULL 11
Market entities, as Outcome entities, are modeled in a generic fashion. For Home Draw Away With Handicap, the Market.paramFloat1
describes the handicap value. So, let's see how to retrieve odds for Home Draw Away With Handicap 1.
Query
Home Draw Away with Handicap (-1), Ordinary Time 181616222978600960 1.877193
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId3 ntPartId1
at1 at2 at3 1
Note that there are 3 outcomes: two of type 15 and one of type 16.
Query
121
3 WHERE id in (15, 16);
15 Handicap The winner of the event, given a certain The id of the participant to win the event.
Winner handicap.
16 Handicap The match is a draw, given a certain The lowest participant id. The event is won at exactly the
Draw handicap. handicap value.
The generic parameter Outcome.paramFloat1 refers to 1, respectively to -1. Within a market, for HAD, the two outcomes that refer to Home
and Away participants have opposite handicap values (in our case 1, -1).
Draw will have as Outcome.paramParticipantId1 the participant with lowest id, while paramFloat1 will refer to the handicap corresponding to
that participant.
The generic parameter paramParticipantId1 refers to the 'id of the participant to win the event'.
Or the ‘id of the participant who wins the event at exactly the handicap value’ in case of Handicap Draw. As mentioned, by convention,
Handicap Draw will take the lowest participantId.
Query
id name
11 Manchester United
50 Manchester City
Query
122
marketName outcomeType handicap participantName odds
Home Draw Away with Handicap (1), Ordinary Time 15 -1 Manchester City 1.877193
Home Draw Away with Handicap (1), Ordinary Time 15 1 Manchester United 3
Home Draw Away with Handicap (1), Ordinary Time 16 1 Manchester United 4
C9. How to get the Team Score Over/Under and other related bet types odds offered by provider P for a football match? (starting
from market)
Suppose you want to retrieve the Team Score Over/Under odds for the event part "Ordinary Time" offered by Bet365 for the match with id
181613058696728576 (Manchester City - Manchester United).
We know that: Team Score Over/Under bet type id is 77, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
First, let's see how Team Score Over/Under markets are modeled:
Query
Manchester City Score Over/Under 2.5, Ordinary Time 77 2.5 NULL NULL 50
Manchester City Score Over/Under 2.25, Ordinary Time 77 2.25 NULL NULL 50
Manchester City Score Over/Under 1.75, Ordinary Time 77 1.75 NULL NULL 50
Market entities, as Outcome entities, are modeled in a generic fashion. For Team Score Over/Under, the Market.paramFloat1 describes the
threshold. So, let's see how to retrieve odds for Over/Under 2.5
Query
123
Manchester City Score Over/Under 2.5, Ordinary Time 181613058743981312 1.7299271
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId3 ntPartId1
at1 at2 at3 1
Query
67 Team Score The number of goals scored by a team is over or True if over threshold, and false if The team.
Over/Under under a certain threshold. under threshold.
The generic parameter Outcome.paramFloat1 refers to the threshold value, in this case 2.5.
The outcomes 181613058743981312 and 181613058746078464 refer to the participant with id 50.
The outcomes 181616224612282624 and 181616224640594176 refer to the participant with id 11.
124
Query
id name
11 Manchester United
50 Manchester City
Query
Manchester City Score Over/Under 2.5, Ordinary Time 2.5 0 Manchester City 1.7299271
Manchester City Score Over/Under 2.5, Ordinary Time 2.5 1 Manchester City 2.02
Manchester United Score Over/Under 2.5, Ordinary Time 2.5 1 Manchester United 10
Manchester United Score Over/Under 2.5, Ordinary Time 2.5 0 Manchester United 1.04
C10. How to get the Scorings Over/Under In Time Range - and other related bet types - odds offered by provider P for a football
match? (starting from market)
Suppose you want to retrieve the Scorings Over/Under In Time Range odds for the event part "Ordinary Time", minutes 1 - 15 range, offered
by BWin for the match with id 181613058696728576 (Manchester City - Manchester United).
We know that: Scorings Over/Under In Time Range bet type id is 82, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
First, let's see how Scorings Over/Under In Time Range markets are modeled:
Query
125
6 LIMIT 5;
For Scorings Over/Under In Time Range, the Market.paramFloat1 describes the lower bound of the range, Market.paramFloat2 describes
the upper bound of the range (null if none) and Market.paramFloat3 describes the threshold.
So, let's see how to retrieve odds for Over/Under 0.5 in the first 15 minutes of the match.
Query
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
id typ para para para paramB param paramParti paramParti paramParti paramEve
eId mFlo mFlo mFlo oolean1 String cipantId1 cipantId2 cipantId3 ntPartId1
at1 at2 at3 1
126
1816168589145756 73 1 15 0.5 1 NULL NULL NULL NULL NULL
16
Query
73 Scorings The number of goals scored within a certain time range is over or under a certain True if over threshold,
Over/Under In threshold. (The time range is in minutes and relative to the start of the event part.) and false if under
Time Range threshold.
The generic parameter Outcome.paramFloat1 refers to the lower bound of the range.
The generic parameter Outcome.paramFloat2 refers to the upper bound of the range (or null, if none).
The generic parameter Outcome.paramFloat3 refers to the threshold, in this case 0.5.
Query
C11. How to get the Correct Score odds offered by provider P for a football match? (starting from market)
127
Suppose you want to retrieve the Correct Score odds for the event part "Ordinary Time" offered by BWin for the match with the id
181613058471284736 (West Ham United - Wolverhampton Wanderers).
We know that: Correct Score bet type id is 45, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
Query
We have the odds, we need to interpret the outcomes. The outcome properties are generic, they have different meanings for different types.
Query
128
Note that the outcomes are of type 12.
Query
12 Sco The exact Number of goals scored Number of goals scored The first participant The second participant
re match score, by the first participant. by the second participant. id, with the lowest id. id, with the highest id.
Exa e.g. 4:2.
ct
The generic parameter Outcome.paramFloat1 refers to the number of goals scored by the first participant.
The generic parameter Outcome.paramFloat2 refers to the number of goals scored by the second participant.
The generic parameter paramParticipantId1 refers to the participant with the lowest id.
The generic parameter paramParticipantId2 refers to the participant with the highest id.
Query
id name
62 Wolverhampton Wanderers
In the end, let's retrieve odds for Manchester City - Manchester United, score 1 - 0
Query
Please mind that o.paramParticipantId1 will have the id of Manchester United, as it is the lowest (11) and o.paramParticipantId2
the id of Manchester City (50), which does not reflect the Home Away order, therefore the score values (float 1 - float 2) need to be
reversed.
129
marketName outcomeType goals goals participantName1 participantName2 odds
Query
C12. How to get the Asian Handicap with Score odds offered by provider P for a football match? (starting from market)
Suppose you want to retrieve the “Asian Handicap With Score” odds for the event part "Ordinary Time" offered by OddsMatrix for the match
with the id 183613581320896512 (West Ham United vs Wolverhampton Wanderers).
We know that: “AH with Score” bet type id is 355, OddsMatrix id is 3000984, 'Ordinary Time' id is 3.
Query
Market entities, as Outcome entities, are modeled in a generic fashion. For Asian Handicap, the Market.paramFloat1 and
Market.paramFloat2 describe the score, while Market.paramFloat3 describes the handicap value.
130
18361089054905 Asian Handicap 355 0 0 -0.75 West Ham
1392 (-0.75) [0:0], United
Ordinary Time
So, let's see how to retrieve odds for “Asian Handicap (-0.25) [1:0], Ordinary Time“, ID 183613581320896512:
Asian Handicap (-0.25) [1:0], Ordinary Time (West Ham United 1-0) West Ham United 2.2
-0.25
Asian Handicap (-0.25) [1:0], Ordinary Time (West Ham United 1-0) Wolverhampton 1.6451613
Wanderers 0.25
Suppose you want to retrieve the Bwin odds to win tournament with ID 206230140992253952 (England Premier League 2023/2024).
We know that: ‘Tournament winner' betting type ID is 7, 'Bwin’ provider ID is 3000006, 'Whole Event' event part ID is 1.
Query
131
1 SELECT m.name AS marketName, o.name AS outcomeName, odds
2 FROM market m
3 INNER JOIN marketoutcomerelation mor ON m.id = mor.marketId
4 INNER JOIN outcome o ON o.id = mor.outcomeId
5 INNER JOIN bettingoffer bo ON bo.outcomeId = o.id
6 WHERE m.bettingTypeId = 7 AND m.eventPartId = 1 AND m.eventId = 206230140992253952 AND providerId = 3000006;
Query
132
BettingTypeID BettingTypeName EventPartID EventPartNa
me
133
D1. How to get the match score?
Query
D2. How to get all the ‘goal scored’ actions for a match?
Query
134
D3. How to get the Teams/participants that scored each goal in a match?
Query
participantName no_of_goal
Leandro Trossard 1
Leandro Trossard 2
Adam Webster 5
Leandro Trossard 6
Query
no_of_goal min
1 4
2 17
3 33
4 54
135
5 63
6 83
136