{
  "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": "Sfgqyc9XqKcft9MKL"
  },
  "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "🎾 What to get",
            "enum": [
              "schedule",
              "live",
              "results",
              "match",
              "player",
              "search",
              "rankings",
              "wtaMatches",
              "wtaRankings",
              "wtaPlayers",
              "wtaTournaments"
            ],
            "type": "string",
            "description": "<b>Schedule</b>: every match in a date window — upcoming, live and played — for the tours you pick. <b>Live</b>: only what is on court right now. <b>Results</b>: completed matches with scores and winners, newest first. <b>Match</b>: one named match with optional statistics, point-by-point and head-to-head. <b>Player</b>: a player's matches inside the date window. <b>Search</b>: find a player id by name. <b>Rankings</b>: the official ATP and WTA lists. The <b>WTA official</b> modes read the tour's own API and add ranking points per match and prize money.",
            "default": "schedule"
          },
          "dateFrom": {
            "title": "📅 Date",
            "type": "string",
            "description": "Day to list matches for, <code>YYYY-MM-DD</code> in UTC. Leave empty for today. Only a rolling window of roughly two months around today is available from this source."
          },
          "daysBack": {
            "title": "⬅️ Days back",
            "minimum": 0,
            "maximum": 14,
            "type": "integer",
            "description": "How many days <b>before</b> the date to include (0–14). Use 1 in <b>Results</b> mode to get yesterday's finished matches as well as today's.",
            "default": 0
          },
          "days": {
            "title": "➡️ Days ahead",
            "minimum": 0,
            "maximum": 14,
            "type": "integer",
            "description": "How many days after the date to include (0 = that day only, up to 14). Use 6 for a whole tournament week.",
            "default": 0
          },
          "tours": {
            "title": "🏆 Tours",
            "type": "array",
            "description": "Which circuits to keep. ATP and WTA are preselected because they are what most buyers want and they keep a run small; the Challenger and ITF levels add several hundred matches a day. Grand Slams appear under ATP and WTA. One request covers the whole day whatever you pick here, so narrowing the list makes a run cheaper, not slower.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta",
                "challenger",
                "challenger_women",
                "itf_men",
                "itf_women",
                "davis_cup",
                "bjk_cup",
                "united_cup",
                "exhibition",
                "all"
              ],
              "enumTitles": [
                "ATP (incl. Grand Slams, men)",
                "WTA (incl. Grand Slams, women)",
                "ATP Challenger",
                "WTA 125 / Challenger women",
                "ITF men",
                "ITF women",
                "Davis Cup",
                "Billie Jean King Cup",
                "United Cup",
                "Exhibition",
                "Every tour"
              ]
            },
            "default": [
              "atp",
              "wta"
            ]
          },
          "status": {
            "title": "🎯 Keep only",
            "enum": [
              "any",
              "upcoming",
              "live",
              "finished",
              "notPlayed"
            ],
            "type": "string",
            "description": "Filter by state. <b>Played</b> keeps everything that produced a result, including retirements and walkovers — the row's own <code>status</code> column says which it was. <b>Not played</b> is the opposite: cancelled, postponed, interrupted.",
            "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>. Used by schedule, live, results and player modes. A surname is enough."
          },
          "matchIds": {
            "title": "🆔 Match ids or URLs (match mode)",
            "type": "array",
            "description": "FlashScore match ids such as <code>pnSMQFtQ</code>, or the match URLs they come from. Ids are in the <code>matchId</code> column of any schedule or results run. They can only be looked up while the match is inside the source's rolling week.",
            "items": {
              "type": "string"
            }
          },
          "playerIds": {
            "title": "🧑 Player ids (player and WTA modes)",
            "type": "array",
            "description": "Player ids from the <code>homePlayerId</code> / <code>awayPlayerId</code> columns, or numeric WTA ids for the official WTA modes. Use <b>Search</b> mode to find them by name.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "🔍 Name to search (search mode)",
            "type": "string",
            "description": "Player name, e.g. <code>Alcaraz</code>. Returns the 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 read. Each list comes from that tour's own site, so one failing does not take the other down.",
            "default": "both"
          },
          "rankingDiscipline": {
            "title": "🥇 Rankings: singles or doubles",
            "enum": [
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Doubles lists can share a rank between two players; such rows carry <code>tied: true</code> and the next rank is skipped, exactly as the tour publishes it.",
            "default": "singles"
          },
          "rankingTop": {
            "title": "🥇 Ranking rows per tour",
            "minimum": 1,
            "maximum": 1500,
            "type": "integer",
            "description": "How many players from the top of each list. One hundred per page, so 100 is one request per tour.",
            "default": 100
          },
          "includeStatistics": {
            "title": "📊 Add match statistics to every match",
            "type": "boolean",
            "description": "Aces, double faults, first and second serve, break points, winners, points and games won — for the whole match and per set, around 65 numbers. Available once a match is under way. One extra request and one extra billed row per match.",
            "default": false
          },
          "includePointByPoint": {
            "title": "🎯 Add point-by-point to every match",
            "type": "boolean",
            "description": "Every game of every set with its point sequence, who served and who won the game. For modelling and trading; leave off if you only need scores.",
            "default": false
          },
          "includeHeadToHead": {
            "title": "🤝 Add head-to-head to every match",
            "type": "boolean",
            "description": "Recent form of both players and their previous meetings, grouped by surface. This is the heaviest extra — well over a hundred kilobytes per match — so use it on a short list, not a whole day.",
            "default": false
          },
          "maxMatches": {
            "title": "💯 Maximum rows per run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap across every mode, and the main control over what a run costs. Fifty rows of ATP and WTA is a normal day.",
            "default": 50
          },
          "maxMatchesPerPlayer": {
            "title": "Matches per player (player and WTA modes)",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many of a player's matches to return. In player mode the search walks back day by day, so a wider <b>Days back</b> finds more.",
            "default": 20
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many requests to run at once. Three is gentle and enough for a day of matches; raise it only when the extras are on for a long list.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Off by default, on purpose. This source answers ordinary datacenter addresses, and one day of matches is well over a megabyte — pushing that through residential addresses would cost more in bandwidth than the rows themselves. If a run is ever refused, the Actor retries through the Apify proxy once and tells you in the log.",
            "default": {
              "useApifyProxy": false
            }
          },
          "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}