# MLB Player Hitting Stats Scraper

**Use case:** 

Scrape season hitting statistics for MLB players by id. Get average, home runs, RBIs, OPS and more for analytics and fantasy baseball.

## Input

```json
{
  "maxItems": 50,
  "withDetails": true,
  "mode": "players",
  "season": 2025,
  "playerIds": [
    "592450",
    "660271",
    "545361",
    "547180",
    "608070"
  ],
  "statGroup": "hitting",
  "leagueId": "103,104"
}
```

## Output

```json
{
  "title": {
    "label": "Name",
    "format": "text"
  },
  "id": {
    "label": "ID",
    "format": "number"
  },
  "url": {
    "label": "URL",
    "format": "link"
  },
  "teamName": {
    "label": "Team",
    "format": "text"
  },
  "position": {
    "label": "Position",
    "format": "text"
  },
  "season": {
    "label": "Season",
    "format": "text"
  },
  "wins": {
    "label": "W",
    "format": "number"
  },
  "losses": {
    "label": "L",
    "format": "number"
  },
  "winningPct": {
    "label": "Pct",
    "format": "text"
  },
  "divisionRank": {
    "label": "Div Rank",
    "format": "text"
  },
  "gamesBack": {
    "label": "GB",
    "format": "text"
  },
  "homeRecord": {
    "label": "Home",
    "format": "object"
  },
  "awayRecord": {
    "label": "Away",
    "format": "object"
  },
  "lastTenRecord": {
    "label": "Last 10",
    "format": "object"
  },
  "divisionRecord": {
    "label": "vs Div",
    "format": "object"
  },
  "homeRuns": {
    "label": "HR",
    "format": "number"
  },
  "battingAverage": {
    "label": "AVG",
    "format": "text"
  },
  "ops": {
    "label": "OPS",
    "format": "text"
  },
  "era": {
    "label": "ERA",
    "format": "text"
  },
  "whip": {
    "label": "WHIP",
    "format": "text"
  },
  "careerStats": {
    "label": "Career",
    "format": "object"
  },
  "yearByYear": {
    "label": "By Season",
    "format": "array"
  },
  "homeScore": {
    "label": "Home",
    "format": "number"
  },
  "awayScore": {
    "label": "Away",
    "format": "number"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "observedAt": {
    "label": "Scraped",
    "format": "date"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## About this Actor

This example demonstrates how to use [MLB Player & Game Stats Scraper](https://apify.com/scrapers_lat/mlb-stats-scraper) with a specific input configuration. Visit the [Actor detail page](https://apify.com/scrapers_lat/mlb-stats-scraper) to learn more, explore other use cases, and run it yourself.