# Get a team's player leaderboard (v1)

Returns the team's top players for one leaderboard in one format, optionally for one year and opponent, plus the years and opponents on offer.

- Platform: Cricbuzz
- Request: `GET https://api.toolzerhub.com/v1/cricbuzz/team/stats`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/cricbuzz/teams/get-team-stats

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `team_id` | query | yes | integer | Team id, from List Teams or a match's teamId. |
| `stat` | query | no | enum: mostRuns, highestScore, highestAvg, highestSr, mostHundreds, mostFifties, mostFours, mostSixes, mostNineties, mostWickets, lowestAvg, bestBowlingInnings, mostFiveWickets, lowestEcon, lowestSr | Leaderboard: batting mostRuns, highestScore, highestAvg, highestSr, mostHundreds, mostFifties, mostFours, mostSixes, mostNineties; bowling mostWickets, lowestAvg, bestBowlingInnings, mostFiveWickets, lowestEcon, lowestSr. Default: mostRuns. |
| `format` | query | no | enum: test, odi, t20 | test, odi or t20. Default: test. |
| `year` | query | no | string | Year, or all. Default: all. |
| `opponent` | query | no | string | Opponent team id, or all. Default: all. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/cricbuzz/team/stats?team_id=<team_id>" \
  -H "x-api-key: $TOOLZERHUB_API_KEY"
```

Success responses are wrapped as `{ "data": ... }`. Errors return `{ "error": { "code", "status", "message", "retryable", "details" } }`. See https://docs.toolzerhub.com/docs/responses-and-errors.
