

## Ten-line hit rate [#ten-line-hit-rate]

```python title="hit_rate.py"
import os, requests
KEY = os.environ["STATSHAWK_KEY"]
BASE = "https://api.statshawk.ai/v1"

person = requests.get(
    f"{BASE}/persons",
    headers={"X-API-Key": KEY},
    params={"q": "Jayson Tatum", "limit": 1},
    timeout=10,
).json()["data"]["items"][0]

card = requests.get(
    f"{BASE}/analysis/player-prop",
    headers={"X-API-Key": KEY},
    params={"person_id": person["id"], "stat": "pts", "line": 27.5, "competition": "nba"},
    timeout=10,
).json()["data"]

hit_rate = card["hit_rate"]
print(f"{card['person']['bio']['full_name']} pts over {hit_rate['line']}")
print(f"{hit_rate['hits']}/{hit_rate['games']}  ({hit_rate['over_rate']:.0%} hit rate)")
print(f"Verdict: {'LEAN OVER' if hit_rate['over_rate'] >= 0.6 else 'PASS'}")
```

<Callout type="tier">
  This recipe hits `/analysis/player-prop` — 10× weight, paid tier. The plain `/game-log`
  endpoint in the [Player gamelog](/docs/cookbook/player-gamelog) recipe is free-tier and
  lets you compute hit rate yourself if you don't need the pre-shaped card.
</Callout>

<PlaygroundLink href="/docs/api">
  Open /analysis/player-prop in the playground →
</PlaygroundLink>
