The InPlay service supports basketball matches played under either FIBA or NBA rules. These rules can be reviewed here:
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
CurrentPhase
...
PhaseType
...
...
PossessionArrowDirection
...
...
Not currently used
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Value
...
...
1
...
...
...
...
5
...
...
6
...
ThirdQuarter
...
...
9
...
...
11
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
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 |
...
...
Fouls
...
...
...
...
...
...
...
...
...
...
FoulingTeam
...
TeamSide
...
The team that committed the foul
...
Type
...
FoulType
...
An enum describing the type of foul committed. Values:
Unknown
PersonalDefensive
PersonalOffensive
Technical
SetFouls
...
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.
{
"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:
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.
- The foul type is not Technical
- The last foul NumberOfFreeThrowsAwarded is 1
- The last foul AreFreeThrowsCompleted is false
FreeThrowOutcomes
A collection of Actions that describes the free throws taken during a game.
{
"CurrentPhase":1,
"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.
{
"CurrentPhase":1,
"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
...