API v3 Documentation

Endpoints Code Lookup

Parameters

API Key

Each valid 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. (For new accounts, please note that it may take a few minutes to generate an initial API key.)

https://api3.natst.at/xxxx-xxxxxx/...

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 Service Code

Most valid API requests require the inclusion of one of National Statistical's 29 data services, which each represent a level of competition in basketball, baseball, hockey, American football or soccer. The level parameter must be passed after the endpoint key in the URI, using the following format:

https://api3.natst.at/xxxx-xxxxxx/games/XXX/...

AbbrevLeagueFull Data Back To
AsiaBBAsian professional basketball leagues2012
AmerBBNorth/South/Central American professional basketball leagues2012
CBBNCAA Division I College Baseball2012
EuroBBEuropean professional basketball leagues2012
FCNatStat FC (soccer)1908
GLNBA G League2010
KBOKorean Baseball Organization2010
KHLKontinental Hockey League2009
MHKNCAA Division I Men's Hockey2016
MLBMajor League Baseball1920
MiLBMinor League Baseball2012
MBBNCAA Men's Division I College Basketball2008
MB2NCAA Men's Division II College Basketball2012
MB3NCAA Men's Division III College Basketball2012
NBANational Basketball Association1991
MBIANAIA Men's Basketball2016
MBJCJunior College Men's Basketball2016
NHLNational Hockey League1990
NPBNippon Professional Baseball1960
WBBNCAA Women's Division I College Basketball 2012
WB2NCAA Women's Division II College Basketball2012
WB3NCAA Women's Division III College Basketball2012
WBIANAIA Women's Basketball2016
WBJCJunior College Women's Basketball2016
WBProWomen's International Pro Basketball2019
WHKNCAA Division I Women's Hockey2019
WNBAWomen's National Basketball Association2007
PFBPro Football2002
CFBCollege Football2002

Please note that the level parameter is not case sensitive. For instance: MiLB, MILB and milb will each work properly.

Player, Team Stats

When using the stats endpoint, add either player or team in the range. (The default is team.) The glossary endpoint returns a dictionary of stat codes that can be used in queries.

https://api3.natst.at/xxxx-xxxxxx/glossary/mlb/

Team, League, Player, Game Code Usage

Specifying a code in the range will return all available information regarding a single data record. With most endpoints, not specifying a code will result in an overview list of available records with valid codes.

Team: https://api3.natst.at/xxxx-xxxxxx/teams/milb/SLS

League: https://api3.natst.at/xxxx-xxxxxx/leaguecodes/milb/international

Player: https://api3.natst.at/xxxx-xxxxxx/players/milb/37994267

Game: https://api3.natst.at/xxxx-xxxxxx/games/milb/10186874