API v4 Documentation

Endpoints Code Lookup

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 EndpointValid Secondary Endpoints
teamsgames,players,stats,teamperfs,transactions,news,videos,text
playersseasons,playerperfs,playbyplay,projline,transactions,news,videos
gamesplaybyplay,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).

EndpointAlternate Name(s)
datastatusstatus
forecastsforecast
gamesgame
teamsteam
pointspreadspread
playbyplaypbp
seasonsseason
transactionstrans

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.

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
KBOKorea 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

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/2025

Date(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-12

Code: 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-pre

Data 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

jsonJavaScript Object Notation (default)
xmlExtensible Markup Language
phpPHP 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/curry

Values 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