{
  "openapi": "3.0.1",
  "info": {
    "title": "MLB Stats API Scraper: Box Scores, Game Logs & Standings",
    "description": "MLB and minor league baseball data from the official MLB Stats API: games and scores with line scores, player box scores, player game logs, season stats, standings and rosters. Triple-A to Rookie too. No API key, no login. Pay per record.",
    "version": "0.1",
    "x-build-id": "7RcRwty7B4hjWChrr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themineworks~mlb-stats-api-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themineworks-mlb-stats-api-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/themineworks~mlb-stats-api-scraper/runs": {
      "post": {
        "operationId": "runs-sync-themineworks-mlb-stats-api-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/themineworks~mlb-stats-api-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-themineworks-mlb-stats-api-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": {
          "dataType": {
            "title": "What to collect",
            "enum": [
              "games",
              "boxScores",
              "playerGameLogs",
              "playerSeasonStats",
              "standings",
              "rosters"
            ],
            "type": "string",
            "description": "One data type per run. Games and box scores use the dates below; the other types use the season.",
            "default": "games"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day, YYYY-MM-DD, for games and box scores. Leave empty for yesterday (US Eastern time), the latest day whose games are all finished."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day, YYYY-MM-DD. Leave empty for the start date only. Up to 366 days per run."
          },
          "season": {
            "title": "Season",
            "minimum": 1876,
            "maximum": 2100,
            "type": "integer",
            "description": "Year, for game logs, season stats, standings and rosters. Leave empty for the current season (last year in January and February)."
          },
          "level": {
            "title": "Level",
            "enum": [
              "mlb",
              "aaa",
              "aa",
              "high_a",
              "single_a",
              "rookie"
            ],
            "type": "string",
            "description": "Major League Baseball or a minor league level.",
            "default": "mlb"
          },
          "teams": {
            "title": "Teams",
            "type": "array",
            "description": "Keep only these teams: a name (New York Yankees), nickname (Yankees), abbreviation (NYY) or MLB team id (147). For game logs, the active roster of each team is used when no players are given.",
            "items": {
              "type": "string"
            }
          },
          "players": {
            "title": "Players",
            "type": "array",
            "description": "Full name (Aaron Judge) or MLB player id (592450). Required for game logs unless teams are set; a filter for box scores and season stats.",
            "items": {
              "type": "string"
            }
          },
          "statGroups": {
            "title": "Stat groups",
            "type": "array",
            "description": "For game logs and season stats. Leave empty for hitting and pitching.",
            "items": {
              "type": "string",
              "enum": [
                "hitting",
                "pitching",
                "fielding"
              ],
              "enumTitles": [
                "Hitting",
                "Pitching",
                "Fielding"
              ]
            }
          },
          "gameTypes": {
            "title": "Game types",
            "type": "array",
            "description": "Leave empty for the regular season and postseason. Season stats use the regular season when it is selected.",
            "items": {
              "type": "string",
              "enum": [
                "R",
                "F",
                "D",
                "L",
                "W",
                "S",
                "E",
                "A"
              ],
              "enumTitles": [
                "Regular season",
                "Wild Card",
                "Division Series",
                "League Championship Series",
                "World Series",
                "Spring training",
                "Exhibition",
                "All-Star Game"
              ]
            }
          },
          "rosterType": {
            "title": "Roster type",
            "enum": [
              "active",
              "40Man",
              "fullSeason",
              "depthChart"
            ],
            "type": "string",
            "description": "For rosters.",
            "default": "active"
          },
          "standingsType": {
            "title": "Standings type",
            "enum": [
              "regularSeason",
              "wildCard",
              "springTraining"
            ],
            "type": "string",
            "description": "For standings.",
            "default": "regularSeason"
          },
          "maxResults": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop after this many rows. A day of box scores is about 430 rows, a season of standings 30.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}