{
  "openapi": "3.0.1",
  "info": {
    "title": "Sofascore Match Stats Scraper - Live Scores, Odds & Lineups",
    "description": "Scrape Sofascore match data for 11 sports: score, statistics, lineups, xG shot maps, player ratings, head-to-head and odds. Search by team, match ID or live. Export CSV, Excel, JSON or API. No login or API key. 22 fields per match, 7 optional extras.",
    "version": "0.1",
    "x-build-id": "lECwxXJeOwJrWs54g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~sofascore-match-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-sofascore-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~sofascore-match-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-sofascore-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~sofascore-match-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-sofascore-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": "Team names to look up (e.g. \"Real Madrid\"). Each name is resolved to its Sofascore team id by search, then the team's recent and upcoming matches are collected, one row per match. Ignored when Live matches only is on. If you only fill Event IDs, leave this default alone and it is skipped.",
            "default": [
              "Real Madrid"
            ],
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "title": "Event 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"
            }
          },
          "sport": {
            "title": "Sport",
            "enum": [
              "football",
              "basketball",
              "tennis",
              "american-football",
              "ice-hockey",
              "baseball",
              "rugby",
              "esports",
              "volleyball",
              "handball",
              "table-tennis"
            ],
            "type": "string",
            "description": "Sport of the team names, competitions, players, day schedule and live matches. Names are searched in this sport first (Real Madrid exists in football and basketball, and two players named Nikola Jokic play in different sports). An id or a page URL is exact and ignores this.",
            "default": "football"
          },
          "liveOnly": {
            "title": "Live matches only",
            "type": "boolean",
            "description": "Ignore Team names / Event IDs and instead fetch every match currently live in the sport selected above.",
            "default": false
          },
          "gameWindow": {
            "title": "Matches of a team or competition",
            "enum": [
              "both",
              "played",
              "upcoming"
            ],
            "type": "string",
            "description": "Which matches of a team or competition to list: played, upcoming or both. Without dates, a team returns its latest 30 played and next 30 upcoming matches.",
            "default": "both"
          },
          "dateFrom": {
            "title": "Matches from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only matches that start on or after this date (UTC). Setting a date makes the actor page back through the history of the team or competition, 30 matches per page.",
            "default": ""
          },
          "dateTo": {
            "title": "Matches until (YYYY-MM-DD)",
            "type": "string",
            "description": "Only matches that start on or before this date (UTC).",
            "default": ""
          },
          "tournaments": {
            "title": "Competitions",
            "type": "array",
            "description": "List every match of whole competition seasons. Use a Sofascore competition id (8 is LaLiga, 17 the Premier League), a name (LaLiga, Champions League) or id:seasonId (8:77559). Searched in the sport chosen above. Combines with the matches and dates above.",
            "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 25/26 or 2025.",
            "default": ""
          },
          "date": {
            "title": "Day schedule (YYYY-MM-DD)",
            "type": "string",
            "description": "Every match of the chosen sport on this UTC day, biggest competitions first, so Max Items keeps the most important fixtures. Add competitions above to restrict the day to them. When set, the default team is not added.",
            "default": ""
          },
          "daysAhead": {
            "title": "Extra days after the day schedule",
            "minimum": 0,
            "maximum": 13,
            "type": "integer",
            "description": "Also list the following days (0 to 13) of the day schedule above.",
            "default": 0
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of rows to return: matches, or profiles and search results. Free users are limited to 10 rows (preview). Paid users can raise it up to 1,000,000. Extras you turn on are billed per row on top of this.",
            "default": 10
          },
          "teamProfiles": {
            "title": "Team profiles",
            "type": "array",
            "description": "Teams to return a profile for: a name (Real Madrid), a Sofascore team id (2829) or a team page URL. One row per team with country, league, manager, stadium, colours, founding date and current form. A name that exists in several sports resolves in the chosen Sport.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "playerProfiles": {
            "title": "Player profiles",
            "type": "array",
            "description": "Players to return a profile for: a name (Lionel Messi), a Sofascore player id (12994) or a player page URL. One row per player with position, height, birth date, foot, club, market value and contract end. Tennis, darts and other individual-sport athletes return ranking, prize money, hand and birthplace. A name shared by players of different sports resolves in the chosen Sport.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "competitionProfiles": {
            "title": "Competition profiles",
            "type": "array",
            "description": "Competitions (leagues, cups, tours) to return a profile for: a name (LaLiga), a Sofascore competition id (8) or a competition page URL. One row per competition with tier, title holder, most titles, divisions, current season and the list of seasons. A name that exists in several sports resolves in the chosen Sport.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search by name",
            "type": "array",
            "description": "Names to search on Sofascore (at least 2 characters). One row per result with its id, name, sport, country, link and relevance score. Searches every sport; each row says which one. Up to 10 pages of 20 results per name, as far as Max Items allows.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search results of type",
            "enum": [
              "all",
              "player",
              "team",
              "competition"
            ],
            "type": "string",
            "description": "Which kind of result to keep when searching by name.",
            "default": "all"
          },
          "searchFullProfiles": {
            "title": "Return full profiles for search results",
            "type": "boolean",
            "description": "Instead of one short row per search result, fetch the full profile of each result (one extra request and one profile record per result).",
            "default": false
          },
          "includeSquad": {
            "title": "Team squads",
            "type": "boolean",
            "description": "Add the full squad to each team profile: id, name, position, shirt number, height, birth date, foot, nationality, market value and contract end per player. One extra event per team with a squad.",
            "default": false
          },
          "includeTransfers": {
            "title": "Player transfer history",
            "type": "boolean",
            "description": "Add the transfer history to each player profile: date, clubs and fee. One extra event per player with transfers. Not available for tennis and other individual-sport athletes.",
            "default": false
          },
          "includeStatistics": {
            "title": "Match statistics",
            "type": "boolean",
            "description": "Possession, shots, cards and other aggregated team stats.",
            "default": true
          },
          "includeLineups": {
            "title": "Lineups",
            "type": "boolean",
            "description": "Starting XI, formation, substitutes for both teams.",
            "default": false
          },
          "includeShotmap": {
            "title": "Shot map",
            "type": "boolean",
            "description": "Every shot in the match: player, position, outcome. Football/basketball/handball only — other sports return an empty array.",
            "default": false
          },
          "includePlayerRatings": {
            "title": "Player ratings",
            "type": "boolean",
            "description": "Per-player performance rating for the match.",
            "default": false
          },
          "includeH2h": {
            "title": "Head-to-head record",
            "type": "boolean",
            "description": "Historical wins/draws/losses between the two teams.",
            "default": false
          },
          "includeOdds": {
            "title": "Betting odds",
            "type": "boolean",
            "description": "Live bookmaker odds for the match result market. Informational data only, not betting advice.",
            "default": false
          },
          "includePregameForm": {
            "title": "Pre-match form",
            "type": "boolean",
            "description": "Recent results and average rating for both teams heading into the match.",
            "default": false
          },
          "includeIncidents": {
            "title": "Incidents timeline",
            "type": "boolean",
            "description": "Goals, cards, substitutions and period markers with minute, team, players and score. One extra event per match that returns incidents.",
            "default": false
          },
          "includeVotes": {
            "title": "Fan votes",
            "type": "boolean",
            "description": "Sofascore fan votes: home win, draw, away win and, for football, both teams to score and first team to score. One extra event per match with votes.",
            "default": false
          },
          "includeStandings": {
            "title": "League table",
            "type": "boolean",
            "description": "The standings table of the competition season the match belongs to (position, played, wins, draws, losses, goals, points). Also adds the current table to competition profiles. One extra event per match or competition with a table.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new matches (monitor mode)",
            "type": "boolean",
            "description": "Only new matches: skip every match this same search already returned in an earlier run in the same state (upcoming, finished, or a new live score), so scheduled runs return just what changed and you are not charged for skipped matches. Max Items then means N new matches. 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 matches before this run",
            "type": "boolean",
            "description": "Clear the stored list of already-seen matches 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}