{
  "openapi": "3.0.1",
  "info": {
    "title": "MLB Stats Scraper — Standings, Schedules & Player Stats",
    "description": "MLB (mlb.com) standings, schedules and results, team and player season stats and league leaders from MLB's own stats API, one clean row each. Run it again or on a schedule to see rank changes, games that changed status or score, and stat movement since the last run. No login.",
    "version": "0.1",
    "x-build-id": "UTyrBff8u4rUynwET"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/northbell~mlb-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-northbell-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/northbell~mlb-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-northbell-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/northbell~mlb-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-northbell-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 get",
            "enum": [
              "standings",
              "schedule",
              "teamStats",
              "playerStats",
              "leaders"
            ],
            "type": "string",
            "description": "Standings: one row per team (division, record, games back, streak, run differential). Schedule: one row per game (score, status, venue, probable and deciding pitchers). Team stats: one row per team (batting, pitching, fielding). Player stats: one row per player. Leaders: the top players for each category you list.",
            "default": "standings"
          },
          "season": {
            "title": "Season",
            "minimum": 1876,
            "maximum": 2100,
            "type": "integer",
            "description": "The year, for example 2025. Leave empty for the current season (before opening day, the last finished one). Used by standings, team stats, player stats and leaders. Schedule mode uses Dates instead."
          },
          "dates": {
            "title": "Dates",
            "type": "string",
            "description": "Schedule mode: a day (2026-10-08), a range (2026-10-06 to 2026-10-09, up to 366 days) or today, yesterday, tomorrow, today+3. Empty means today (US Eastern time, the way MLB counts days). Standings mode: one day, to get the table as it stood on that day. Ignored by the other modes."
          },
          "teams": {
            "title": "Teams",
            "type": "array",
            "description": "Optional. Keep only these teams, one per line: an abbreviation (NYY, LAD), a team name (Yankees) or a full name (New York Yankees). Empty means all 30 teams. Leaders mode returns the leaders of each listed team instead of the league.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Leader categories",
            "type": "array",
            "description": "Leaders mode: one category per line, such as homeRuns, battingAverage, runsBattedIn, stolenBases, earnedRunAverage, strikeouts, saves, wins. Short names like HR, AVG, RBI, ERA and WHIP work too. Strikeouts means pitcher strikeouts; write hitting:strikeouts for batter strikeouts.",
            "default": [
              "homeRuns",
              "battingAverage",
              "earnedRunAverage",
              "strikeouts"
            ],
            "items": {
              "type": "string"
            }
          },
          "leadersPerCategory": {
            "title": "Leaders per category",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many places to return for each category (1 to 50). Players tied at the last place are all returned, so a category can give a few more rows.",
            "default": 10
          },
          "playerGroup": {
            "title": "Player stats: hitters or pitchers",
            "enum": [
              "both",
              "hitting",
              "pitching"
            ],
            "type": "string",
            "description": "Player stats mode: hitting lines, pitching lines or both. A player who bats and pitches appears once in each.",
            "default": "both"
          },
          "playerPool": {
            "title": "Player stats: which players",
            "enum": [
              "auto",
              "qualified",
              "all"
            ],
            "type": "string",
            "description": "Automatic: the qualified players of the league (enough plate appearances or innings to lead the rate stats), or everyone on the teams you list. Qualified: only those players. All: every player with at least one appearance.",
            "default": "auto"
          },
          "gameType": {
            "title": "Regular season or postseason",
            "enum": [
              "regular",
              "postseason"
            ],
            "type": "string",
            "description": "For team stats, player stats and leaders: the regular season, or the postseason games only. Standings are always the regular season. Schedule mode returns every kind of game in the dates you give.",
            "default": "regular"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}