

## Recent stat lines [#recent-stat-lines]

```python title="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")
```

<Callout type="info" title="phase measures are sport-specific">
  Each row has `line.phases[]`, and each phase has a `measures` object. NBA rows carry
  keys such as `pts`, `reb`, and `ast`; MLB rows may carry `batting` and `pitching`
  phase blocks. See
  [`PersonGameLogEntry`](/docs/reference/data-model/persons/PersonGameLogEntry) and the
  per-sport [stat lines](/docs/reference/data-model/stat-lines/BasketballPlayerGameLine)
  in the data model.
</Callout>

<PlaygroundLink href="/docs/api">
  Try the person game-log endpoint in the playground →
</PlaygroundLink>
