{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Match Stats Scraper - ATP & WTA",
    "description": "Scrape ATP and WTA tennis data from Sofascore by player name or match ID: results with set scores, serve and return statistics, point-by-point sequences, head-to-head history, betting odds and live rankings. Export CSV, Excel, JSON. No login or API key. Six record types per run.",
    "version": "0.1",
    "x-build-id": "bvQsxzWBMMv6oZpyF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~tennis-match-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-tennis-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~tennis-match-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-tennis-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~tennis-match-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-tennis-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": {
          "playerNames": {
            "title": "Player names",
            "type": "array",
            "description": "ATP/WTA player names to look up (e.g. \"Novak Djokovic\"). Resolved to the player's Sofascore id via search, then recent and upcoming matches are collected. Ignored when Player profiles, Tournament profiles, Search by name or Tournament list below are used.",
            "default": [
              "Novak Djokovic"
            ],
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Specific Sofascore match IDs to fetch directly, bypassing player search. Find an ID in a Sofascore match URL, e.g. sofascore.com/.../id:12345678. When set, the default player name is ignored.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "liveOnly": {
            "title": "Live matches only",
            "type": "boolean",
            "description": "Ignore Player names / Match IDs and instead fetch every tennis match currently live.",
            "default": false
          },
          "tournaments": {
            "title": "Tournaments",
            "type": "array",
            "description": "List every match of whole tournament seasons. Use a Sofascore tournament id (2519 is Shanghai, 2480 Roland Garros men), a name (Roland Garros, Madrid) or id:seasonId. A name can match the men's, women's and doubles events, so combine it with Tour and Match type below. When set, the default player is not added.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tournamentSeason": {
            "title": "Tournament season",
            "type": "string",
            "description": "Season to list for the tournaments above: latest (default) or a year such as 2025.",
            "default": ""
          },
          "dateFrom": {
            "title": "Matches from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only matches that start on or after this UTC date. With no player names, tournaments or match IDs, the dates become a day schedule: every tennis match of those days (up to 14), biggest tournaments first, so Max Items keeps the most important matches.",
            "default": ""
          },
          "dateTo": {
            "title": "Matches until (YYYY-MM-DD)",
            "type": "string",
            "description": "Only matches that start on or before this UTC date. Use the same date as Matches from to get one day.",
            "default": ""
          },
          "gameWindow": {
            "title": "Played or upcoming",
            "enum": [
              "both",
              "played",
              "upcoming"
            ],
            "type": "string",
            "description": "Which matches of a player or tournament to list. Without dates, a player returns the latest 30 played and the next 30 upcoming matches.",
            "default": "both"
          },
          "tour": {
            "title": "Tour",
            "enum": [
              "any",
              "atp",
              "wta",
              "challenger",
              "itf",
              "utr"
            ],
            "type": "string",
            "description": "Keep only matches of one tour: ATP, WTA, Challenger (includes WTA 125), ITF or UTR. Any tour by default. Also applies to the Tournament list.",
            "default": "any"
          },
          "matchType": {
            "title": "Singles or doubles",
            "enum": [
              "any",
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Keep only singles or only doubles matches. Both by default. Also applies to the Tournament list.",
            "default": "any"
          },
          "matchStatus": {
            "title": "Match status",
            "enum": [
              "any",
              "finished",
              "live",
              "upcoming"
            ],
            "type": "string",
            "description": "Keep only finished, live or upcoming (not started) matches. Any status by default.",
            "default": "any"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of rows to return: matches (each billed as a match-record), or player and tournament profiles, search results and listed tournaments. Free users: limited to 10 rows (preview). Paid users: optional, max 1,000,000. Leave empty for all rows found. Extras you turn on are billed on top."
          },
          "playerProfiles": {
            "title": "Player profiles",
            "type": "array",
            "description": "Players to return a profile row for: a name (Carlos Alcaraz), a Sofascore player id (275923) or a player page URL. One row per player with the ATP or WTA ranking, live ranking, UTR rating, country, hand, height, birth date, prize money and more. A name resolves to the best matching tennis player; use the id or URL to be exact.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tournamentProfiles": {
            "title": "Tournament profiles",
            "type": "array",
            "description": "Tournaments to return a profile row for: a name (Roland Garros), a Sofascore tournament id (2480) or a tournament page URL. One row per tournament with tour, surface, points, host city, prize money, number of players, title holder, most titles and the list of seasons. A name resolves to the best matching tournament (a name can exist for men, women and doubles; use the id to be exact).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search by name",
            "type": "array",
            "description": "Names to search on Sofascore (at least 2 characters). One row per tennis player or tournament found, with its id, name, country or tour, link and relevance score. 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",
              "tournament"
            ],
            "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 (extra requests and one profile record per result).",
            "default": false
          },
          "listTournaments": {
            "title": "Tournament list",
            "type": "boolean",
            "description": "List tournaments, one row each. Without dates: the season calendar of the chosen Tour (ATP and WTA when Tour is any; the ITF calendar needs dates). With Matches from / Matches until (up to 14 days): the tournaments that have matches on those days, with surface and match count per day. Tour and Singles or doubles apply.",
            "default": false
          },
          "includePlayerResults": {
            "title": "Recent results of each player",
            "type": "boolean",
            "description": "Add the latest finished matches of every player profile: date, tournament, round, surface, opponent, result and score. One extra event per result line.",
            "default": false
          },
          "playerResultsLimit": {
            "title": "Results per player",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "How many recent results to add per player profile (30 is one page of Sofascore).",
            "default": 30
          },
          "includeSeasonStatistics": {
            "title": "Serve statistics by tournament",
            "type": "boolean",
            "description": "Add serve and break-point statistics (aces, double faults, first-serve %, points won, break points, tie-breaks) for the latest season of each of the player's 10 most recent tournaments. One extra event per tournament line.",
            "default": false
          },
          "includeChampions": {
            "title": "Past champions of each tournament",
            "type": "boolean",
            "description": "Add the champion of the latest seasons of every tournament profile: winner, runner-up, final score and date. One extra event per champion line.",
            "default": false
          },
          "championSeasons": {
            "title": "Seasons of champions",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many of the latest seasons to look up per tournament profile (seasons whose final is not played yet give no line).",
            "default": 5
          },
          "includeStatistics": {
            "title": "Match statistics",
            "type": "boolean",
            "description": "Off by default. Serve, return, points and games stats for both players (aces, break points, first-serve %, and more). Billed per statistic line, not per match: a tennis match has about 20 to 42 lines, so this adds roughly $0.20 to $0.42 per match on the Free plan.",
            "default": false
          },
          "includeSetStatistics": {
            "title": "Statistics per set",
            "type": "boolean",
            "description": "The same serve, return, points and games statistics as above, set by set (set 1, set 2...). Billed per statistic line, like the match statistics. Off by default.",
            "default": false
          },
          "includePointByPoint": {
            "title": "Point-by-point",
            "type": "boolean",
            "description": "The full point-by-point sequence within every game and set of the match.",
            "default": false
          },
          "includeH2h": {
            "title": "Head-to-head record",
            "type": "boolean",
            "description": "Historical wins/losses between the two players.",
            "default": false
          },
          "includeH2hMeetings": {
            "title": "Past meetings and surface split",
            "type": "boolean",
            "description": "The earlier matches between the two players (date, tournament, round, surface, winner, score) and their wins per surface (hard, clay, grass). One extra event per past meeting listed. Off by default.",
            "default": false
          },
          "includeOdds": {
            "title": "Betting odds",
            "type": "boolean",
            "description": "Bookmaker odds for the match result market. Informational data only, not betting advice.",
            "default": false
          },
          "oddsMarkets": {
            "title": "Odds markets",
            "enum": [
              "main",
              "all"
            ],
            "type": "string",
            "description": "Main: only the match result market. All: every market the bookmakers list (match winner, first set winner, total games). Each odd comes with its opening odd and movement either way.",
            "default": "main"
          },
          "includeVotes": {
            "title": "Fan votes",
            "type": "boolean",
            "description": "Sofascore fan votes: how many users picked each player to win. One extra event per match with votes. Off by default.",
            "default": false
          },
          "includeRanking": {
            "title": "ATP/WTA ranking",
            "type": "boolean",
            "description": "The player's current ATP or WTA ranking snapshot. Computed once per unique player in the run, not once per match.",
            "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 game score while live), 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}