{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Scraper — Live Scores, Matches, Rankings & Odds",
    "description": "Tennis scraper and API: live scores, ATP/WTA/Challenger/ITF matches by date, set scores, stats, point-by-point, H2H, bookmaker odds and rankings. JSON, CSV, Excel.",
    "version": "0.1",
    "x-build-id": "d1lHQW5Z9tpu0v3I5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/innolabs~tennis-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-innolabs-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/innolabs~tennis-scraper/runs": {
      "post": {
        "operationId": "runs-sync-innolabs-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/innolabs~tennis-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-innolabs-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "matches",
              "live",
              "details",
              "rankings",
              "players"
            ],
            "type": "string",
            "description": "Matches by date (results, live scores and schedule for up to 15 days), live matches only, full details for specific matches, ATP/WTA rankings, or player profiles with their recent and upcoming matches.",
            "default": "matches"
          },
          "dateFrom": {
            "title": "Date (from)",
            "type": "string",
            "description": "First day to scrape (UTC): YYYY-MM-DD, 'today', 'yesterday', 'tomorrow' or a relative day such as -3 or +2. Up to 7 days back and up to 7 days ahead.",
            "default": "today"
          },
          "dateTo": {
            "title": "Date (to)",
            "type": "string",
            "description": "Last day to scrape (inclusive), same formats as 'Date (from)'. Leave empty for a single day."
          },
          "tours": {
            "title": "Tours",
            "type": "array",
            "description": "Keep only these tours. Empty = every tour (ATP, WTA, Challenger incl. WTA 125, ITF, plus Davis Cup, Billie Jean King Cup, juniors, exhibitions and others).",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta",
                "challenger",
                "itf",
                "other"
              ],
              "enumTitles": [
                "ATP",
                "WTA",
                "Challenger (men) / WTA 125 (women)",
                "ITF",
                "Other (team cups, juniors, exhibitions…)"
              ]
            }
          },
          "matchType": {
            "title": "Singles / doubles",
            "enum": [
              "all",
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Singles only, doubles only (incl. mixed doubles) or both. Also applies to player matches.",
            "default": "all"
          },
          "status": {
            "title": "Match status",
            "enum": [
              "any",
              "scheduled",
              "live",
              "finished"
            ],
            "type": "string",
            "description": "Keep only scheduled, live or finished matches (finished includes retirements, walkovers and awarded matches).",
            "default": "any"
          },
          "tournamentQuery": {
            "title": "Tournament contains",
            "type": "string",
            "description": "Optional case-insensitive filter on the tournament name or country, e.g. 'Paris' or 'Australian Open'."
          },
          "fallbackToRecent": {
            "title": "If nothing matches, return the latest finished matches",
            "type": "boolean",
            "description": "When the selected day and filters have no matches (e.g. tour off-season), return the most recent finished matches from the previous 7 days instead of an empty dataset; if the selected tours have none, other tours are used.",
            "default": true
          },
          "matchUrls": {
            "title": "Match URLs or ids",
            "type": "array",
            "description": "Flashscore match URLs (e.g. https://www.flashscore.com/match/tennis/hurkacz-hubert-zuHOBnY9/musetti-lorenzo-xtH2ODVI/?mid=25mNr3v3) or 8-character match ids (e.g. 25mNr3v3). Every match item in this dataset has its id and url.",
            "items": {
              "type": "string"
            }
          },
          "includeStatistics": {
            "title": "Add match statistics",
            "type": "boolean",
            "description": "Aces, double faults, serve and return points won, break points, winners, unforced errors… per match and per set. Match details mode always includes them.",
            "default": false
          },
          "includePointByPoint": {
            "title": "Add point-by-point",
            "type": "boolean",
            "description": "Every game with server, winner, breaks and the point sequence, plus tiebreak points. Match details mode always includes it.",
            "default": false
          },
          "includeH2H": {
            "title": "Add head-to-head",
            "type": "boolean",
            "description": "Previous meetings of the two players/teams with date, tournament, surface, score and winner. Match details mode always includes it.",
            "default": false
          },
          "includeOdds": {
            "title": "Add bookmaker odds",
            "type": "boolean",
            "description": "Match-winner odds (current and opening) for every bookmaker listed for the chosen country, plus the best and average price. Match details mode always includes them.",
            "default": false
          },
          "oddsCountry": {
            "title": "Odds country",
            "enum": [
              "GB",
              "IE",
              "US",
              "CA",
              "AU",
              "DE",
              "FR",
              "IT",
              "ES",
              "PL",
              "CZ",
              "NL",
              "SE",
              "DK",
              "AT",
              "PT",
              "GR",
              "RO",
              "ZA",
              "NG",
              "KE",
              "IN",
              "MX",
              "CO"
            ],
            "type": "string",
            "description": "Bookmakers are country-specific. United Kingdom lists the most bookmakers; US odds are those offered in New Jersey, Canada's those in Ontario.",
            "default": "GB"
          },
          "allOddsMarkets": {
            "title": "All odds markets",
            "type": "boolean",
            "description": "Besides match winner, also return set winner, total games over/under, game/set handicaps, correct score and odd/even markets per bookmaker (much larger items).",
            "default": false
          },
          "rankingTypes": {
            "title": "Rankings",
            "type": "array",
            "description": "Which rankings to download.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta",
                "atp-race",
                "wta-race",
                "atp-doubles",
                "wta-doubles",
                "atp-doubles-race",
                "wta-doubles-race"
              ],
              "enumTitles": [
                "ATP Singles",
                "WTA Singles",
                "ATP Race",
                "WTA Race",
                "ATP Doubles",
                "WTA Doubles",
                "ATP Doubles Race",
                "WTA Doubles Race"
              ]
            },
            "default": [
              "atp",
              "wta"
            ]
          },
          "topN": {
            "title": "Top N players per ranking",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many ranked players to return per ranking (the full ATP list has about 2,300 players).",
            "default": 100
          },
          "players": {
            "title": "Players (URLs or names)",
            "type": "array",
            "description": "Flashscore player URLs (e.g. https://www.flashscore.com/player/sinner-jannik/6HdC3z4H/) or player names (e.g. Iga Swiatek); a name is matched to the best tennis player hit.",
            "items": {
              "type": "string"
            }
          },
          "maxMatchesPerPlayer": {
            "title": "Matches per player",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Latest results and upcoming matches to return per player, newest first. 0 = profile only.",
            "default": 20
          },
          "addPlayerRanks": {
            "title": "Add player rankings to matches",
            "type": "boolean",
            "description": "Add each player's current ATP/WTA rank and ranking points (singles ranking for singles, doubles ranking for doubles).",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on dataset items (matches, rankings rows and players together). The run stops cleanly when reached.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for normal use. Switch on Apify Proxy only if requests start failing.",
            "default": {
              "useApifyProxy": false
            }
          },
          "debug": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Verbose logs for development.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}