{
  "openapi": "3.0.1",
  "info": {
    "title": "Basketball Scraper: Box Scores, Play-by-Play & Odds",
    "description": "Basketball scraper for NBA, EuroLeague and other leagues: game results with score by quarter, team stats, player box scores, play-by-play, odds, lineups, rosters and standings from Sofascore. Export CSV, Excel, JSON, XML. No login or API key. 10 record types.",
    "version": "0.1",
    "x-build-id": "phTUHfpQXVrWXJHWO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~basketball-match-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-basketball-match-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~basketball-match-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-basketball-match-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~basketball-match-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-basketball-match-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": {
          "teamNames": {
            "title": "Team names",
            "type": "array",
            "description": "Basketball team names to scrape, for example \"Los Angeles Lakers\" (NBA, EuroLeague and other leagues). If both this list and Match IDs are empty, the Actor uses Los Angeles Lakers. Each name is resolved to the team's Sofascore id via search, then recent and upcoming games are collected.",
            "default": [
              "Los Angeles Lakers"
            ],
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Specific Sofascore match IDs to fetch directly, bypassing team search. Find an ID in a Sofascore match URL, e.g. sofascore.com/.../id:12345678.",
            "items": {
              "type": "string"
            }
          },
          "gameWindow": {
            "title": "Games",
            "enum": [
              "both",
              "played",
              "upcoming"
            ],
            "type": "string",
            "description": "Which games of the team or competition to list: played games, upcoming games or both. Without dates, a team returns its latest 30 played and next 30 upcoming games.",
            "default": "both"
          },
          "dateFrom": {
            "title": "Games from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only games that start on or after this date (UTC). Setting a date makes the actor page back through the whole history of the team, 30 games per page.",
            "default": ""
          },
          "dateTo": {
            "title": "Games until (YYYY-MM-DD)",
            "type": "string",
            "description": "Only games that start on or before this date (UTC).",
            "default": ""
          },
          "tournaments": {
            "title": "Competitions",
            "type": "array",
            "description": "List every game of whole competition seasons. Use a Sofascore competition id (132 is the NBA), a name (NBA, EuroLeague) or id:seasonId (132:65360). Combines with Games and the date range.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tournamentSeason": {
            "title": "Competition season",
            "type": "string",
            "description": "Season to list for the competitions above: latest (default) or a season such as 2024/2025. A season that has not started has no played games yet.",
            "default": ""
          },
          "liveOnly": {
            "title": "Live games only",
            "type": "boolean",
            "description": "Ignore Team names / Match IDs and instead fetch every basketball game currently live.",
            "default": false
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of output rows (games, roster players, standings rows and player profiles combined). Default 10. Free users are limited to 10. Each row and each extra record is billed, so keep this low for a first run.",
            "default": 10
          },
          "includeStatistics": {
            "title": "Team statistics (per quarter)",
            "type": "boolean",
            "description": "Team-level scoring, rebounds and other stats for the full game and each quarter. Off by default because it is billed per statistic line (about 71 lines for a finished NBA game, so roughly $0.71 extra per game at $0.01 per line). Turn on only when you need team stat lines.",
            "default": false
          },
          "includeBoxScore": {
            "title": "Player box scores",
            "type": "boolean",
            "description": "Full per-player stat line for the game: points, rebounds, assists, steals, blocks, shooting splits, plus-minus, efficiency rating.",
            "default": false
          },
          "includeLineups": {
            "title": "Lineups",
            "type": "boolean",
            "description": "Starters vs bench, position and jersey number for both teams in this specific game.",
            "default": false
          },
          "includeH2h": {
            "title": "Head-to-head record",
            "type": "boolean",
            "description": "Historical wins/losses between the two teams.",
            "default": false
          },
          "includeOdds": {
            "title": "Betting odds",
            "type": "boolean",
            "description": "Bookmaker odds for the game result market. Informational data only, not betting advice.",
            "default": false
          },
          "includeOddsMarkets": {
            "title": "All odds markets",
            "type": "boolean",
            "description": "Every odds market Sofascore lists for the game: moneyline, quarter and half winners, point spread and game total, one line per outcome with the line, the current and the opening price (fractional and decimal). NBA, EuroLeague, ACB, Lega Basket and WNBA games have all five; other leagues often only the moneyline. Billed per odds line. Informational data only, not betting advice.",
            "default": false
          },
          "includeScoreGraph": {
            "title": "Score margin graph",
            "type": "boolean",
            "description": "The point-margin-over-time curve for the whole game, minute by minute.",
            "default": false
          },
          "includePlayByPlay": {
            "title": "Play-by-play",
            "type": "boolean",
            "description": "Every real scoring play in the game (1/2/3-pointers and free throws), with player, time and running score.",
            "default": false
          },
          "includeShotChart": {
            "title": "Shot chart (court coordinates)",
            "type": "boolean",
            "description": "Every field-goal attempt of the game in time order: shooter, 2PT or 3PT, made or missed, shot style, x/y court position (inches on a 1128 x 600 court), zone, distance to the hoop in feet, assist and blocker. Sofascore has shot coordinates only for NBA games from the 2024/25 season on; for every other game this stays empty and nothing is charged. Billed per shot.",
            "default": false
          },
          "includePlayLog": {
            "title": "Full play log",
            "type": "boolean",
            "description": "Every play of the game in time order (shots, free throws, rebounds, turnovers, fouls, timeouts, lineup changes), with period, clock, running score and, for shots, the court position. Same coverage as the shot chart: NBA games from the 2024/25 season on, empty and not charged elsewhere. The play log already contains the shots, so you do not need the shot chart as well. Billed per play.",
            "default": false
          },
          "includeRoster": {
            "title": "Team roster",
            "type": "boolean",
            "description": "The team's full season roster: every player with position, height, weight, birth date, country and jersey number, plus salary and contract end where Sofascore has them (NBA players). Computed once per unique team in the run, not once per game.",
            "default": false
          },
          "includeStandings": {
            "title": "Conference/division standings",
            "type": "boolean",
            "description": "The league table for the team's competition. Computed once per unique tournament/season in the run, not once per game.",
            "default": false
          },
          "playerProfiles": {
            "title": "Player profiles",
            "type": "array",
            "description": "Players to look up: a full name (LeBron James), a Sofascore player id (817181) or a player page link (https://www.sofascore.com/basketball/player/lebron-james/817181). A name uses the best basketball match of the Sofascore search, so use the id or the link for an exact player. Each profile has height, weight, birth date, country, team, position, jersey number and, for NBA players, salary and contract end. When you fill this in and leave Team names at the default, no games are collected.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new results (monitor mode)",
            "type": "boolean",
            "description": "Only new results: skip every game this same search already returned in an earlier run, so scheduled runs return just the new games and you are not charged for skipped ones. Max Items then means N new games. Off by default.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Optional label for the monitor state. Use a different label to run several independent monitors with identical filters. Leave empty to share state between runs of the same search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset seen games before this run",
            "type": "boolean",
            "description": "Clear the stored list of already-seen games for this search (and Monitor name) before the run starts, so everything counts as new again.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}