---
title: "Team stats"
method: POST
path: "/v1/get_team_stats"
tags: ["Stats + aggregation"]
---

# Team stats

`POST /v1/get_team_stats`

## Request

- Base URL: `https://mcp.fastballapi.com`
- URL: `https://mcp.fastballapi.com/v1/get_team_stats`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Use for team offence and run prevention for a season: runs per game for and against, run differential, and batting and opponents' batting (AVG, OBP, SLG, OPS, K%, BB%, HR) from every plate appearance. Costs 5 credits.

## Request body

- object
  - `season` union: Season (a year, e.g. 2025; default: the latest).
    - number
    - string
  - `team` string
  - `league` 'mlb' | 'ncaabase': League. Defaults to mlb. One of: mlb, ncaabase.

## Response `200`

The result, wrapped in data.

- object
  - `data` object, required
    - `season` number, nullable, required
    - `teams` object[], required
    - `count` number, required
    - `method` string, required

## Other responses

- `400`: Invalid arguments.
- `401`: Missing or invalid API key.
- `402`: Not enough credits.
- `429`: Rate limited.

---

[API](https://skmtc.dev/fastballapi/apis/fastballapi-api.md) · [All operations](https://skmtc.dev/fastballapi/apis/fastballapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/fastballapi/apis/fastballapi-api/revisions/ea9aaf113d7f?raw)
