{
  "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": "wcLtINifrbV7t4nn9"
  },
  "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": "Teams",
            "type": "array",
            "description": "Team names, one per line, e.g. Los Angeles Lakers (NBA, EuroLeague, others). Empty with no match IDs uses the Lakers.",
            "default": [
              "Los Angeles Lakers"
            ],
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "title": "Match IDs (optional)",
            "type": "array",
            "description": "Specific Sofascore match IDs, e.g. 12345678, from a match link ending in id:12345678. Skips the team search.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Rows in total (games, roster players, standings rows, profiles), e.g. 10. Free plan: 10. Each extra record is billed, so keep it low on a first run.",
            "default": 10
          },
          "gameWindow": {
            "title": "Played or upcoming?",
            "enum": [
              "both",
              "played",
              "upcoming"
            ],
            "type": "string",
            "description": "Played, upcoming or both. Without dates a team returns its last 30 played and next 30 upcoming games.",
            "default": "both"
          },
          "dateFrom": {
            "title": "Games from (YYYY-MM-DD, UTC)",
            "type": "string",
            "description": "Example: 2025-01-01. Setting a date pages back through the whole team history, 30 games per page.",
            "default": ""
          },
          "dateTo": {
            "title": "Games until (YYYY-MM-DD, UTC)",
            "type": "string",
            "description": "Example: 2025-03-31.",
            "default": ""
          },
          "liveOnly": {
            "title": "Live games only",
            "type": "boolean",
            "description": "Ignores teams and match IDs and returns every basketball game live right now.",
            "default": false
          },
          "tournaments": {
            "title": "Competitions",
            "type": "array",
            "description": "A Sofascore competition ID (132 = NBA), a name (NBA, EuroLeague) or id:season (132:65360).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tournamentSeason": {
            "title": "Season",
            "type": "string",
            "description": "latest (default) or a season like 2024/2025. A season that has not started has no played games.",
            "default": ""
          },
          "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
          },
          "includePlayByPlay": {
            "title": "Play-by-play (scoring plays)",
            "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
          },
          "includeScoreGraph": {
            "title": "Score margin graph",
            "type": "boolean",
            "description": "The point-margin-over-time curve for the whole game, minute by minute.",
            "default": false
          },
          "includeShotChart": {
            "title": "Shot chart (NBA 2024/25 on)",
            "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 (NBA 2024/25 on)",
            "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
          },
          "includeOdds": {
            "title": "Betting odds (result market)",
            "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
          },
          "includeRoster": {
            "title": "Team roster (once per team)",
            "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": "League standings (once per competition)",
            "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": "Players",
            "type": "array",
            "description": "A name (LeBron James), a Sofascore player ID (817181) or a player link. A name uses the best basketball match, so prefer the ID or link for exact results.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new games",
            "type": "boolean",
            "description": "Skips games this same search already returned. Skipped games are not charged. Maximum results then means N new games.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "A label, e.g. lakers-watch, to run several monitors with the same filters.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget seen games",
            "type": "boolean",
            "description": "Clears the seen list for this search and monitor name before the run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}