{
  "openapi": "3.0.1",
  "info": {
    "title": "Sofascore Match Stats, xG & Lineups Scraper",
    "description": "Deep Sofascore match data: xG shotmaps with pitch coordinates, lineups with 33 per-player stats and ratings, attack-momentum graphs, average-position maps, incident timelines, team statistics and odds. Feed it match IDs or URLs. No API key, no login, and no residential proxy needed.",
    "version": "1.0",
    "x-build-id": "eldlTindj0cP5KCx9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/incognito_mode~sofascore-match-analytics-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-incognito_mode-sofascore-match-analytics-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~sofascore-match-analytics-scraper/runs": {
      "post": {
        "operationId": "runs-sync-incognito_mode-sofascore-match-analytics-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~sofascore-match-analytics-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-incognito_mode-sofascore-match-analytics-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": {
          "eventIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Sofascore event IDs, e.g. [16363246, 16248441]. These are the `eventId` values produced by the Sofascore Live & Daily Scores Scraper, so you can chain the two Actors. You can supply IDs here, URLs below, or both.",
            "items": {
              "type": "integer"
            }
          },
          "matchUrls": {
            "title": "Match URLs",
            "type": "array",
            "description": "Sofascore match URLs, e.g. https://www.sofascore.com/football/match/newcastle-liverpool#id:16363246 . The ID is read from the #id: fragment.",
            "items": {
              "type": "string"
            }
          },
          "includeStatistics": {
            "title": "Team statistics",
            "type": "boolean",
            "description": "Side-by-side team stats per period (possession, shots, xG, passes, duels, defending, goalkeeping). Flattened into a lookup keyed by Sofascore's own stat key. Available for most sports.",
            "default": true
          },
          "includeLineups": {
            "title": "Lineups & player ratings",
            "type": "boolean",
            "description": "Formations, starters, bench, and 33 per-player statistics including match rating, expected assists and ball-carry distance. Football, basketball, American football and baseball only.",
            "default": true
          },
          "includeIncidents": {
            "title": "Incident timeline",
            "type": "boolean",
            "description": "Chronological goals, cards, substitutions, period markers and injury time. Not available for tennis, baseball or handball.",
            "default": true
          },
          "includeShotmap": {
            "title": "Shotmap with xG",
            "type": "boolean",
            "description": "Every shot with pitch coordinates, expected goals (xG), xGOT, body part, situation and goalkeeper. Football only -- this is the headline dataset.",
            "default": true
          },
          "includeGraph": {
            "title": "Attack momentum graph",
            "type": "boolean",
            "description": "Minute-by-minute momentum from -100 (away dominance) to +100 (home). Football, basketball and American football.",
            "default": true
          },
          "includeAveragePositions": {
            "title": "Average positions",
            "type": "boolean",
            "description": "Each player's average X/Y position on the pitch with a touch count -- a tactical shape map. Football, American football and baseball.",
            "default": false
          },
          "includeBestPlayers": {
            "title": "Best players",
            "type": "boolean",
            "description": "Best home and away player plus a rating leaderboard for the match.",
            "default": false
          },
          "includeTeamStreaks": {
            "title": "Team streaks",
            "type": "boolean",
            "description": "Running form streaks for both sides and head-to-head (e.g. \"more than 2.5 goals, 4/5\"). Useful for betting models.",
            "default": false
          },
          "includeVotes": {
            "title": "Crowd votes",
            "type": "boolean",
            "description": "Sofascore users' predictions: 1X2, both teams to score, first team to score, and who should have won.",
            "default": false
          },
          "includeWinProbability": {
            "title": "Win probability",
            "type": "boolean",
            "description": "Home win / draw / away win probabilities. Football only.",
            "default": false
          },
          "includeManagers": {
            "title": "Managers",
            "type": "boolean",
            "description": "Home and away manager for the match.",
            "default": false
          },
          "includeH2H": {
            "title": "Head-to-head",
            "type": "boolean",
            "description": "Historical win/draw/loss tally between the two teams. Note this is a tally only -- it does not include past match records.",
            "default": false
          },
          "includeOdds": {
            "title": "Bookmaker odds",
            "type": "boolean",
            "description": "Betting markets with fractional odds and the winning selection (full time 1X2, over/under, both teams to score, handicaps).",
            "default": false
          },
          "includeComments": {
            "title": "Live commentary",
            "type": "boolean",
            "description": "Text commentary for the match. The largest payload by far (~23 KB per match), so it is off by default.",
            "default": false
          },
          "includeHeatmaps": {
            "title": "Player heatmaps (expensive)",
            "type": "boolean",
            "description": "Touch-coordinate heatmap for every player who took part. This costs one extra request PER PLAYER -- around 28 per football match -- so it is much slower and pricier than any other option. Requires lineups, which are switched on automatically if needed.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum matches",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on how many matches are stored. The run stops as soon as it is reached.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave off. Every request calls Sofascore directly first, which costs nothing. If an IP is blocked the Actor escalates on its own: first to a datacenter proxy (included in every Apify plan, free tier included), then to residential only if your plan has it. No residential add-on is required.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}