{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Scraper & Scores API — ATP, WTA, Live, Stats",
    "description": "Tennis scraper on SofaScore data: live scores, schedules, results, match statistics, point by point, betting odds, ATP and WTA rankings, player profiles and draws for ATP, WTA, Challenger, ITF and UTR. One flat row per match. Export to CSV or JSON, run via API, schedule, or call from AI agents.",
    "version": "0.1",
    "x-build-id": "gDlx0BEYaZTG2SUqS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~tennis-scores-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-tennis-scores-api",
        "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/lergassy~tennis-scores-api/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-tennis-scores-api",
        "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/lergassy~tennis-scores-api/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-tennis-scores-api",
        "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": {
          "mode": {
            "title": "🎾 What to get",
            "enum": [
              "schedule",
              "live",
              "match",
              "player",
              "tournament",
              "rankings",
              "search",
              "wtaMatches",
              "wtaRankings",
              "wtaPlayers",
              "wtaTournaments"
            ],
            "type": "string",
            "description": "<b>Schedule</b> — every match on a date (and the following days) for the chosen tours: upcoming, live and finished. <b>Live</b> — matches in play right now. <b>Match</b> — full details for specific matches (statistics, odds, head-to-head, point by point). <b>Player</b> — profile, ranking and recent results. <b>Tournament</b> — a tournament's matches and draw. <b>Rankings</b> — the ATP and WTA lists. <b>Search</b> — find player and tournament ids by name. <b>WTA official</b> — the four modes above read the WTA tour’s own feed instead of SofaScore. Use them when you need ranking points and prize money per match, which SofaScore does not publish.",
            "default": "schedule"
          },
          "dateFrom": {
            "title": "📅 Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Day to list matches for, <code>YYYY-MM-DD</code> in UTC. Leave empty for today."
          },
          "days": {
            "title": "➡️ Days ahead",
            "minimum": 0,
            "maximum": 14,
            "type": "integer",
            "description": "How many more days after the date to include (0 = only that day, up to 14). Use 6 for the whole week of a tournament.",
            "default": 0
          },
          "tours": {
            "title": "🏆 Tours",
            "type": "array",
            "description": "Which circuits to include. Grand Slams appear under ATP and WTA.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta",
                "challenger",
                "wta125",
                "itf_men",
                "itf_women",
                "utr_men",
                "utr_women",
                "davis_cup",
                "bjk_cup",
                "united_cup",
                "exhibition"
              ],
              "enumTitles": [
                "ATP",
                "WTA",
                "ATP Challenger",
                "WTA 125",
                "ITF Men",
                "ITF Women",
                "UTR Men",
                "UTR Women",
                "Davis Cup",
                "Billie Jean King Cup",
                "United Cup",
                "Exhibition"
              ]
            },
            "default": [
              "atp",
              "wta"
            ]
          },
          "status": {
            "title": "🎯 Keep only",
            "enum": [
              "any",
              "upcoming",
              "live",
              "finished"
            ],
            "type": "string",
            "description": "Filter matches by state.",
            "default": "any"
          },
          "matchType": {
            "title": "👥 Singles or doubles",
            "enum": [
              "all",
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Doubles rows carry both partners in <code>homePartners</code> / <code>awayPartners</code>.",
            "default": "all"
          },
          "playerName": {
            "title": "🔎 Only matches of a player",
            "type": "string",
            "description": "Keep only matches where a player's name contains this text, e.g. <code>Sinner</code>. Works in schedule, live, player and tournament modes."
          },
          "includeOdds": {
            "title": "💰 Add betting odds to every match ($)",
            "type": "boolean",
            "description": "Pre-match and live match-winner odds (decimal and fractional, opening and current) plus every other market SofaScore shows. One extra request per match.",
            "default": false
          },
          "includeStatistics": {
            "title": "📊 Add match statistics to every match ($)",
            "type": "boolean",
            "description": "Aces, double faults, first-serve percentage, break points, points and games won — for the match and per set — plus head-to-head record and fan votes. Available for live and finished matches; two extra requests per match.",
            "default": false
          },
          "includePointByPoint": {
            "title": "🎯 Add point-by-point to every match ($)",
            "type": "boolean",
            "description": "Every game with its point sequence, server and game winner. Available for live and finished matches; one extra request per match. Turn on for modelling and trading, off for scores.",
            "default": false
          },
          "eventIds": {
            "title": "🆔 Match ids or URLs (match mode)",
            "type": "array",
            "description": "SofaScore match ids or match URLs, e.g. <code>16901526</code> or <code>https://www.sofascore.com/tennis/match/francisco-cerundolo-taylor-fritz/RvebsmvNb</code>. Ids come from the <code>eventId</code> field of any match row.",
            "items": {
              "type": "string"
            }
          },
          "playerIds": {
            "title": "🧑 Player ids or URLs (player mode)",
            "type": "array",
            "description": "SofaScore player ids or player page URLs, e.g. <code>206570</code> (Jannik Sinner). Use <b>Search</b> mode to find ids by name.",
            "items": {
              "type": "string"
            }
          },
          "tournamentIds": {
            "title": "🏟️ Tournament ids or URLs (tournament mode)",
            "type": "array",
            "description": "SofaScore tournament ids or tournament URLs, e.g. <code>2449</code> (US Open men). Use <b>Search</b> mode to find ids by name.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "🔍 Name to search (search mode)",
            "type": "string",
            "description": "Player or tournament name, e.g. <code>Alcaraz</code> or <code>Wimbledon</code>. Returns ids you can paste into the fields above."
          },
          "rankingTour": {
            "title": "🥇 Rankings tour (rankings mode)",
            "enum": [
              "both",
              "atp",
              "wta"
            ],
            "type": "string",
            "description": "Which official ranking to fetch.",
            "default": "both"
          },
          "rankingTop": {
            "title": "🥇 Ranking rows per tour",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many players from the top of each list (up to 500).",
            "default": 100
          },
          "includeDraw": {
            "title": "🌳 Add the draw (tournament mode) ($)",
            "type": "boolean",
            "description": "One row per draw block — round, both players, seeds, result — so you can rebuild the bracket.",
            "default": false
          },
          "maxMatches": {
            "title": "💯 Maximum matches per run",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Safety cap across all modes.",
            "default": 500
          },
          "maxMatchesPerPlayer": {
            "title": "Recent matches per player (player mode)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many of the player's latest results to return, newest first (0 = profile only).",
            "default": 20
          },
          "maxMatchesPerTournament": {
            "title": "Matches per tournament (tournament mode)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on matches returned for one tournament's current edition, upcoming first then completed.",
            "default": 200
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many requests to run at once. Three is gentle; raise it for large date ranges with statistics on.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "SofaScore answers only residential IPs, so keep <b>Residential</b> proxies on. A whole day of ATP matches is about 250 KB — a fraction of a cent.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "wtaDiscipline": {
            "title": "🏆 WTA ranking table",
            "enum": [
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Singles or doubles list. Used by the <b>WTA official — rankings</b> mode.",
            "default": "singles"
          },
          "wtaYear": {
            "title": "📅 WTA season",
            "minimum": 1970,
            "maximum": 2100,
            "type": "integer",
            "description": "Limit the official WTA match history to one season, e.g. <code>2025</code>. Leave empty for the most recent matches."
          },
          "playerNames": {
            "title": "🔍 WTA player names",
            "type": "array",
            "description": "Players to look up in the official WTA modes, by name, e.g. <code>Sabalenka</code>. Each name is resolved against the tour's own player list.",
            "items": {
              "type": "string"
            }
          },
          "newestFirst": {
            "title": "🆕 Most recent first",
            "type": "boolean",
            "description": "In the official WTA match history, start from the latest matches instead of the start of the player's career.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}