Most of the methods use a RESTful API design. This means that you make use of the standard HTTP methods (GET, POST, DELETE, PUT).
This API is designed to be used by external parties (as well as internal) to get information about one or many games. It is designed to return information relevant to the games at a specific time, it is not deisgned to be used to gather historical information about past games.
The API will be hosted in two separate locations:
Arena. The in arena endpoint will only support making calls about the match that is currently in progress at that specific arena.
Centrally The central endpoint will support making calls about any match.
In Arena users can call the central endpoint to gather information about other matches.
limit integer |
Limit the number of records returned by the method. Default is 10, the maximum is 500. See Paging for more information. |
offset integer |
Ignore the first number of records in the result. See Paging for more information. |
responseOk enum |
The request should always return a HTTP status code of 200, regardless of any errors.
|
format enum |
The format to return the data in.
|
Each API call must include the API key. It is this API key that identifies each call and applies any permissions or quotas. You will be provided this key on signup and you should keep it secret.
The API Key must be included as a HTTP header in each request. The header name is x-api-key
.
All data provided to these API functions is required to be in UTF-8 format.
All responses will be provided as UTF-8 strings.
All responses to API calls will return in the following format
response |
|||
meta |
|||
version |
The version of the API in use | ||
code |
The HTTP status code of the response. Options are:
|
||
status |
The status of the response. Options are:
If the bulk parameter is used in the call then the status of the call will be a success even if all the individual data elements generate errors. |
||
request |
The request path/query string for which this is the response | ||
time |
ISO-8601 formatted timestamp indicating when the response was generated. | ||
count |
For a successful request, how many records are being returned | ||
limit |
For this request, what was the record limit being applied | ||
data |
|||
Successful Requests | |||
For successful requests this node will contain the information that is specified to be returned in the documentation for the individual call. | |||
Unsuccessful Requests | |||
error |
The type of error. Options:
|
||
description |
A more detailed description of the error, if available. |
From time to time new key values/structures will be added to these calls. Any client consuming this data should ignore anything they do not understand. New fields/values/structures should not cause a failure or crash in the client system.
Each API call returns 10 records to a maximum of 500 records, based on the use of the limit
parameter.
However if there are more than 500 records available these records can be accessed by using the offset
parameter.
The offset parameter will return 'limit' rows of data starting at the 'offset + 1' row.
As part of the response meta data there are two fields, limit
and count
. If limit == count
then you should make another call with offset = limit+1.
Returns records 1 - 10
/leagues/nba/games?ak=YOUR-API-KEY&limit=10
Returns records 11 - 20
/leagues/nba/games?ak=YOUR-API-KEY&limit=10&offset=10
For a particular action an event can have 1 type, 1 subtype, 1 descriptor and any number of qualifiers
If qualifiers are able to be used for a particular action/subType, then any number of qualifiers may be applied to the action.
If the subType indicates (blank) this means that the action can be used without a subType.
Type | SubType | Descriptor | Qualifiers |
---|---|---|---|
game |
|||
start |
|||
end |
|||
period |
|||
start |
|||
end |
|||
2pt |
Applies to all 2pt subTypes:
|
||
(blank) | |||
dunk |
|
||
layup |
|
||
hook |
|
||
jumpshot |
|
||
3pt |
Applies to all 3pt subTypes:
|
||
(blank) | |||
jumpshot |
|
||
freethrow |
Applies to all freethrow subTypes:
|
Applies to all freethrow subTypes:
|
|
1of1 |
|
||
1of2 |
|
||
1of3 |
|||
2of2 |
|
||
2of3 |
|||
3of3 |
|||
1for1 |
|||
1for2 |
|||
1for3 |
|||
jumpball |
|||
(blank) | |||
startperiod |
|||
lodgedball |
|||
heldball |
|||
doubleviolation |
|||
outofbounds |
|||
challenge |
|||
tap |
|||
unclearpass |
|||
doublefoul |
|||
won |
|||
lost |
|||
recovered |
team |
||
assist |
|||
block |
|||
received |
|||
rebound |
Applies to all subTypes:
|
||
defensive |
|||
offensive |
|||
foul |
Applies to all foul subTypes:
|
||
offensive |
Applies to offensive subType:
|
||
personal |
Applies to all personal foul subType:
|
||
technical |
Applies to technical subType:
|
team |
|
drawn |
|||
timeout |
  |   | mandatory |
full |
Mandatory qualifier only applies for full timeout | ||
short |
|||
officials |
|||
challenge |
|||
reset |
|||
steal |
|||
turnover |
|||
(blank) | team |
||
toomanyplayers |
team |
||
excesstimeout |
team |
||
offensivefoul |
|||
basketfrombelow |
|||
swingingelbows |
|||
punchedball |
|||
oppositebasket |
|||
palming |
|||
jumpballviolation |
|||
laneviolation |
|||
inbound |
|||
discontinuedribble |
|||
lostball |
|||
offensivegoaltending |
|||
badpass |
|||
backcourt |
|||
doubledribble |
|||
outofbounds |
|
||
traveling |
|||
shotclock |
team |
||
3secviolation |
|||
5secviolation |
|||
8secviolation |
|||
5secinboundviolation |
team |
||
offensivekickedball |
|||
illegalassist |
|||
illegaloutofboundscreen |
|||
5secondbacktothebasket |
|||
10secondfreethrowshooter |
|||
substitution |
startperiod |
||
in |
|||
out |
|||
violation |
|||
(blank) | |||
delayofgame |
|||
defensivegoaltending |
|||
defensive3second |
|||
lane |
|||
jumpball |
|||
kickedball |
|||
doublelane |
|||
ejection |
|||
(blank) | |||
technical |
|||
secondtechnical |
|||
secondflagranttype1 |
|||
flagranttype2 |
|||
other |
|||
stoppage |
|||
(blank) | |||
outofbounds |
|||
equipmentmalfunction |
|||
bloodrule |
|||
courtcleanup |
|||
injury |
|||
other |
|||
instantreplay |
|||
|
|
||
altercationrequest |
|||
memo |
The memo text should be in the value field |
Court coordinates are dimensionless and are defined as percentage measurments of the total width and height of the basketball court. The origin (0,0) is the top left corner of the court meaning the bottom right point is (100,100).
Actual physical dimensions can be obtained by multiplying the x and y values by the width and height of the court respectively.
For example: x = 20,45 relates to (20*94/100), (45*50/100) = 18.8ft, 22.5 ft
The bottom of the court (x=0) is defined as the side where the score bench is located.
Each action comes through with two shot areas, area
and areaDetail
. These are defined by
ruleset, but they break the court up into a number of different zones. Each shot taken is assigned to one simple
zone and one detail zone depending on where the person was when the action was taken.
Each one of these zones is given a name which is returned in the data.
As the zones and their names change depending on configuration, they are not defined here, but can be obtained by contacting the NBA.
Example:
An example zone layout is shown, which each colour representing a different zone, which would return a different
name.