statmuse.com APIstatmuse.com ↗
Query NBA, NFL, MLB, and NHL player and team statistics using natural language via the StatMuse API. Get structured stat tables, answers, and search suggestions.
curl -X GET 'https://api.parse.bot/scraper/6546515f-73d6-44cc-b3e2-2cafc0b022b1/get_player_stats?timeframe=last+10+games&player_name=LeBron+James' \ -H 'X-API-Key: $PARSE_API_KEY'
Get detailed player statistics by providing a player name and optional timeframe. Constructs a natural language query and returns the answer with game-by-game or aggregated statistical tables.
| Param | Type | Description |
|---|---|---|
| timeframe | string | Timeframe for stats (e.g., 'last 10 games', '2023-24 season', 'career') |
| player_namerequired | string | Full name of the player (e.g., 'LeBron James') |
{
"type": "object",
"fields": {
"url": "string — the StatMuse URL for this query",
"query": "string — the constructed query sent to StatMuse",
"answer": "string — natural language answer summary",
"tables": "array of objects, each with 'title' (string) and 'rows' (array of stat row objects)"
},
"sample": {
"data": {
"url": "https://www.statmuse.com/ask?query=LeBron+James+stats+last+10+games",
"query": "LeBron James stats last 10 games",
"answer": "LeBron Jameshas averaged 23.2 points, 7.3 assists and 6.7 rebounds in 10 games in his last 10 games.",
"tables": [
{
"rows": [
{
"TM": "LAL",
"AST": "13",
"OPP": "HOU",
"PTS": "19",
"REB": "8",
"DATE": "4/18/2026",
"NAME": "LeBron James"
}
],
"title": "Results"
}
]
},
"status": "success"
}
}About the statmuse.com API
The StatMuse API exposes 4 endpoints for querying sports statistics across NBA, NFL, MLB, NHL, and other leagues using natural language. The ask endpoint accepts any sports question in plain English and returns a text answer alongside structured stat tables. Player-focused requests go through get_player_stats, which accepts a player name and optional timeframe and delivers aggregated or game-by-game rows. Autocomplete support is available via search_suggestions.
Endpoints and What They Return
The ask endpoint is the most flexible entry point: pass any query string — for example, "Who has the most points in NBA history?" — and receive an answer string summarizing the result plus a tables array. Each table object carries a title and a rows array of stat row objects whose columns depend on the query. The url field in every response links back to the corresponding StatMuse page.
get_player_stats narrows the focus to a single athlete. Supply player_name as a required input and optionally pass a timeframe value such as 'last 10 games', '2023-24 season', or 'career'. The endpoint constructs a natural language query internally, visible in the query field of the response, and returns the same answer + tables structure. Rows in the tables reflect whatever statistical columns StatMuse surfaces for that player and timeframe.
Team Data and Search Suggestions
get_team_info works similarly to the player endpoint but targets franchises. Pass a team_name (e.g., 'Golden State Warriors') and an optional query_type such as 'stats last 10 games', 'historical record', or 'roster'. The response shape is identical — url, query, answer, and tables — making it straightforward to handle player and team responses with the same parsing logic.
search_suggestions accepts a partial query string and returns a sections array. Each section has a type field and a suggestions array where each item includes display text, image_url, league, and type. This is useful for building typeahead UIs or resolving ambiguous team and player names before sending a full query.
- Build a fantasy sports assistant that fetches per-player stat tables for any timeframe using
get_player_stats - Power a sports chatbot that answers arbitrary fan questions by passing free-text queries to the
askendpoint - Populate a team dashboard with recent game logs via
get_team_infowithquery_typeset to 'stats last 10 games' - Implement autocomplete in a sports search bar using
search_suggestionswithleagueandtypefields for categorization - Pull career statistics for historical player comparisons using the
timeframe: 'career'parameter - Retrieve roster snapshots for any franchise by setting
query_typeto 'roster' inget_team_info - Aggregate cross-sport statistical trivia answers by querying the
askendpoint across NBA, NFL, MLB, and NHL subjects
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does StatMuse have an official developer API?+
What does the `tables` field in the response actually contain?+
tables array has a title string describing what the table covers and a rows array of stat row objects. The specific keys in each row depend on the query — for example, a game-log query will include per-game columns like points, assists, and rebounds, while a career query may return season-by-season aggregates.Does the API return play-by-play data or live game scores?+
Can I filter `get_player_stats` results by specific statistical categories, such as only three-point shooting?+
timeframe input and the natural language query that gets constructed from it. The columns returned in rows reflect what StatMuse includes for that query. You can fork the API on Parse and revise the query construction logic to target more specific statistical breakdowns.