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/...
| Abbrev | League | Full Data Back To |
| AsiaBB | Asian professional basketball leagues | 2012 |
| AmerBB | North/South/Central American professional basketball leagues | 2012 |
| CBB | NCAA Division I College Baseball | 2012 |
| EuroBB | European professional basketball leagues | 2012 |
| FC | NatStat FC (soccer) | 1908 |
| GL | NBA G League | 2010 |
| KBO | Korean Baseball Organization | 2010 |
| KHL | Kontinental Hockey League | 2009 |
| MHK | NCAA Division I Men's Hockey | 2016 |
| MLB | Major League Baseball | 1920 |
| MiLB | Minor League Baseball | 2012 |
| MBB | NCAA Men's Division I College Basketball | 2008 |
| MB2 | NCAA Men's Division II College Basketball | 2012 |
| MB3 | NCAA Men's Division III College Basketball | 2012 |
| NBA | National Basketball Association | 1991 |
| MBIA | NAIA Men's Basketball | 2016 |
| MBJC | Junior College Men's Basketball | 2016 |
| NHL | National Hockey League | 1990 |
| NPB | Nippon Professional Baseball | 1960 |
| WBB | NCAA Women's Division I College Basketball | 2012 |
| WB2 | NCAA Women's Division II College Basketball | 2012 |
| WB3 | NCAA Women's Division III College Basketball | 2012 |
| WBIA | NAIA Women's Basketball | 2016 |
| WBJC | Junior College Women's Basketball | 2016 |
| WBPro | Women's International Pro Basketball | 2019 |
| WHK | NCAA Division I Women's Hockey | 2019 |
| WNBA | Women's National Basketball Association | 2007 |
| PFB | Pro Football | 2002 |
| CFB | College Football | 2002 |
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/SLSLeague:
https://api3.natst.at/xxxx-xxxxxx/leaguecodes/milb/internationalPlayer:
https://api3.natst.at/xxxx-xxxxxx/players/milb/37994267Game:
https://api3.natst.at/xxxx-xxxxxx/games/milb/10186874