{
  "openapi": "3.0.1",
  "info": {
    "title": "MLB Stats Scraper",
    "description": "MLB Stats Scraper exports Major League Baseball data: schedules and scores with line scores and top performers, standings, teams, rosters with bios, player stat leaderboards, player profiles and league leaders. No login.",
    "version": "1.0",
    "x-build-id": "Gbv8wg357KKw53Kgu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neuro-scraper~mlb-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neuro-scraper-mlb-stats-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/neuro-scraper~mlb-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-neuro-scraper-mlb-stats-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/neuro-scraper~mlb-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-neuro-scraper-mlb-stats-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "schedule",
              "gameDetails",
              "standings",
              "teams",
              "players",
              "playerStats",
              "leaders"
            ],
            "type": "string",
            "description": "Which MLB data to collect. Each mode is explained in the README.",
            "default": "schedule"
          },
          "task": {
            "title": "Task (alternative name for the mode)",
            "enum": [
              "teams",
              "team_roster",
              "team_schedule",
              "standings",
              "player_stats",
              "game_boxscore",
              "schedule",
              "leaders"
            ],
            "type": "string",
            "description": "Same as 'What to scrape', with the task names other MLB tools use. When set, it is used instead of 'What to scrape'."
          },
          "seasons": {
            "title": "Seasons",
            "type": "array",
            "description": "One or more seasons, e.g. 2025 and 2026. Empty = the current season.",
            "items": {
              "type": "string"
            }
          },
          "season": {
            "title": "Season (single)",
            "minimum": 1876,
            "maximum": 2100,
            "type": "integer",
            "description": "Shortcut for one season, e.g. 2026. Merged with Seasons."
          },
          "date": {
            "title": "Date",
            "type": "string",
            "description": "Schedule / game details for one day, YYYY-MM-DD, e.g. 2026-09-01. Empty with no range = today."
          },
          "fromDate": {
            "title": "From date",
            "type": "string",
            "description": "Start of a date range (YYYY-MM-DD) for schedule / game details."
          },
          "toDate": {
            "title": "To date",
            "type": "string",
            "description": "End of the date range (YYYY-MM-DD). Empty = today."
          },
          "gameDates": {
            "title": "Game dates (several days)",
            "type": "array",
            "description": "Several single days, YYYY-MM-DD or YYYYMMDD (e.g. 20260901).",
            "items": {
              "type": "string"
            }
          },
          "gamePks": {
            "title": "Game IDs (gamePk)",
            "type": "array",
            "description": "Specific games by MLB game id, e.g. 824472. Used by schedule and game details.",
            "items": {
              "type": "string"
            }
          },
          "gamePk": {
            "title": "Game ID (single)",
            "minimum": 1,
            "type": "integer",
            "description": "One MLB game id. Merged with Game IDs."
          },
          "gameId": {
            "title": "Game ID (other name)",
            "minimum": 1,
            "type": "integer",
            "description": "Same as Game ID (single), under the name other tools use."
          },
          "teamIds": {
            "title": "Team IDs",
            "type": "array",
            "description": "Limit to these MLB team ids, e.g. 147 (Yankees), 119 (Dodgers), 111 (Red Sox). Empty = all teams.",
            "items": {
              "type": "string"
            }
          },
          "teamId": {
            "title": "Team ID (single)",
            "minimum": 1,
            "type": "integer",
            "description": "One MLB team id. Merged with Team IDs."
          },
          "playerIds": {
            "title": "Player IDs",
            "type": "array",
            "description": "Player stats mode: these MLB person ids (e.g. 660271 = Shohei Ohtani) with bio, season and career stats.",
            "items": {
              "type": "string"
            }
          },
          "playerId": {
            "title": "Player ID (single)",
            "minimum": 1,
            "type": "integer",
            "description": "One MLB person id. Merged with Player IDs."
          },
          "leagueId": {
            "title": "League",
            "enum": [
              "both",
              "AL",
              "NL"
            ],
            "type": "string",
            "description": "Teams, players, standings and player stats: one league or both.",
            "default": "both"
          },
          "statGroup": {
            "title": "Stat group",
            "enum": [
              "hitting",
              "pitching",
              "fielding"
            ],
            "type": "string",
            "description": "Statistics for player stats and leaders modes.",
            "default": "hitting"
          },
          "gameType": {
            "title": "Game type",
            "enum": [
              "ALL",
              "R",
              "S",
              "P",
              "F",
              "D",
              "L",
              "W",
              "A",
              "E"
            ],
            "type": "string",
            "description": "Which games (schedule, game details) or which part of the season (player stats, leaders).",
            "default": "ALL"
          },
          "seasonType": {
            "title": "Season type (shortcut)",
            "enum": [
              "any",
              "regular",
              "post",
              "spring"
            ],
            "type": "string",
            "description": "Shortcut for Game type. Used only when Game type is All.",
            "default": "any"
          },
          "includeTopPerformers": {
            "title": "Include top performers and game info",
            "type": "boolean",
            "description": "Schedule mode: add each game's top performers (batting / pitching lines), attendance, weather and duration.",
            "default": true
          },
          "playerPool": {
            "title": "Player pool (player stats)",
            "enum": [
              "ALL",
              "QUALIFIED",
              "ROOKIES"
            ],
            "type": "string",
            "description": "Which players the leaderboard lists. Qualified = enough plate appearances / innings for rate stats.",
            "default": "QUALIFIED"
          },
          "sortStat": {
            "title": "Sort by stat (player stats)",
            "type": "string",
            "description": "Leaderboard order, e.g. homeRuns, battingAverage, onBasePlusSlugging, earnedRunAverage, strikeouts. Empty = OPS (hitting), ERA (pitching)."
          },
          "sortOrder": {
            "title": "Sort order (player stats)",
            "enum": [
              "auto",
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Order of the leaderboard.",
            "default": "auto"
          },
          "leaderCategories": {
            "title": "Leader categories",
            "type": "array",
            "description": "Leaders mode: e.g. homeRuns, battingAverage, runsBattedIn, stolenBases, earnedRunAverage, strikeouts, wins, saves.",
            "items": {
              "type": "string"
            }
          },
          "leaderCategory": {
            "title": "Leader category (single)",
            "type": "string",
            "description": "One leader category (homeRuns, battingAverage, rbi, wins, era, strikeouts). Merged with Leader categories."
          },
          "rosterType": {
            "title": "Roster type (players)",
            "enum": [
              "active",
              "40Man",
              "fullSeason",
              "fullRoster",
              "depthChart",
              "allTime"
            ],
            "type": "string",
            "description": "Which roster the players mode reads.",
            "default": "active"
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the run after this many rows (0 = no total limit).",
            "default": 200
          },
          "maxItemsPerSeason": {
            "title": "Max rows per season (players, stats, leaders)",
            "minimum": 0,
            "type": "integer",
            "description": "Players / player stats: rows per season (0 = all). Leaders: players per category (0 = 10).",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max parallel requests",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "How many requests run at the same time (box scores, rosters).",
            "default": 8
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "When the run ends, the rows are also POSTed as JSON to this URL (Zapier, Make, n8n or your own endpoint)."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxy is the default.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}