Introduction
The National Statistical API is a REST-ful data service offering real-time and historical data for 30 national, international and collegiate competition levels of basketball, baseball, hockey, American football and soccer. It is owned and operated by National Statistical, which has been offering sports data services since 2007.
NatStat API v4 contains 31 data endpoints. Click here to view the detailed endpoint reference.
Building a URI to query the National Statistical API begins with four basic requirements.
⓵ All requests start with this base URI.
https://api4.natst.at/
⓶ The first path parameter is a valid API key. A key contains 11 characters (four alphanumeric characters, a dash, then six alphanumeric characters). The account's API key can be found on the National Statistical account page (requires login) in the NatStat API navigation tab, or under Analysis Tools > NatStat API > Query Builder on any of the 30 service subsites.
https://api4.natst.at/xxxx-xxxxxx/
⓷ The second path parameter is a valid endpoint. The available endpoints are teams, games, players (primary); boxscores, elo, events, forecasts, lineups, moneyline, news, officials, overunder, pitchfx, playbyplay, playerperfs, pointspread, projline, simulations, stats, teamperfs, text, transactions, venues, videos, winprob (secondary); datastatus, seasons, teamcodes, gamecodes, playercodes, glossary (reference).
https://api4.natst.at/xxxx-xxxxxx/games/
Adding a semicolon to a primary endpoint, followed by comma-separated valid secondary endpoint(s), will hydrate the API response with additional data. Valid secondary endpoints include:
| Primary Endpoint | Valid Secondary Endpoints |
| teams | games,players,stats,teamperfs,transactions,news,videos,text |
| players | seasons,playerperfs,playbyplay,projline,transactions,news,videos |
| games | playbyplay,lineups,text,boxscores,forecasts[elo,moneyline,overunder,simulations,pointspread,winprob],pitchfx,projline |
https://api4.natst.at/xxxx-xxxxxx/games;playbyplay,lineups,text/
Some endpoints allow for use of aliases (singular/plural or abbreviation).
| Endpoint | Alternate Name(s) |
| datastatus | status |
| forecasts | forecast |
| games | game |
| teams | team |
| pointspread | spread |
| playbyplay | pbp |
| seasons | season |
| transactions | trans |
https://api4.natst.at/xxxx-xxxxxx/game;pbp,lineups,text/
Some nodes are populated automatically for each primary endpoint. games will always return players,playerperfs,venue,officials nodes. players will always return a current_season node, based on the current season or a range-specified four-digit season code. teams will always return elo,tcr nodes. Please note that these may be changed or adjusted as the beta period progresses, and will be noted in the changelog.
Please note that not all sports return data for each endpoint. Please refer to the endpoint reference for details.
⓸ The third path parameter is one of the 30 sport data service codes (case-insensitive, but lowercase prefered). This is the full dictionary of valid data service codes.
| 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 | Korea 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 |
https://api4.natst.at/xxxx-xxxxxx/games/nba/
⓹ The fourth (optional) path parameter is a "range" that limits the scope of returned data.
Season: The four-digit year of the date when the season ends. The default is the current season. A full list of available seasons can be found at the seasons endpoint.
https://api4.natst.at/xxxx-xxxxxx/games/milb/2025Date(s): In YYYY-MM-DD format. Supplying two dates will return an inclusive range of results.
https://api4.natst.at/xxxx-xxxxxx/pointspread/kbo/2025-04-12Code: A non case-sensitive team, player or league code. A full list of team codes can be retrieved at the teamcodes endpoint. A full list of team codes can be retrieved at the /leaguecodes endpoint. Player codes can be retrieved at the playercodes endpoint.
https://api4.natst.at/xxxx-xxxxxx/games/fc/eng-preData Format: Data from the National Statistical API is available in three different convenient formats. Specify which format to return with a format query parameter. If no data format is specified, the API will return JSON-formatted data by default.
https://api4.natst.at/xxxx-xxxxxx/venues/wnba/xml
json JavaScript Object Notation (default) xml Extensible Markup Language php PHP SimpleXML Object Search Term: If a comma-separated value does not match of the above data types, the API will automatically assume that it is intended as a search term. Please note that the API will only accept the first entry in a comma-separated string as a search term, and ignore any that follow.
https://api4.natst.at/xxxx-xxxxxx/players/nba/curryValues may be used in combination to further refine a search.
https://api4.natst.at/xxxx-xxxxxx/games/mlb/2024-05-09,2024-05-15,bos
⓺ A fifth (optional) path parameter is a paginated "offset" number for recordsets. The default is 0, the beginning of the recordset.
https://api4.natst.at/xxxx-xxxxxx/seasons/nba/_/100