Discover/StatMuse API
live

StatMuse 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.

Endpoint health
verified 9h ago
get_player_stats
get_team_info
ask
search_suggestions
4/4 passing latest checkself-healing
Endpoints
4
Updated
22d ago

What is the StatMuse 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.

Try it
Timeframe for stats (e.g., 'last 10 games', '2024-25 season', 'career')
Full name of the player (e.g., 'LeBron James', 'Stephen Curry')
api.parse.bot/scraper/6546515f-73d6-44cc-b3e2-2cafc0b022b1/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
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'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace statmuse-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: StatMuse SDK — ask sports questions, get structured stats."""
from parse_apis.statmuse_api import StatMuse, QueryFailed

client = StatMuse()

# Ask a general sports trivia question — returns a typed Answer.
answer = client.answers.ask(query="Who has the most points in NBA history?")
print(f"Q: {answer.query}")
print(f"A: {answer.answer}")

# Access structured stat tables from the answer.
for table in answer.tables:
    print(f"  Table: {table.title}, rows: {len(table.rows)}")

# Get a specific player's recent game log.
player_answer = client.answers.player_stats(player_name="Stephen Curry", timeframe="last 5 games")
print(f"\nPlayer query: {player_answer.query}")
print(f"Summary: {player_answer.answer}")
if player_answer.tables:
    first_row = player_answer.tables[0].rows[0]
    print(f"  First game: {first_row}")

# Get team info with a custom query type.
team_answer = client.answers.team_info(team_name="Lakers", query_type="historical record")
print(f"\nTeam query: {team_answer.query}")
print(f"Summary: {team_answer.answer}")

# Typed error handling — catch QueryFailed for bad queries.
try:
    client.answers.ask(query="xyznonexistent player stats career")
except QueryFailed as exc:
    print(f"\nQuery failed: {exc}")

# Autocomplete suggestions — discover players/teams before querying.
for section in client.suggestions.search(query="Giannis", limit=5):
    print(f"\nSection type: {section.type}")
    for s in section.suggestions:
        print(f"  {s.display} ({s.league}, {s.type})")

print("\nExercised: answers.ask / answers.player_stats / answers.team_info / suggestions.search")
All endpoints · 4 totalmissing one? ·

Get detailed player statistics by providing a player name and optional timeframe. Constructs a natural language query internally and returns the answer with game-by-game or aggregated statistical tables. The timeframe is flexible natural language (e.g., 'last 10 games', '2024-25 season', 'career').

Input
ParamTypeDescription
timeframestringTimeframe for stats (e.g., 'last 10 games', '2024-25 season', 'career')
player_namerequiredstringFull name of the player (e.g., 'LeBron James', 'Stephen Curry')
Response
{
  "type": "object",
  "fields": {
    "url": "string — the StatMuse permalink 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 with column-name keys)"
  },
  "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 API

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.

Reliability & maintenanceVerified

The StatMuse API is a managed, monitored endpoint for statmuse.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when statmuse.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official statmuse.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
9h ago
Latest check
4/4 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • 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 ask endpoint
  • Populate a team dashboard with recent game logs via get_team_info with query_type set to 'stats last 10 games'
  • Implement autocomplete in a sports search bar using search_suggestions with league and type fields for categorization
  • Pull career statistics for historical player comparisons using the timeframe: 'career' parameter
  • Retrieve roster snapshots for any franchise by setting query_type to 'roster' in get_team_info
  • Aggregate cross-sport statistical trivia answers by querying the ask endpoint across NBA, NFL, MLB, and NHL subjects
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does StatMuse have an official developer API?+
StatMuse does not publish a documented public developer API. Their platform is designed for end-user natural language queries on statmuse.com, not programmatic data access.
What does the `tables` field in the response actually contain?+
Each object in the 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?+
No play-by-play breakdowns or live in-game scores are currently exposed. The API covers aggregated player stats, team game logs, historical records, and natural language answer summaries. You can fork the API on Parse and revise it to add an endpoint targeting live or play-by-play data if StatMuse surfaces that information.
Can I filter `get_player_stats` results by specific statistical categories, such as only three-point shooting?+
There is no dedicated filter parameter for individual stat categories. Filtering is expressed through the 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.
How fresh is the data returned by these endpoints?+
The data reflects whatever StatMuse currently shows for a given query. StatMuse updates its statistics after games complete, so results for ongoing seasons are generally current to recent completed games, but there is no guaranteed real-time freshness or a response field indicating a last-updated timestamp.
Page content last updated . Spec covers 4 endpoints from statmuse.com.
Related APIs in SportsSee all →
stats.ncaa.org API
Access comprehensive NCAA sports statistics to search for players, teams, and coaches, view game box scores and play-by-play data, and review team schedules, rosters, and rankings. Get detailed head coach records and scoreboard information to analyze performance across college sports.
baseball-reference.com API
Access comprehensive MLB and college baseball (NCAA Division I) statistics from Baseball-Reference. Retrieve player career and season stats, team rosters and performance data, game box scores, season schedules, league leaders, and college conference standings — all from a single API.
whoscored.com API
Search for players and teams, then dive deep into their performance metrics, match statistics, and detailed passing data to analyze football games and player abilities. Get comprehensive insights on team performance, individual player stats, and play-by-play event information to power your football analysis and decision-making.
stathead.com API
Search and analyze NFL player performance on a game-by-game basis. Access detailed football statistics — passing, rushing, receiving, and more — filterable by season, team, game type, or statistical thresholds.
footystats.org API
Get live football scores, team performance metrics, league standings, and head-to-head match statistics all in one place. Search teams and leagues to access detailed player stats, comprehensive analytics, and in-depth performance data across football competitions worldwide.
soccerstats.com API
Access comprehensive soccer statistics including live league tables, match details, team performance metrics, and form rankings across multiple football leagues. Search for specific teams and analyze their season statistics, head-to-head records, and competitive standings to stay informed on the latest soccer data.
statshub.com API
Access detailed football match statistics including xG, xGA, and possession metrics across multiple leagues, plus retrieve fixtures by date and current league standings. Get comprehensive season-level and match-level performance data to analyze team and player statistics in depth.
espn.com API
Get live scores, schedules, standings, teams, rosters, athlete profiles, game logs, and league news across major sports from ESPN.