Issuu on Google+

Betradar Data Export Livescore XML Format Specification 08.02.2008

Table of Contents Introduction..........................................................................................................................................2 Data Format.....................................................................................................................................2 Access Methods...............................................................................................................................2 LiveScore XML Feed...........................................................................................................................3 Structure...........................................................................................................................................3 Match Specification.........................................................................................................................4 Extended service..............................................................................................................................7 Appendix..............................................................................................................................................9 Complete File Check.......................................................................................................................9 Status codes....................................................................................................................................10


Introduction Data Format Data export from Betradar is contained in an XML format. The primary purpose of the data format is to describe sport fixtures with odds, results and comments in way that makes it easy to efficiently import them into systems that use the Betradar services. An important feature of the export is the exposure of internal Betradar IDs, allowing for synchronization between Betradar and clients. The following main sections in this document describes the XML format in detail.

Access Methods At Betradar, we are flexible. We support multiple methods through which the clients can access the Livescore XML data files: Protocol

Description

[S]FTP

We support both pull and push access methods on FTP, alternatively using SFTP for greater security. For the pull solution, we publish the data on our FTP server, allowing the client to connect and fetch files actively. For the push solution, we can dump the data on the client’s FTP server at predetermined points in time.

HTTP

Just as with FTP, we support both push and pull using HTTP. This means that data can either be collected from our web server using a special URL or that Betradar sends data to the client using HTTP POST.

Socket

If you are able to set up you receiving application to listen to a specified port we can set up a connection to you server and send the data directly to you on a raw data socket.

In short: If you set up some sort of server, we'll dump the data to you whenever you want. If you want to fetch data from our servers instead -- no problem, we'll create accounts and put the files where you can find them. Or we'll just send them by email. Regardless of the transmission method you choose, we will keep on resending the file until it is successfully transmitted. If one server is down or there are problems with the Internet connections, we'll just keep trying, making sure that you get the data. If you wish, you can receive an automatic alert by email if we detect any problems during transmission.


Livescore XML Feed Structure Internally, the matches in Betradar are organized into a hierarchy of sports, categories and tournaments. All matches belong to a tournament, which in turn belongs in a category, which in turn belongs to a sport. The structure of the XML file reflects this hierarchy:

<BetradarLivescoreData> <Sport> <Category> <Tournament> <Match> (match data, status, scores etc.) </Match> </Tournament> </Category> </Sport> </BetradarLivescoreData>

Each of the sport, category and tournament in the hierarchy is described with a name attribute. An example is given below: <Sport> <Name>Soccer</Name> <Category> <Name>England</Name> <Tournament> <Name>Premier League</Name> ... </Tournament> </Category> </Sport>


Match Specification Introduction The Match element contains information about the match including match date, team names, current status and scores. This element also contain information about yellow and red cards in addition to substitutions if available. An example Match element:

<Match> <MatchDate>2005-02-06T15:00:00</MatchDate> <Team1>Southampton FC</Team1> <Team2>Everton FC</Team2> <Status Code="100">Full time</Status> <Winner>1</Winner> <LastGoal> <Time>2005-02-06T15:37:24</Time> <Team>2</Team> </LastGoal> <CurrentPeriodStart>2005-02-06T15:00:21</CurrentPeriodStart> <Scores> ... </Scores> <Goals> ... </Goals> </Match>

The Status attribute gives the match status at the time of generation of the XML file. Possible status codes and their corresponding texts can be seen in the appendix. The Winner attribute tells what team is winner of the match after overtime and penalties; 1 = home team, 2 = away team, 3 = draw, 0 = NA.


Details This section takes a closer look at all the various elements and attributes that make up a Match element. The Scores element holds the all the scores for the match, including current score, period scores, overtime score and penalty scores. <Scores> <Score type="Current"> <Team1>4</Team1> <Team2>2</Team2> </Score> <Score type="Period1"> <Team1>1</Team2> <Team2>1</Team2 </Score> <Score type="Normaltime"> <Team1>2</Team2> <Team2>2</Team2 </Score> <Score type="Overtime"> <Team1>2</Team2> <Team2>2</Team2 </Score> <Score type="Penalties"> <Team1>4</Team2> <Team2>2</Team2 </Score> </Scores>

The type attribute of the Score element can be: • • • • • • • • • • •

Current = The actual score at the time of generation Period1 = The score after period 1 (For soccer and handball this is the halftime score) Period2 = The score after period 2 Period3 = The score after period 3 Period4 = The score after period 4 Period5 = The score after period 5 Normaltime = The score after normal playing time, before overtime and penalties is played Extra1 = The score after extra period 1 Extra2 = The score after extra period 2 Overtime = The score after overtime Penalties = The score after penalties


The Goals element contains detailed information on the goals. It may several Goal elements in the following structure: <Goals> <Goal> <Time>37</Time> <Team1>1</Team1> <Team2>1</Team> <Player>Bent</Player> <ScoringTeam>2</ScoringTeam> </Goal> <Goal> <Time>21</Time> <Team1>1</Team1> <Team2>0</Team> <Player>A.Camara</Player> <ScoringTeam>1</ScoringTeam> </Goal> </Goals>

The Time element gives the match time when the goal was scored, in minutes after match start. Team1 and Team2 is the team scores after the goal. The Player element is the name of the player that scored the goal, and the team that scored is given in the ScoringTeam element ("1" for home team and "2" for away team) The LastGoal element gives additional information about the last goal / score change. The Time element gives the actual time when the goal was scored / the score changed and the Team tells what team scored the last goal. This information is useful for identifying the latest goals.

<LastGoal> <Time>2005-02-06T15:37:24</Time> <Team>2</Team> </LastGoal>

The CurrentPeriodStart element contains information about when the period that is currently being played, was started.

<CurrentPeriodStart>2005-02-06T15:00:21</CurrentPeriodStart>

Combined with the Status element data and the actual time, this can be used to calculate the match time for sports where the clock is not stopped during play.


Extended service With the extended livescore service, the Match element in the XML file will, in addition to goals, also contain information about cards, substitutions and lineups, if available. The Cards element contains the yellow and red cards given in the match. <Cards> <Card type="Yellow"> <Time>13</Time> <Player>C.Watson</Player> <PlayerTeam>1</PlayerTeam> </Card> <Card type="Red"> <Time>53</Time> <Player>P.Jackson</Player> <PlayerTeam>2</PlayerTeam> </Card> </Cards>

The type attribute shows if the card was yellow or red. The Time element gives the match time when the card was given, in minutes after matchstart. Player contains the name of the player, and PlayerTeam gives what team the player plays for; "1" for home team and "2" for away team. The Substitutions element contains the substitutions <Substitutions> <Substitution> <Time>35</Time> <PlayerOut>A.Camara</PlayerOut> <PlayerIn>R.Crouch</PlayerIn> <PlayerTeam>1</PlayerTeam> </Substitution> </Substitutions>

As for the Goal element, the Time element shows the time that the event occurred, in minutes after match start. PlayerOut gives the name of the player that leaves the match, and PlayerIn is the player that enters the match. PlayerTeam tells what team is doing the substitution ("1" for home team and "2" for away team)


The Lineups element contains information about the players that are in the lineups for the different teams in the match.

<Lineups> <TeamPlayer> <Player>A.Camara</Player> <ShirtNumber>12</ShirtNumber> <PlayerTeam>1</PlayerTeam> <Substitute>0</Substitute> </TeamPlayer> </Lineups>

The Substitute element tells whether the player is in the starting grid or as a substitute ("0" if in starting grid and "1" if listed as substitute)


Appendix Complete File Check If you are uncertain about whether you have received a full XML datafile (perhaps you received an email alert from us about trouble with the transmissions), a relatively simple initial check is to just look for the end tag: </BetradarLiveScoreData>. It is the last data that is written to the file, so its presence should indicate that the whole file was transmitted.


Status codes The table below shows the codes and corresponding texts for the Status element in the XML file. Code Text

Description

0

Not started

1

1st period

2

2nd period

3

3rd period

4

4th period

5

5th period

6

1st half

7

2nd half

8

1st set

9

2nd set

10

3rd set

11

4th set

12

5th set

13

1st quarter

14

2nd quarter

15

3rd quarter

16

4th quarter

20

Started

30

Pause

31

Halftime

40

Overtime

Currently playing on overtime

41

1 extra

Currently playing 1st extra period

42

2nd extra

Currently playing 2nd extra period

50

Penalties

Currently playing penalties

st

Continued on next page.


60

Postponed

The match is postponed and will be played later

61

Start delayed

Start has been slightly delayed

70

Cancelled

Cancelled before start, will not be played later

80

Interrupted

Interrupted after start, will continue later

81

Suspended

90

Abandoned

Abandoned after start, will not continue

91

Walkover

A player win by walkover

92

Retired

A player has retired

100

Ended

110

AET

Match has ended after extra time

120

AP

Match has ended after penalties


Probni PDF