statshawk
Cookbook

Player gamelog

Recent stat lines for any person, normalized across competitions.

Recent stat lines

player_gamelog.py
import os, requests
KEY = os.environ["STATSHAWK_KEY"]

r = requests.get(
    "https://api.statshawk.ai/v1/persons",
    headers={"X-API-Key": KEY},
    params={"q": "Jayson Tatum", "limit": 1},
    timeout=10,
)
person_id = r.json()["data"]["items"][0]["id"]

gl = requests.get(
    f"https://api.statshawk.ai/v1/persons/{person_id}/game-log",
    headers={"X-API-Key": KEY},
    params={"competition": "nba", "season": 2026},
).json()["data"]["items"][:10]

for g in gl:
    phase = next(p for p in g["line"]["phases"] if "basketball" in p["phase"])
    s = phase["measures"]
    print(f"{g['game']}  {s.get('pts', 0):>3} PTS  {s.get('reb', 0):>2} REB  {s.get('ast', 0):>2} AST")
Try the person game-log endpoint in the playground →

On this page