{
  "openapi": "3.0.1",
  "info": {
    "title": "MLB Statcast Pitch-by-Pitch Data Scraper",
    "description": "Scrape every MLB pitch with Statcast tracking: velocity, spin rate, movement, release point, plate location, plus exit velocity and launch angle on balls in play. Adds computed approach angle, perceived velocity and barrel classification MLB does not publish. No API key, no login, no proxy.",
    "version": "1.0",
    "x-build-id": "K8OV97eUH704XVpUK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/incognito_mode~mlb-statcast-pitch-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-incognito_mode-mlb-statcast-pitch-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/incognito_mode~mlb-statcast-pitch-scraper/runs": {
      "post": {
        "operationId": "runs-sync-incognito_mode-mlb-statcast-pitch-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/incognito_mode~mlb-statcast-pitch-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-incognito_mode-mlb-statcast-pitch-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": {
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "First game date to scrape (YYYY-MM-DD). Leave both dates empty and the Actor scrapes the most recent slate that was actually played — so a run with nothing filled in returns real pitches in February as well as in July."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Last game date to scrape (YYYY-MM-DD), inclusive. Defaults to \"Date from\". Maximum 31 days per run — use \"Max games\" to control what a wide range actually costs."
          },
          "gamePks": {
            "title": "Game IDs",
            "type": "array",
            "description": "MLB game IDs (gamePk) to scrape directly, e.g. [824469]. Find one in any Gameday URL, or in the `gamePk` column of a previous run. Overrides the date range and the game-type filter — a game you name by ID is always fetched.",
            "items": {
              "type": "integer"
            }
          },
          "teamIds": {
            "title": "Team IDs",
            "type": "array",
            "description": "Only scrape games involving these MLB team IDs, e.g. [147] for the Yankees or [119] for the Dodgers. Filtered by MLB before the schedule is returned, so it makes a wide date range cheap rather than just smaller.",
            "items": {
              "type": "integer"
            }
          },
          "gameTypes": {
            "title": "Game types",
            "type": "array",
            "description": "Which kinds of game to include. Spring training and exhibition games are excluded by default: many of those parks have no tracking rig, so their pitches come back with every physics field empty.",
            "items": {
              "type": "string",
              "enum": [
                "R",
                "F",
                "D",
                "L",
                "W",
                "A",
                "S",
                "E"
              ],
              "enumTitles": [
                "Regular season",
                "Wild Card",
                "Division Series",
                "League Championship Series",
                "World Series",
                "All-Star Game",
                "Spring training",
                "Exhibition"
              ]
            },
            "default": [
              "R",
              "F",
              "D",
              "L",
              "W"
            ]
          },
          "pitcherIds": {
            "title": "Pitcher IDs",
            "type": "array",
            "description": "Keep only pitches thrown by these MLB person IDs, e.g. [694973] for Paul Skenes. MLB has no \"every pitch by this pitcher\" endpoint, so whole games are still read — but you are only charged for the rows you keep.",
            "items": {
              "type": "integer"
            }
          },
          "batterIds": {
            "title": "Batter IDs",
            "type": "array",
            "description": "Keep only pitches thrown to these MLB person IDs. Combine with \"Pitcher IDs\" to pull a single matchup.",
            "items": {
              "type": "integer"
            }
          },
          "maxGames": {
            "title": "Max games",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many games to read at most. A full MLB game is around 300 pitches, so this is the real cost control for a wide date range. The most recent matching games are kept.",
            "default": 5
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Hard cap on how many pitches are stored in the dataset. The run stops as soon as it is reached.",
            "default": 1000
          },
          "lookbackDays": {
            "title": "Lookback window (days)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Only used when no dates and no game IDs are given: how far back to look for the most recent slate. If nothing is found in this window the Actor widens the search to the whole previous season, so this rarely needs changing.",
            "default": 7
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave off. The MLB Stats API needs no key, no login and no proxy, so a normal run spends nothing here. If an IP is ever refused, the Actor escalates on its own — first to a datacenter proxy (included in every Apify plan, free tier included), rotating a few IPs, and only then to a residential one if your plan has them. Set this only to pin a specific proxy configuration from the start.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}