{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Results, Fixtures, Live Scores & Rankings",
    "description": "Ask by date, date range or player name - no internal IDs. Ranges reach finished tournaments, not just today's. Set-by-set scorelines assembled; head-to-head and recent form as flat columns with win percentages. ATP and WTA rankings with movement. Tour level and singles/doubles as columns.",
    "version": "1.9",
    "x-build-id": "SH8TSbml2I5jEldco"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleanrows~tennis-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleanrows-tennis-data-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/cleanrows~tennis-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cleanrows-tennis-data-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/cleanrows~tennis-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cleanrows-tennis-data-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": {
          "mode": {
            "title": "What to fetch",
            "enum": [
              "schedule",
              "live",
              "rankings",
              "player"
            ],
            "type": "string",
            "description": "Matches for any date past or future, matches in progress right now, the official rankings, or a single player's results and upcoming fixtures.",
            "default": "schedule"
          },
          "dates": {
            "title": "Dates (schedule mode)",
            "type": "array",
            "description": "Explicit dates as YYYY-MM-DD, up to 14. Leave empty to use day offsets instead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date from (schedule mode)",
            "type": "string",
            "description": "Start of a date range, YYYY-MM-DD. Reaches finished tournaments, not just the ones running now, so a past event like a completed Grand Slam is retrievable. Leave dateTo empty to mean today. Ranges longer than 366 days are truncated. A wide window returns its most recent end first, so if maxItems runs out the earlier days are the ones missing - the run summary reports which days were actually covered. Raise maxItems to keep more of the window and maxTournaments to reach further back.",
            "default": ""
          },
          "dateTo": {
            "title": "Date to (schedule mode)",
            "type": "string",
            "description": "End of the range, YYYY-MM-DD, inclusive. Leave dateFrom empty to mean from today. Ignored when Dates is filled in - an explicit list of dates always wins over a range, and a range wins over day offsets.",
            "default": ""
          },
          "dayOffsets": {
            "title": "Day offsets (schedule mode)",
            "type": "array",
            "description": "Days relative to today: -1 is yesterday's results, 0 today, 1 tomorrow's fixtures. Ignored when Dates is set.",
            "default": [
              0
            ]
          },
          "statusFilter": {
            "title": "Match status",
            "enum": [
              "all",
              "finished",
              "inprogress",
              "notstarted",
              "canceled"
            ],
            "type": "string",
            "description": "Applies to schedule and player modes. Canceled and walkover matches are returned by default; filter to Finished to exclude them.",
            "default": "all"
          },
          "tourFilter": {
            "title": "Tours",
            "type": "array",
            "description": "Which circuits to walk. Empty means ATP and WTA, the cheapest useful default. A named tour selects that tour only - ATP no longer drags in ATP Challenger, and WTA no longer drags in WTA 125 - so the tournament budget goes where you asked. Add Challenger or ITF explicitly to include them; each one multiplies the tournaments visited.",
            "items": {
              "type": "string",
              "enum": [
                "ATP",
                "WTA",
                "Challenger",
                "ITF Men",
                "ITF Women"
              ]
            },
            "default": []
          },
          "matchFormat": {
            "title": "Singles or doubles",
            "enum": [
              "all",
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Doubles pairs are detected from the team type, falling back to the slash in paired names.",
            "default": "all"
          },
          "maxTournaments": {
            "title": "Max tournaments (schedule mode)",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "How many tournaments to examine. The default is fine for today and yesterday, which only need the ones currently running. A date range reaching further back has to look through the full list for the category - roughly two extra requests per tournament that turns out not to match - so raise this if a past window comes back short. Reaching Wimbledon from six weeks later took 37.",
            "default": 12
          },
          "playerQuery": {
            "title": "Player name (player mode)",
            "type": "string",
            "description": "Searched by name, so you do not need to know any internal id. Costs one extra request.",
            "default": ""
          },
          "playerIds": {
            "title": "Player IDs (player mode)",
            "type": "array",
            "description": "Skip the name search when you already have SofaScore player ids. Combined with any name search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "matchesPerPlayer": {
            "title": "Matches per player",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Recent matches to return for each player, plus the same number of upcoming ones if enabled.",
            "default": 20
          },
          "includeUpcoming": {
            "title": "Include upcoming fixtures (player mode)",
            "type": "boolean",
            "description": "Add the player's scheduled matches to their completed ones. Costs one extra request per page.",
            "default": true
          },
          "tour": {
            "title": "Tour (rankings mode)",
            "enum": [
              "both",
              "atp",
              "wta"
            ],
            "type": "string",
            "description": "Which tour's rankings to return. Ignored outside rankings mode.",
            "default": "both"
          },
          "minRanking": {
            "title": "Top N only (rankings mode)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only players ranked this high or better. 0 returns all 500 per tour.",
            "default": 0
          },
          "includeHeadToHead": {
            "title": "Include head-to-head",
            "type": "boolean",
            "description": "Prior meetings between the two players as flat columns - h2hMeetings, h2hHomeWins, h2hAwayWins and a derived h2hHomeWinPct - rather than a nested object. Costs one extra request per match. Roughly half of matches have a record; first meetings and doubles pairs usually return none.",
            "default": false
          },
          "includeRecentForm": {
            "title": "Include recent form",
            "type": "boolean",
            "description": "Each player's recent results as flat columns - homeForm and awayForm as a letter streak (newest first), plus FormPlayed, FormWins and a derived FormWinPct for each side. Derived from each player's own match feed, so the result of the match in hand is never counted as prior form. Costs one request per player, cached for the run, so a full draw pays once per name rather than once per match. Players with no completed matches on record return null.",
            "default": false
          },
          "includeStatistics": {
            "title": "Include match statistics",
            "type": "boolean",
            "description": "Aces, double faults, break points and the rest. Costs one extra request per match and lowers the per-run ceiling to 300.",
            "default": false
          },
          "includeOdds": {
            "title": "Include odds markets",
            "type": "boolean",
            "description": "Bookmaker markets for each match. Costs one extra request per match and lowers the per-run ceiling to 300.",
            "default": false
          },
          "includePointByPoint": {
            "title": "Include point-by-point",
            "type": "boolean",
            "description": "Full rally-by-rally record. Costs one extra request per match, returns a lot of data, and lowers the per-run ceiling to 300.",
            "default": false
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Capped at 2000 per run, or 300 when any per-match extra is switched on.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}