{
  "openapi": "3.0.1",
  "info": {
    "title": "Sports Reference Stats Scraper - NBA & NHL",
    "description": "Scrape NBA player and team stats from Basketball-Reference and NHL stats from Hockey-Reference: per-season stats, advanced metrics (PER, win shares, BPM), team rosters and salaries. One row per season, 23 seasons for LeBron James in one page. Export CSV, Excel, JSON. No login or API key.",
    "version": "0.1",
    "x-build-id": "K57yrpUeLc59602dL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~sports-reference-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-sports-reference-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/recordsdata~sports-reference-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-sports-reference-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/recordsdata~sports-reference-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-sports-reference-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": "Mode",
            "enum": [
              "urls",
              "season",
              "index"
            ],
            "type": "string",
            "description": "urls = stats from the player, team, league-season or letter pages in Start URLs. season = every player of one league season (NBA or NHL). index = the players-by-letter list of one sport (name, id, years active).",
            "default": "urls"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Used when Mode is urls. Pages from basketball-reference.com (NBA) or hockey-reference.com (NHL): a player page (/players/j/jamesle01.html), a team season (/teams/WSH/2024.html), a league season table (/leagues/NBA_2025_per_game.html, /leagues/NHL_2025_skaters.html) or a letter index (/players/a/).",
            "default": [
              {
                "url": "https://www.basketball-reference.com/players/j/jamesle01.html"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sport": {
            "title": "Sport",
            "enum": [
              "basketball",
              "hockey"
            ],
            "type": "string",
            "description": "Used when Mode is season or index. Basketball = NBA (basketball-reference.com), hockey = NHL (hockey-reference.com).",
            "default": "basketball"
          },
          "season": {
            "title": "Season (ending year)",
            "minimum": 1918,
            "maximum": 2100,
            "type": "integer",
            "description": "Used when Mode is season. The year the season ends: 2025 means season 2024-25. Basketball from 1947, hockey from 1918.",
            "default": 2025
          },
          "statType": {
            "title": "Season table",
            "enum": [
              "standard",
              "totals",
              "advanced"
            ],
            "type": "string",
            "description": "Used when Mode is season. standard = per-game stats for basketball and the season stat table for hockey. totals = season totals (basketball only). advanced = PER, win shares and BPM for basketball, Corsi, Fenwick, PDO and zone starts for hockey skaters.",
            "default": "standard"
          },
          "playerType": {
            "title": "Hockey player type",
            "enum": [
              "skaters",
              "goalies"
            ],
            "type": "string",
            "description": "Used for hockey. skaters or goalies. In season mode it picks the league table. On team pages it picks which stat table to read (skaters or goalies).",
            "default": "skaters"
          },
          "letter": {
            "title": "Last-name letter",
            "maxLength": 1,
            "type": "string",
            "description": "Used when Mode is index. One letter, a to z: players whose last name starts with it.",
            "default": "a"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of main rows to return (player-season rows, league-table rows or index rows). Free users are limited to 10 rows per run. Paid users can raise it up to 1,000,000. Extra rows from the options below are not counted here."
          },
          "includePlayoffs": {
            "title": "Playoff stats",
            "type": "boolean",
            "description": "Add the playoff table of each page as extra rows (recordType playoffs), and playoff advanced rows when Advanced stats is also on. Works on player, team and league-season pages.",
            "default": false
          },
          "includeCareer": {
            "title": "Career totals",
            "type": "boolean",
            "description": "Add the career total rows of a player page (recordType career): the all-seasons row and the per-team and per-league career rows the site shows, with the number of seasons played.",
            "default": false
          },
          "includeAdvanced": {
            "title": "Advanced stats",
            "type": "boolean",
            "description": "Add advanced metrics rows per season: PER, win shares and BPM for basketball, rate and plus-minus stats for hockey. Billed as a separate event per row.",
            "default": false
          },
          "includeCorsiFenwick": {
            "title": "Corsi and Fenwick (hockey)",
            "type": "boolean",
            "description": "Add the hockey possession rows per season (recordType possession): Corsi for and against, CF%, Fenwick, PDO and zone starts. Hockey skater pages and team pages only. Billed like advanced stats.",
            "default": false
          },
          "includeRoster": {
            "title": "Team roster",
            "type": "boolean",
            "description": "Add the full roster of a team-season page, one row per player. Only applies to team URLs. Billed as a separate event per row.",
            "default": false
          },
          "includeSalaries": {
            "title": "Salaries",
            "type": "boolean",
            "description": "Add salary history rows per season where published (basketball-reference only). Billed as a separate event per row.",
            "default": false
          },
          "includeBio": {
            "title": "Bio and draft details",
            "type": "boolean",
            "description": "Add the bio block of a player page to every row of that player: full name, positions, shooting hand, height and weight in cm and kg, birth date and place, high school, college, draft round, pick and year, debut and experience. No extra charge and no extra request.",
            "default": false
          },
          "numericValues": {
            "title": "Numbers as numbers",
            "type": "boolean",
            "description": "Return stat values as numbers (0.512, 27.1) instead of text ('.512', '27.1'). Ids, names, positions, seasons and dates stay text. Off by default so existing integrations keep working.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}