{
  "openapi": "3.0.1",
  "info": {
    "title": "ESPN Player Stats Scraper - NFL, NBA, MLB, NHL Box Scores",
    "description": "Scrape ESPN player stats, box scores and game logs for the NFL, NBA, MLB, NHL, WNBA, NCAA and soccer. One row per player per game, with every stat, team, opponent and score. Filter by date, team, player or position.",
    "version": "0.1",
    "x-build-id": "ebyB9td1kkWmXhida"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hgservices~espn-player-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hgservices-espn-player-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/hgservices~espn-player-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hgservices-espn-player-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/hgservices~espn-player-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hgservices-espn-player-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",
        "required": [
          "leagues"
        ],
        "properties": {
          "leagues": {
            "title": "Leagues",
            "type": "array",
            "description": "Leagues to get player stats from. Pick one or more. When you use Game IDs below, pick exactly one league.",
            "items": {
              "type": "string",
              "enum": [
                "nba",
                "wnba",
                "ncaam",
                "ncaaw",
                "nfl",
                "ncaaf",
                "mlb",
                "nhl",
                "mls",
                "epl",
                "laliga",
                "ucl"
              ],
              "enumTitles": [
                "NBA",
                "WNBA",
                "NCAA Men's Basketball",
                "NCAA Women's Basketball",
                "NFL",
                "NCAA Football",
                "MLB",
                "NHL",
                "MLS",
                "English Premier League",
                "La Liga",
                "UEFA Champions League"
              ]
            },
            "default": [
              "nfl"
            ]
          },
          "startDate": {
            "title": "Start Date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "First day to search. Pick a date, or enter a relative value such as '7 days', which counts back from today (US Eastern time). Most leagues do not play every day, so a range of a week finds games in any league that is in season. Maximum range is 31 days.",
            "default": "7 days"
          },
          "endDate": {
            "title": "End Date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Last day to search. Pick a date, or enter a relative value such as '1 day' for yesterday. Leave empty to use today, which includes live games with partial stats."
          },
          "gameStatus": {
            "title": "Game Status",
            "enum": [
              "all",
              "post",
              "in"
            ],
            "type": "string",
            "description": "Which games to pull. Live games give partial stats. Scheduled games have no stats, so they are never included.",
            "default": "all"
          },
          "teams": {
            "title": "Team Filter",
            "type": "array",
            "description": "Only return players on these teams. Use the team abbreviation (KC, LAL, NYY, LIV) or part of the team name (Chiefs, Lakers, Man City). Leave empty for all teams. Only games these teams played are fetched, so this also makes the run faster.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "players": {
            "title": "Player Name Filter",
            "type": "array",
            "description": "Only return players whose name contains one of these terms. Case insensitive, partial match (e.g. 'mahomes').",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "positions": {
            "title": "Position Filter",
            "type": "array",
            "description": "Only return these positions, by abbreviation (for example QB, WR, PG, C, SP, G). Leave empty for all positions. NFL and NCAA Football positions come from the current team roster, so a player who has left the team is not matched.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "statGroups": {
            "title": "Stat Group Filter",
            "type": "array",
            "description": "Only return these stat groups. NFL: passing, rushing, receiving, defensive, kicking, punting. MLB: batting, pitching. NHL: forwards, defenses, goalies. NBA and soccer use a single group named 'stats'.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "includeDidNotPlay": {
            "title": "Include Players Who Did Not Play",
            "type": "boolean",
            "description": "Include bench players with no stat line. Off by default, because these rows are empty.",
            "default": false
          },
          "eventIds": {
            "title": "Game IDs",
            "type": "array",
            "description": "ESPN games to fetch directly. Enter the game ID, for example 401872947 (the number after /gameId/ in an ESPN game page URL), or paste the whole URL. When set, Start Date and End Date are ignored. Requires exactly one league.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxGames": {
            "title": "Maximum Games",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Fetch at most this many games, to limit run time and cost. When more games match, the most recent ones are kept. Maximum 500.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}