INDEPENDENT DEVELOPER REFERENCE
NBA game logs API for player statistics
Build an NBA player game log from retained ESPN box scores: season years, stat keys, cursor pagination and why you must sort rows yourself.
Editorial review: · Not a live coverage report
The request
Use /api/v1/stats/player-games. sport and season are required, and NBA seasons use the ending year: season=2027 is 2026-27 and season=2026 is 2025-26. Independent ESPN statistics cover NBA, NFL and NHL as limited retained game samples, not full seasons. As of 2026-11-03 those samples were captured after the games were played, so they do not show what was known at game time.
curl --fail-with-body "https://draftkingsapi.com/api/v1/stats/player-games?sport=NBA&season=2027&completed=true&limit=50" \
-H "Authorization: Bearer $DRAFTKINGS_API_KEY"Add athlete_id or team_id to narrow, event_id for one game, and from and to for a date range. Both take an ISO 8601 offset timestamp or YYYY-MM-DD.
Find an athlete ID
IDs are numeric ESPN IDs of 1 to 20 digits. There is no name search. List a page of rows, read data.name and data.athlete_id, then filter by that ID. Filter by team_id first to keep the search small.
python3 player-game-log.py --sport NBA --season 2027 --max-pages 1Read the response
NBA player rows use the category boxscore. Each entry of stats has key, label, display, numeric and scope. Compound values such as fieldGoalsMade-fieldGoalsAttempted display as 1-3 with null numeric, so split the display string yourself if you need the parts.
| key | label | numeric |
|---|---|---|
minutes | MIN | Number |
points | PTS | Number |
rebounds | REB | Number |
assists | AST | Number |
steals, blocks, turnovers | STL, BLK, TO | Number |
fieldGoalsMade-fieldGoalsAttempted | FG | Null, display only |
threePointFieldGoalsMade-threePointFieldGoalsAttempted | 3PT | Null, display only |
plusMinus | +/- | Number |
Sort the rows yourself
Pages are ordered by a cursor built from event, athlete and category, not by date. Each row carries its game under game, so sort on game.starts_at after you collect the pages. Reading a player's last five games needs the sort first.
rows.sort(key=lambda r: r["game"]["starts_at"], reverse=True)
for row in rows[:5]:
values = {s["key"]: s["numeric"] for s in row["data"]["stats"]}
print(row["game"]["starts_at"][:10], values.get("minutes"), values.get("points"))Follow the cursor
Statistics use cursor pagination. limit is 1 to 200, default 50. Pass pagination.next as after and stop when has_more is false. offset and format=csv are rejected. An empty matching page returns available: false. Pagination is not a frozen export.
Handle preseason and inactive players
Season 2027 can include games from before the regular season. game.season_type carries the source value, and we saw 2 on a regular-season game. Confirm the values in your rows before you mix game types. Also check did_not_play, because a player who did not play has no meaningful stat line.
What a game log cannot tell you
The evidence clock on each game shows when the capture happened, not what was known at tip-off. Original observations can be later than the game. These rows are not a sportsbook prop archive, not an as-of correction history and not grading. Read evidence and the coverage report before citing a sample.
Try it
Replace ID with an athlete ID returned by the listing step.
python3 player-game-log.py --sport NBA --season 2027 --athlete-id ID --stat points --max-pages 3Check the recorded data
Questions
How many NBA games are stored?
Limited samples, not full seasons. Read the coverage report and each response's available and coverage fields. A valid season filter does not promise that every game is stored.
What season value is the 2026-27 NBA season?
Use season=2027. NBA and NHL use the ending year. NFL uses the starting year.
Why are game log rows out of date order?
Pages follow a stable cursor based on event, athlete and category rather than a date. Collect the pages you need, then sort on game.starts_at.
Can I export a game log as CSV?
The statistics endpoints are JSON only and reject format=csv. Convert the rows on your side.
Related resources
Pair NBA Points rows from Pick6 with ESPN player points from the statistics API, and see where the join and the history stop.
Build a baseline NBA points prop modelBuild a chronological NBA points baseline from recorded box scores, score it on later games and compare with Pick6 targets you recorded yourself.
Build a prop model baseline in PythonA walkthrough of a standard-library Python baseline: cursor pagination, numeric stat parsing, a SQLite cache and MAE on a later held-out window.
DraftKings API pagination: offset, after and cursorsThree pagination styles with working loops: offset lists, the Pick6 next_after sequence and statistics cursors, plus their limits.
Independent service operated by DD Inc., not affiliated with or endorsed by DraftKings. Technical access is not a redistribution license. No wagering: this service does not place, recommend or settle entries or bets. Check sources and status for actual capture context.