Versions Compared
Version | Old Version 13 | New Version Current |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
The InPlay service supports basketball matches played under either FIBA or NBA rules. These rules can be reviewed here:
Table of Contents |
---|
The InPlay service supports basketball matches played under the following rulesets:
- FIBA: http://www.fiba.basketball/basketball-rules
- NBA: http://www.nba.com/news/officiating/
- NCAA: http://www.ncaa.org/playing-rules/mens-basketball-rules-game
- PBA: uses NBA ruleset
- CBA: uses NBA ruleset
This document describes the V2 basketball match state contract.
Anchor | ||||
---|---|---|---|---|
|
The Match Summary message complements the Match Details message by summarising the important match information for rapid, easy access.
Code Block | ||
---|---|---|
| ||
{ "FixtureId":2522243, "CustomerId":6105, "IsReliable":true, "Scores":{}, "FoulCount":{}, "NumberOfFreeThrowsRemaining":0, "Possession":2, "MatchTipOffWinner":"Home", "PossessionArrowDirection":null, "CurrentPhase": "SecondQuarter", "OvertimeCount":0, "IsClockRunning":true, "TimeRemainingInPhaseAtTimestamp":{}, "MessageTimestampUtc":"2014-02-28T12:01:06.398Z" } |
Element | Type | Description |
---|---|---|
FixtureId | Integer | An immutable identifier for the event |
CustomerId | Integer | An immutable identifier for the customer |
IsReliable | Boolean | True if all summarised information is reliable. False if at least one of the summarised collections is unreliable. |
Scores | ScoreData | A collection of Score objects that summarises the scores at various points in the game |
FoulCount | FoulCount | An object that summarises the number of fouls committed by each team |
NumberOfFreeThrowsRemaining | Integer | The number of free throws remaining |
Possession | PossessionTeamSide | The team in possession of the ball |
MatchTipOffWinner | String | The team winning the tip-off for match. Possible values are: Unknown Home Away |
PossessionArrowDirection |
| Not currently used |
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
IsClockRunning | Boolean | True if the clock is currently running; False otherwise |
TimeRemainingInPhaseAtTimestamp | TimestampedTime | The time left to play in the current phase, in milliseconds |
MessageTimestampUtc | DateTime | The time that the message is sent, UTC |
Scores
A collection of Score objects that summarises the scores at various points in the game.
Code Block | ||
---|---|---|
| ||
{
"FirstTeamToScore":{},
"LastTeamToScore":{},
"FirstQuarterScore":{},
"SecondQuarterScore":{},
"ThirdQuarterScore":{},
"FourthQuarterScore":{},
"FirstHalfScore":{},
"SecondHalfScore":{},
"OvertimeScore":{},
"RegulationTimeFinalScore":{},
"CurrentScore":{}
}
|
Element
Type
Description
FirstTeamToScore
TeamSide
Home if the home team scored first, Away if the away team scored first
LastTeamToScore
TeamSide
Home if the home team scored last, Away if the away team scored last. Null until the game is over. Includes overtime.
FirstQuarterScore
Score
The score in points of the first quarter; null until the end of the first quarter.
SecondQuarterScore
Score
The score in points of the second quarter; null until the end of the second quarter.
ThirdQuarterScore
Score
The score in points of the third quarter; null until the end of the third quarter.
FourthQuarterScore
Score
The score in points of the fourth quarter; null until the end of the fourth quarter.
FirstHalfScore
Score
The score in points of the first half; null until the end of the first half.
SecondHalfScore
Score
The score in points of the second half; null until the end of the second half.
OvertimeScore
Score
The score in points for the overtime period; null until the end of the overtime period.
RegulationTimeFinalScore
Score
The score in points at the end of regulation time; null until the end of the regulation time.
CurrentScore
Score
The current score in points
TimestampedTimeRemainingInPhase
An object that describes the time remaining in the current phase.
Code Block | ||
---|---|---|
| ||
{
"TimeRemainingInPhaseMilliseconds":451000,
"TimeStampUtc":"2014-02-28T12:00:50.778Z"
} |
Element
Type
Description
TimeRemainingInPhaseMilliseconds
Integer
The time remaining in the phase in milliseconds from the last ClockAction.
TimeStampUtc
DateTime
The time of the last ClockAction
The Match Details message contains the details of the game so far, including points scored, fouls committed and free throws taken.
Code Block | ||
---|---|---|
| ||
{
"FixtureId":2681906,
"CustomerId":6105,
"GameActions":{},
"MessageTimestampUtc":"2014-02-26T10:12:11.956Z"
} |
Element
Type
Description
FixtureId
Integer
An immutable identifier for the event
CustomerId
Integer
An immutable identifier for the bookmaker
GameActions
GameActions
A collection of GameAction objects detailing the actions that have occurred so far in the game
MessageTimestampUtc
DateTime
The time that the message is sent, UTC
GameActions
A collection of Action objects that describe every action that has taken place within,
"RegulationTimeFinalScore":{},
"CurrentScore":{}
}
|
Element | Type | Description |
---|---|---|
FirstTeamToScore | TeamSide | Home if the home team scored first, Away if the away team scored first |
LastTeamToScore | TeamSide | Home if the home team scored last, Away if the away team scored last. Null until the game is over. Includes overtime. |
FirstQuarterScore | Score | The score in points of the first quarter; null until the end of the first quarter. |
SecondQuarterScore | Score | The score in points of the second quarter; null until the end of the second quarter. |
ThirdQuarterScore | Score | The score in points of the third quarter; null until the end of the third quarter. |
FourthQuarterScore | Score | The score in points of the fourth quarter; null until the end of the fourth quarter. |
FirstHalfScore | Score | The score in points of the first half; null until the end of the first half. |
SecondHalfScore | Score | The score in points of the second half; null until the end of the second half. |
OvertimeScore | Score | The score in points for the overtime period; null until the end of the overtime period. |
RegulationTimeFinalScore | Score | The score in points at the end of regulation time; null until the end of the regulation time. |
CurrentScore | Score | The current score in points |
TimestampedTimeRemainingInPhase
An object that describes the time remaining in the current phase.
Code Block | ||
---|---|---|
| ||
{
"TimeRemainingInPhaseMilliseconds":451000,
"TimeStampUtc":"2014-02-28T12:00:50.778Z"
} |
Element | Type | Description |
---|---|---|
TimeRemainingInPhaseMilliseconds | Integer | The time remaining in the phase in milliseconds from the last ClockAction. |
TimeStampUtc | DateTime | The time of the last ClockAction |
Anchor | ||||
---|---|---|---|---|
|
The Match Details message contains the details of the game so far, including points scored, fouls committed and free throws taken.
Code Block | ||
---|---|---|
| ||
{
"FixtureId":2681906,
"CustomerId":6105,
"GameActions":{},
"MessageTimestampUtc":"2014-02-26T10:12:11.956Z"
} |
Element | Type | Description |
---|---|---|
FixtureId | Integer | An immutable identifier for the event |
CustomerId | Integer | An immutable identifier for the bookmaker |
GameActions | GameActions | A collection of GameAction objects detailing the actions that have occurred so far in the game |
MessageTimestampUtc | DateTime | The time that the message is sent, UTC |
GameActions
A collection of Action objects that describe every action that has taken place within the game.
Code Block | ||
---|---|---|
| ||
{
"ClockActions":{},
"Points":{},
"PossessionChanges":{},
"Fouls":{},
"FreeThrowOutcomes":{},
"PossessionArrowChanges":{},
"PhaseChanges":{},
"Timeouts":{}
} |
Element | Type | Description |
---|---|---|
ClockActions | ClockActivity | A collection of clock actions that describes the changes to the clock during the game |
Points | Point | A collection of point actions that describes all the points awarded during the game |
PossessionChanges | PossessionChange | A collection of possession change actions that describes all the possession changes made during the game |
Fouls | Foul | A collection of foul actions that describes all the fouls committed during the game |
FreeThrowOutcomes | FreeThrowOutcome | A collection of free throw outcome actions that describes all the outcomes of all the free throws awarded during the game |
PossessionArrowChanges | PossessionArrowChange | A collection of possession arrow change actions that describes all the possession arrow changes made during the game |
PhaseChanges | PhaseChange | A collection of phase change actions |
Timeouts | Timeout | A collection of timeout actions |
Each collection of Actions, ClockActions, Points, PossessionChanges etc., have the following attributes:
Element | Type | Description |
---|---|---|
IsCollected | Boolean | True when the data type is being collected and is available to be used. False indicates that the data type is not being collected. |
IsReliable | Boolean | False when the confidence in the accuracy of the associated information is not complete |
ClockActivity
A collection of Action objects that describe all the clock changes that have occurred during the game.
Code Block | ||
---|---|---|
| ||
{ "ClockActionsCurrentPhase":{}, "PointsSecondQuarter":{}, "PossessionChangesOvertimeCount":{}0, "FoulsTimeRemainingInPhaseMilliseconds":{}600000, "FreeThrowOutcomesTimeActionOccurredUtc":{}, "PossessionArrowChanges":{}"2014-02-26T10:12:11.001Z", "PhaseChangesActivityType":{}0, "TimeoutsIsClockRunning":{}true } |
Element | Type | Description |
---|---|---|
ClockActionsCurrentPhase | ClockActivityPhaseType | A collection of clock actions that describes the changes to the clock during the game |
Points | Point | A collection of point actions that describes all the points awarded during the game |
PossessionChanges | PossessionChange | A collection of possession change actions that describes all the possession changes made during the game |
Fouls | Foul | A collection of foul actions that describes all the fouls committed during the game |
FreeThrowOutcomes | FreeThrowOutcome | A collection of free throw outcome actions that describes all the outcomes of all the free throws awarded during the game |
PossessionArrowChanges | PossessionArrowChange | A collection of possession arrow change actions that describes all the possession arrow changes made during the game |
PhaseChanges | PhaseChange | A collection of phase change actions |
Timeouts | Timeout | A collection of timeout actions |
Element
Type
Description
IsCollected
Boolean
True when the data type is being collected and is available to be used. False indicates that the data type is not being collected.
IsReliable
Boolean
False when the confidence in the accuracy of the associated information is not complete
ClockActivity
A collection of Action objects that describe all the clock changes that have occurredThe phase of play during which the action happened | ||
---|---|---|
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
ActivityType | ClockActivityType | The type of clock activity associated with the action |
IsClockRunning | Boolean | True if the clock is currently running; False otherwise |
PhaseType
Describes the phase of play during which an action happened. Can take the following values:
Name |
PreGame |
FirstQuarter |
BeforeSecondQuarter |
SecondQuarter |
FirstHalf |
HalfTime |
ThirdQuarter |
BeforeFourthQuarter |
FourthQuarter |
SecondHalf |
BeforeOvertime |
Overtime |
PostGame |
GameAbandoned |
ClockActivityType
The type of clock activity associated with the action. Can take the following values:
Value | Name | Description |
0 | Start | The clock has started |
1 | Stop | The clock has stopped |
2 | Adjustment | A small change to the current clock time, for example when the clock is nudged in the trading UI |
3 | SetClock | A large change to the current clock time |
Points
A collection of actions that describe all the points awarded during the game.
Code Block | ||
---|---|---|
| ||
{ "CurrentPhase": "SecondQuarter", "OvertimeCount":0, "TimeRemainingInPhaseMilliseconds":600000576592, "TimeActionOccurredUtc":"2014-02-26T1026T14:1254:11.001Z"34.342Z", "PointType":1, "TeamScoring":1, "ActivityTypeScoreAfterPoint":0,{} "IsClockRunningIsConfirmed":true } |
Element | Type | Description |
---|---|---|
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
ActivityTypePointType | ClockActivityTypePointType | The type of clock activity associated with the action |
IsClockRunning | Boolean | True if the clock is currently running; False otherwise |
PhaseType
Describes the phase of play during which an action happened. Can take the following values:
Value
Name
0
PreGame
1
FirstQuarter
2
BeforeSecondQuarter
3
SecondQuarter
4
FirstHalf
5
HalfTime
6
ThirdQuarter
7
BeforeFourthQuarter
8
FourthQuarter
9
SecondHalf
10
BeforeOvertime
11
Overtime
12
PostGame
13
GameAbandoned
ClockActivityType
The type of clock activity associated with the action. CanDescribes the type of point awarded | ||
---|---|---|
TeamScoring | TeamSide | Details the team to which the action applies |
ScoreAfterPoint | Score | The game score after the point has been added |
IsConfirmed | Boolean | True if the points have been confirmed by the data feed supplier or if the points were added through the trading UI |
PointType
Describes the type of point awarded. Can take the following values:
Value | Name |
0 | FreeThrow |
1 | TwoPoint |
2 | ThreePoint |
3 | SetScore |
TeamSide
Some actions or scores are attributed to an individual team. TeamSide is an Enum that details the team to which its parent element applies. It can take the following values:
Value | Name | Description |
0 | StartHome | The clock has startedhome team |
1 | StopAway | The clock has stopped |
2 | Adjustment | A small change to the current clock time, for example when the clock is nudged in the trading UI |
3 | SetClock | A large change to the current clock time |
Points
A collection of actions that describe all the points awarded during the gameaway team |
Score
An object that holds the current score in points.
Code Block | ||
---|---|---|
| ||
{ "CurrentPhase": "SecondQuarter", "OvertimeCount":0, "TimeRemainingInPhaseMilliseconds":576592, "TimeActionOccurredUtc":"2014-02-26T14:54:34.342Z", "PointType":1, "TeamScoring":1, "ScoreAfterPoint":{} "IsConfirmed":true } Home":0, "Away":2 } |
Element | Type | Description |
---|---|---|
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
PointType | PointType | Describes the type of point awarded |
TeamScoring | TeamSide | Details the team to which the action applies |
ScoreAfterPoint | Score | The game score after the point has been added |
IsConfirmed | Boolean | True if the points have been confirmed by the data feed supplier or if the points were added through the trading UI |
PointType
Describes the type of point awarded. Can take the following values:
Value
Name
0
FreeThrow
1
TwoPoint
2
ThreePoint
3
SetScore
TeamSide
Some actions or scores are attributed to an individual team. TeamSide is an Enum that details the team to which its parent element applies. It canHome | Short | The home team's score in points |
Away | Short | The away team's score in points |
PossesssionChanges
A collection of Actions that describe changes of possession during the game.
Code Block | ||
---|---|---|
| ||
{
"CurrentPhase": "SecondQuarter",
"OvertimeCount":0,
"TimeRemainingInPhaseMilliseconds":600000,
"TimeActionOccurredUtc":"2014-02-26T14:54:09.78Z",
"TeamInPossession":0
} |
Element | Type | Description |
---|---|---|
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
TeamInPossession | PossessionTeamSide | Describes the team in possession of the ball |
PossessionTeamSide
Describes the team in possession of the ball. Can take the following values:
Value | Name | Description |
0 | HomeNeutral | The home team |
1 | Away | The away team |
Score
An object that holds the current score in points.
Code Block | ||
---|---|---|
| ||
{
"Home":0,
"Away":2
} |
Element
Type
Description
Home
Short
The home team's score in points
Away
Short
The away team's score in points
Neither team has possession of the ball | ||
1 | Home | The home team has possession of the ball |
2 | Away | The away team has possession of the ball |
PossessionArrowChanges
A collection of Actions that describe describes the changes of the possession arrow during the a game.
Code Block | ||
---|---|---|
| ||
{ "CurrentPhasePossessionArrowDirection": "SecondQuarterHome", "OvertimeCountCurrentPhase":0, "TimeRemainingInPhaseMillisecondsFirstQuarter":600000, "TimeActionOccurredUtc":"2014-02-26T14:54:09.78Z"OvertimeCount": 0, "TeamInPossessionTimeRemainingInPhaseMilliseconds":0 } |
Element
Type
Description
CurrentPhase
PhaseType
The phase of play during which the action happened
OvertimeCount
Short
A count indicating the current overtime period
TimeRemainingInPhaseMilliseconds
Integer
The time left to play in the current phase, in milliseconds
TimeActionOccurredUtc
DateTime
The time that the action occurred, UTC
TeamInPossession
PossessionTeamSide
Describes the team in possession of the ball
PossessionTeamSide
Describes the team in possession of the ball. Can take the following values:
Value
Name
Description
0
Neutral
Neither team has possession of the ball
1
Home
The home team has possession of the ball
2
Away
The away team has possession of the ball
PossessionArrowChanges
A collection of Actions that describes the changes of the possession arrow during a game. 600000,
"TimeActionOccurredUtc": "2024-09-17T10:03:47Z"
} |
Element | Type | Description |
---|---|---|
PossessionArrowDirection | String | Indicates the team toward the possession arrow points |
CurrentPhase | PhaseType | The phase of play during which the direction changed |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time the action occurred, UTc |
Fouls
A collection of actions that describe the fouls committed during the game.
Code Block | ||
---|---|---|
| ||
{ "CurrentPhase":1, "OvertimeCount":0, "TimeRemainingInPhaseMilliseconds":576592, "TimeActionOccurredUtc":"2014-02-26T14:54:34.342Z", "ActionNumber":1, "FoulingTeam":1, "Type":2, "FoulCount":{}, "IncrementsFoulCount":true, "NumberOfFreeThrowsAwarded":2, "AreFreeThrowsCompleted":true } |
Element | Type | Description |
---|---|---|
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
ActionNumber | Integer | The foul action number linked from FreeThrowOutcome |
FoulingTeam | TeamSide | The team that committed the foul |
Type | FoulType | An enum describing the type of foul committed. Values: |
FoulCount | FoulCount | The foul count after the current foul has been added |
IncrementsFoulCount | Boolean | True if this foul increments the number of fouls counted in the game |
NumberOfFreeThrowsAwarded | Integer | The number of free throws awarded as a result of the foul |
AreFreeThrowsCompleted | Boolean | True once all free throws have been taken; False otherwise. |
FoulCount
An object that holds the current foul count.
Code Block | ||
---|---|---|
| ||
{ "Home":0, "Away":2 } |
Element | Type | Description |
---|---|---|
Home | Short | The number of fouls committed by the home team |
Away | Short | The number of fouls committed by the away team |
"And 1" Situation
An "And 1" situation occurs when a player scores a two or three point field goal and is fouled in the act of shooting. A single free-throw will be awareded in this situation. You can identify "And 1" situations using the following logic:
Code Block | ||
---|---|---|
| ||
var lastFoul = matchState.GameActions.Fouls.LastOrDefault(); var isAnd1 = lastFoul != null && lastFoul.Type != FoulTypeDto.Technical && lastFoul.NumberOfFreeThrowsAwarded == 1 && lastFoul.AreFreeThrowsCompleted == false; if (isAnd1) { // Do And1 stuff } |
In other words, take the last foul in the Fouls collection in GameActions and an "And 1" situation exists if all the following are true.
Panel |
---|
|
FreeThrowOutcomes
A collection of Actions that describes the free throws taken during a game.
Code Block | ||
---|---|---|
| ||
{ "CurrentPhase":"SecondQuarter", "OvertimeCount":0, "TimeRemainingInPhaseMilliseconds":556373, "TimeActionOccurredUtc":"2014-02-26T14:55:05.327Z", "Scored":true, "AssociatedFoulActionNumber":8 } |
Element | Type | Description |
---|---|---|
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
Scored | Boolean | True indicates that the free throw resulted in a score |
AssociatedFoulActionNumber | Integer | The foul action number associated with this free throw |
PhaseChanges
A collection of Actions that describe changes of phase during the game.
Code Block | ||
---|---|---|
| ||
{ "CurrentPhase": "SecondQuarter", "OvertimeCount":0, "TimeRemainingInPhaseMilliseconds":600000, "TimeActionOccurredUtc":"2014-02-26T14:54:09.78Z", "IsConfirmed":true } |
Element | Type | Description |
---|---|---|
CurrentPhase | PhaseType | The phase of play during which the action happened |
OvertimeCount | Short | A count indicating the current overtime period |
TimeRemainingInPhaseMilliseconds | Integer | The time left to play in the current phase, in milliseconds |
TimeActionOccurredUtc | DateTime | The time that the action occurred, UTC |
IsConfirmed | Boolean | True if the phase change has been confirmed, False otherwise |
Timeouts
A collection of Actions that describe timeouts during the game.
Code Block | ||
---|---|---|
| ||
{ "Actions": [], "IsCollected": true, "IsReliable": false } |
Element | Type | Description |
---|---|---|
Actions | ArrayOfTimeout | Array of Timeout objects |
IsCollected | Boolean | True if data is collected, false otherwise |
IsReliable | Boolean | True if data is reliable, false otherwise |
Timeout
An object describing a single timeout action.
Code Block | ||
---|---|---|
| ||
{ "Team": "Home", "OvertimeCount": 0, "CurrentPhase": "ThirdQuarter", "TimeRemainingInPhaseMilliseconds": "499510", "TimeActionOccurredUtc": "2016-08-06T16:47:29Z", "IsConfirmed": true } |
Element | Type | Description |
---|---|---|
Team | String | Describes the team |
OvertimeCount | Integer | Describes the Overtime count |
CurrentPhase | String | Describes the current phase |
TimeRemainingInPhaseMilliseconds | Duration | Describes the time remaining in phase |
TimeActionOccuredUtc | DateTime | Describes the action timestamp |
IsConfirmed | Boolean | True if action is confirmed, false otherwise |
MatchTipOffWinner
MatchTipOffWinnerChanges
A collection of actions that describe tip-off winner for a match.
Code Block | ||
---|---|---|
| ||
{ "Actions": [], "IsCollected": true, "IsReliable": false } |
Element | Type | Description |
---|---|---|
Actions | ArrayofMatchTipOffWinners | Array of Match tip-off winner objects |
IsCollected | Boolean | True if data is collected, false otherwise |
IsReliable | Boolean | True if data is collected, false otherwise |
MatchTipOffWinner
An object describing the winner of tip-off in a match.
Please note that due to an error in development duplicate array called "MatchTipOfferWinner" exists in the Details message. The "MatchTipOfferWinner" collection array can be safely ignored and it will be removed from the message in the coming future.
Code Block | ||
---|---|---|
| ||
{ "MatchTipOffWinner": "Home", "CurrentPhase": "FirstQuarter", "TimeRemainingInPhaseMilliseconds": "499510", "TimeActionOccurredUtc": "2016-08-06T16:47:29Z", "IsConfirmed": true } |
Element | Type | Description |
---|---|---|
MatchTipOffWinner | String | The team winning the tip-off for match. Possible values are: Unknown Home Away |
CurrentPhase | String | Describes the current phase |
TimeRemainingInPhaseMilliseconds | Duration | Describes the time remaining in phase |
TimeActionOccuredUtc | DateTime | Describes the action timestamp |
IsConfirmed | Boolean | True if action is confirmed, false otherwise |