# MLB box scores: batting and pitching lines for every game

**Use case:** 

Every MLB game of a season as one row per player: at-bats, runs, hits, RBIs, home runs, walks, strikeouts and AVG/OBP/SLG for batters; innings (also as outs), hits, runs, earned runs, walks, strikeouts, pitches, strikes and ERA for pitchers. Max rows is 1,000 for a quick preview — set it to 0 for the whole season.

## Input

```json
{
  "leagues": [
    "mlb"
  ],
  "output": "playerStats",
  "mode": "seasons",
  "daysBack": 1,
  "daysAhead": 0,
  "seasons": [
    "2026"
  ],
  "lastSeasons": 1,
  "seasonTypes": [
    "regular",
    "postseason"
  ],
  "statuses": [
    "finished",
    "live",
    "scheduled"
  ],
  "includeDidNotPlay": false,
  "maxItems": 1000,
  "concurrency": 8
}
```

## Output

```json
{
  "league": {
    "label": "League"
  },
  "startTime": {
    "label": "Game (UTC)",
    "format": "date"
  },
  "player": {
    "label": "Player"
  },
  "team": {
    "label": "Team"
  },
  "opponent": {
    "label": "Opponent"
  },
  "result": {
    "label": "W/L"
  },
  "position": {
    "label": "Pos"
  },
  "starter": {
    "label": "Starter",
    "format": "boolean"
  },
  "stats": {
    "label": "Stats"
  }
}
```

## About this Actor

This example demonstrates how to use [ESPN Scraper: Box Scores & Player Stats (NFL, NBA, MLB, NHL)](https://apify.com/sports-odds-lab/espn-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/sports-odds-lab/espn-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/sports-odds-lab/espn-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
