{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Scraper — Point-by-Point, Stats & Odds (SofaScore)",
    "description": "Scrape tennis point-by-point, match statistics and odds from SofaScore, Flashscore and TennisExplorer: every point with server, score and break/set/match point flags, aces and break points, a player's last matches or a whole tournament, odds history, H2H and ATP/WTA rankings.",
    "version": "0.0",
    "x-build-id": "ONhoHu4M1MTrUSD7l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~flashscore-sofascore-tennis-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-flashscore-sofascore-tennis-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/memo23~flashscore-sofascore-tennis-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-flashscore-sofascore-tennis-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/memo23~flashscore-sofascore-tennis-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-flashscore-sofascore-tennis-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": {
          "source": {
            "title": "Data source",
            "enum": [
              "tennisexplorer",
              "flashscore",
              "sofascore",
              "all"
            ],
            "type": "string",
            "description": "Which site to read. Flashscore returns a whole day of matches in one request, the cheapest option for fixtures and results. SofaScore carries the depth: point-by-point, match statistics, odds line movement, ATP/WTA rankings and player bios. TennisExplorer has the per-bookmaker odds history. \"All sources\" runs all three and splits the item budget evenly between them. The playerMatches and tournamentMatches modes always read SofaScore, whatever is picked here. Flashscore covers the fixtures, results and matchDetails modes only. In rankings mode it reads the table from TennisExplorer instead; in players, h2h and searchPlayers the run fails. SofaScore has no h2h mode, so that combination fails too.",
            "default": "tennisexplorer"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "fixtures",
              "results",
              "matchDetails",
              "playerMatches",
              "tournamentMatches",
              "players",
              "h2h",
              "rankings",
              "searchPlayers"
            ],
            "type": "string",
            "description": "What this run scrapes. `fixtures` = upcoming matches with odds (today by default), `results` = finished matches with scores and closing odds (yesterday by default), `matchDetails` = deep per-match records (with source SofaScore: point-by-point and match statistics), `playerMatches` = a player's last finished matches, `tournamentMatches` = every played match of a tournament season, `players` = full player profiles, `h2h` = head-to-head records, `rankings` = ATP/WTA ranking tables (current or historical), `searchPlayers` = find players and their slugs by name.",
            "default": "fixtures"
          },
          "startUrls": {
            "title": "TennisExplorer URLs (optional — overrides Mode)",
            "type": "array",
            "description": "Any tennisexplorer.com URLs: `/matches/`, `/next/`, `/results/`, `/match-detail/?id=…`, `/player/{slug}/`, `/mutual/{a}/{b}/`, `/ranking/…` or `/list-players/…`. Each URL is auto-classified and routed to the right parser. Leave empty to use Mode instead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tourType": {
            "title": "Tour / discipline",
            "enum": [
              "all",
              "atp-single",
              "wta-single",
              "atp-double",
              "wta-double"
            ],
            "type": "string",
            "description": "Which tournaments to include: both tours, or a single tour, singles or doubles.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "First day to scrape. Defaults: fixtures = today, results = yesterday. Fixtures for past dates are automatically served from the results pages."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Last day, inclusive. Defaults to Date from (a single day). Ranges are capped at 62 days per run."
          },
          "matchIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Match ids for the matchDetails mode. TennisExplorer: numeric ids (e.g. `3290771`) or full `/match-detail/?id=…` URLs. SofaScore: event ids (e.g. `17608992`) or SofaScore match URLs ending in `#id:17608992`. Take ids from the `matchId` field of fixtures, results, player or tournament rows from the same source. The run fails if this list is empty in matchDetails mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeOddsHistory": {
            "title": "Include odds history (line movement)",
            "type": "boolean",
            "description": "Keep the full per-bookmaker odds movement — every price change with timestamp plus the opening price — on matchDetails rows, across all four markets (Home/Away, Over/Under, Asian Handicap, Correct Score). Turn off for lighter rows with current + opening odds only.",
            "default": true
          },
          "includeRecentForm": {
            "title": "Include recent form & mutual matches",
            "type": "boolean",
            "description": "Keep the recent-matches blocks (each player's last matches and their mutual meetings) on matchDetails rows.",
            "default": true
          },
          "includePointByPoint": {
            "title": "Include point-by-point",
            "type": "boolean",
            "description": "Adds `pointByPoint` to each finished match: every set, game and point, with the server, the winner, the game score after the point, and flags for break point, set point and match point (plus which side held the set or match point). Each game says who served, who won it and whether serve was broken. Matches with point-by-point or statistics are billed as match detail records.",
            "default": true
          },
          "includeMatchStats": {
            "title": "Include match statistics",
            "type": "boolean",
            "description": "Adds `matchStats` to each finished match, for the whole match and for each set: aces, double faults, first-serve %, points won on first and second serve, break points saved and converted, return points, games won, and, where SofaScore publishes them (Grand Slams, ATP Finals and other top events), winners and unforced errors. The `statistics` list keeps the same figures as SofaScore labels them.",
            "default": true
          },
          "includePredictionMarkets": {
            "title": "Add Polymarket & Kalshi match-winner prices",
            "type": "boolean",
            "description": "Adds a `predictionMarkets` block to each singles match that has an open Polymarket or Kalshi match-winner market: both players' prices on each venue (0 to 1, so 0.62 means 62%), the bookmakers' win probability with their margin removed when the row carries odds, and the gap between the two. Most prediction-market tennis is ITF and Challenger. Doubles and matches without an open market get `predictionMarkets: null`. Markets close once a match settles, so results runs rarely match.",
            "default": false
          },
          "playerSlugs": {
            "title": "Players (slugs, ids, URLs or names)",
            "type": "array",
            "description": "For the players mode: TennisExplorer slugs like `djokovic` or full `/player/…` URLs. For the playerMatches mode (and players with source SofaScore): a SofaScore player id (`275923`), a SofaScore player URL, or a name such as `Carlos Alcaraz`, which takes the first matching tennis player. Find slugs and ids with the searchPlayers mode. The run fails if this list is empty in players mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxMatchesPerPlayer": {
            "title": "Matches per player (playerMatches)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "For the playerMatches mode: how many of each player's most recent finished matches to return, newest first. Maximum results still caps the run.",
            "default": 10
          },
          "h2hPairs": {
            "title": "Head-to-head pairs",
            "type": "array",
            "description": "For the h2h mode. One pair per line: `djokovic vs alcaraz-5ab70`, `djokovic, alcaraz-5ab70` or a full `/mutual/…/…/` URL. The run fails if this list is empty in h2h mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Player search query",
            "type": "string",
            "description": "For the searchPlayers mode: part of a player's name, case-insensitive (e.g. `alcaraz`). Returns matching players with their slugs and current rank for both tours. The run fails if this is empty in searchPlayers mode. In playerMatches mode, a name here is used when the player list is empty."
          },
          "tournaments": {
            "title": "Tournaments",
            "type": "array",
            "description": "One tournament per line: a SofaScore tournament id (`2449`), a SofaScore tournament URL, or a name such as `US Open`, `Wimbledon women` or `ATP Finals`. A name takes the best tennis match. Men's and women's draws, and singles and doubles, are separate tournaments. The run fails if this list is empty in tournamentMatches mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tournamentSeason": {
            "title": "Season",
            "type": "string",
            "description": "Season year, e.g. `2025`. Leave empty for the latest season."
          },
          "maxMatchesPerTournament": {
            "title": "Matches per tournament",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many played matches to return per tournament, newest first (final, semi-finals, quarter-finals, …, then qualifying). A Grand Slam draw with qualifying is around 250 matches. Maximum results still caps the run.",
            "default": 100
          },
          "rankingTour": {
            "title": "Ranking table",
            "enum": [
              "atp-men",
              "wta-women"
            ],
            "type": "string",
            "description": "Which ranking to walk in rankings mode.",
            "default": "atp-men"
          },
          "rankingDate": {
            "title": "Ranking snapshot date (YYYY-MM-DD)",
            "type": "string",
            "description": "Historical weekly snapshot to read (Mondays). Leave empty for the latest ranking. TennisExplorer keeps weekly snapshots going back years."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap on dataset rows for the run. You are billed per row, so this is your spend guard.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Parallel page fetches. 10 is a good default; raise it for large matchDetails batches.",
            "default": 10
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "All three sources answer over a direct connection, so no proxy is used unless you configure one here."
          },
          "sofaMaxTournaments": {
            "title": "SofaScore: max tournaments per day",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Caps the SofaScore day fan-out. Its schedule needs one call to list a day's tournaments and then one call per tournament, so an unbounded day costs around 88 requests. Ignored by the other sources.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}