

## Top three by win% [#top-three-by-win]

```bash title="standings.sh"
curl -H "X-API-Key: $STATSHAWK_KEY" \
  "https://api.statshawk.ai/v1/competitions/nba/editions/2026/standings" \
  | jq '.data.items
        | sort_by(-.pct)[0:3]
        | .[] | "\(.team.name // .entrant)  \(.wins)-\(.losses)-\(.ties)  pct=\(.pct)"'
```

## Python [#python]

```python title="standings.py"
import os, requests
KEY = os.environ["STATSHAWK_KEY"]

rows = requests.get(
    "https://api.statshawk.ai/v1/competitions/nba/editions/2026/standings",
    headers={"X-API-Key": KEY},
).json()["data"]["items"]

for i, r in enumerate(sorted(rows, key=lambda row: row["pct"], reverse=True)[:3], start=1):
    team = r["team"]["name"] if r["team"] else r["entrant"]
    print(f"{i}. {team:<25} {r['wins']:>2}-{r['losses']:<2}-{r['ties']:<2}  pct={r['pct']:.3f}")
```

<PlaygroundLink href="/docs/api">
  Open the competition standings endpoint in the playground →
</PlaygroundLink>
