Each valid API request requires the inclusion of a valid API key as a query parameter. A key contains 11 characters (four alphanumeric characters, a dash, then six alphanumeric characters). Your account's current API key can be found on the National Statistical account page (requires login), located underneath the list of active subscriptions.
If no key is specified, an AUTHORIZE_FAILED error will be returned. If an invalid key is specified, a UNAUTHORIZED error will be returned.
Data from the National Statistical API is available in four different formats: JSON, XML, or PHP array formatted as a SimpleXML object. Users can specify which format to return with the format query parameter.
If no data format is specified, the API will send JSON-formatted data by default.
The number of max results per page. The default is 100, and the maximum allowed is 1000.
The subset of results within pagination as a numbered page. If there are more than the results specified in max (or 100 as default), the URL for the next page will be included in the meta block.
Specifying an id will return all available information regarding a single data record. With most endpoints, not specifying an id will result in an overview list of available records that will contain valid id codes.
A sublevel is a league within a competition level (for competition levels like AmerBB, EuroBB and MiLB) where teams do not or rarely play outside of its sublevel. Sublevels are three- to five- letter abbreviation codes.
A list of sublevels can be retrieved from the seasons endpoint; pass a valid season to view all available sublevel codes for that season.
A numeric code representing a team. Each team id number is unique and not replicable across competition levels. A list of team id numbers can be retrieved from the teams endpoint.
A numeric code representing a season, in the format of the YYYY year that the season concludes in. A list of season id numbers can be retrieved from the seasons endpoint.
Used to return a very small predefined subset of results.
Returns results for a certain team or player stat. A list of valid stat codes can be retrieved from the glossary endpoint.
This parameter is valid and always required when using the following endpoint: stats.
A text string to query endpoint contents. Search strings shorter than four characters are ignored. Search results are returned in order of descending relevance to the query.
A numeric code representing a player. Each player id number is unique and is not replicable across competition levels. A list of player id numbers can be retrieved from the players endpoint.
A numeric code representing a game. Game id numbers are not unique and may be not replicable across competition levels. A list of game id numbers can be retrieved from the games endpoint.
Will limit results to a single date. The API will attempt to translate the date, but YYYYMMDD or YYYY-MM-DD are preferred.
The date to begin a timeframe with which to limit results (inclusive). The API will attempt to translate the date, but YYYYMMDD or YYYY-MM-DD are preferred.
The date to end a timeframe with which to limit results (inclusive). The API will attempt to translate the date, but YYYYMMDD or YYYY-MM-DD are preferred.
Number of days previous to today's date, to specify a date range from which to match results.