{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Player Match History: Results, H2H, Stats & Odds",
    "description": "Full match history of any tennis player from Flashscore: every result with tournament, surface, round, opponent and score, plus head-to-head, match statistics and opening and closing bookmaker odds. ATP, WTA, Challenger and ITF.",
    "version": "0.1",
    "x-build-id": "mcMZg4baGroiEKi7M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/keelwright~tennis-player-history/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-keelwright-tennis-player-history",
        "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/keelwright~tennis-player-history/runs": {
      "post": {
        "operationId": "runs-sync-keelwright-tennis-player-history",
        "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/keelwright~tennis-player-history/run-sync": {
      "post": {
        "operationId": "run-sync-keelwright-tennis-player-history",
        "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": [
          "players"
        ],
        "properties": {
          "players": {
            "title": "Players",
            "type": "array",
            "description": "Names (Carlos Alcaraz, Iga Swiatek, Djokovic) or Flashscore player URLs (https://www.flashscore.com/player/djokovic-novak/AZg49Et9/). When a name fits several players, the best known one is used and the log lists the others; paste a URL to pick a specific player.",
            "items": {
              "type": "string"
            }
          },
          "matchTypes": {
            "title": "Singles, doubles or mixed",
            "type": "array",
            "description": "Which of the player's matches to get. Singles when empty.",
            "items": {
              "type": "string",
              "enum": [
                "singles",
                "doubles",
                "mixed"
              ],
              "enumTitles": [
                "Singles",
                "Doubles",
                "Mixed doubles"
              ]
            },
            "default": [
              "singles"
            ]
          },
          "maxMatchesPerPlayer": {
            "title": "Latest matches per player",
            "minimum": 0,
            "type": "integer",
            "description": "Only each player's latest N matches that fit the filters (per match type). 0 means the whole career that fits the dates.",
            "default": 0
          },
          "dateFrom": {
            "title": "From date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Only matches on or after this day (UTC). A date such as 2024-01-01, or a period back from today such as 12 months. Empty means the whole career; tour-level results go back to the late 1990s."
          },
          "dateTo": {
            "title": "To date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Only matches on or before this day (UTC). Empty means up to today."
          },
          "opponents": {
            "title": "Opponents (head-to-head)",
            "type": "array",
            "description": "Only matches against these players: names (Jannik Sinner, Sinner) or Flashscore player URLs. With one player above and one here you get their head-to-head.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "surfaces": {
            "title": "Surfaces",
            "type": "array",
            "description": "Only matches on these surfaces. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "hard",
                "clay",
                "grass",
                "carpet"
              ],
              "enumTitles": [
                "Hard (indoor and outdoor)",
                "Clay",
                "Grass",
                "Carpet"
              ]
            },
            "default": []
          },
          "tours": {
            "title": "Tours",
            "type": "array",
            "description": "Only these levels. ATP and WTA include Grand Slams, Davis Cup, Billie Jean King Cup, United Cup and the Olympics. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta",
                "challenger-men",
                "challenger-women",
                "itf-men",
                "itf-women",
                "exhibition",
                "other"
              ],
              "enumTitles": [
                "ATP",
                "WTA",
                "Challenger (men)",
                "Challenger (women)",
                "ITF (men)",
                "ITF (women)",
                "Exhibition",
                "Other (incl. mixed doubles)"
              ]
            },
            "default": []
          },
          "mainDrawOnly": {
            "title": "Main draw only",
            "type": "boolean",
            "description": "Leave out qualifying matches.",
            "default": false
          },
          "includeRound": {
            "title": "Round",
            "type": "boolean",
            "description": "The round, as Flashscore names it (Quarter-finals) and as a short code (R128 … R16, QF, SF, F, Q1-Q3 in qualifying, RR for group stages). Turn off for faster runs.",
            "default": true
          },
          "includeStatistics": {
            "title": "Match statistics and duration",
            "type": "boolean",
            "description": "Aces, double faults, first serve %, points won on serve and return, break points saved and converted, winners, unforced errors and more, for the match and each set, plus the match and set durations. Flashscore has statistics for most tour-level matches since about 2018 and Grand Slams since about 2012.",
            "default": false
          },
          "includeOdds": {
            "title": "Bookmaker odds",
            "type": "boolean",
            "description": "Opening and closing match-winner odds from each bookmaker, with the best and average price, the implied win probability and who was the favourite. Available for most matches since about 2010.",
            "default": false
          },
          "oddsMarkets": {
            "title": "Odds markets",
            "enum": [
              "matchWinner",
              "all"
            ],
            "type": "string",
            "description": "Match winner only, or every market Flashscore lists: set winner, total games, game and set handicaps, correct score.",
            "default": "matchWinner"
          },
          "oddsCountries": {
            "title": "Bookmakers from",
            "type": "array",
            "description": "Bookmakers differ by country. The United Kingdom has the most for past matches (about 7-9 from 2010 on, up to 20 for recent ones). Each extra country adds one request per match.",
            "items": {
              "type": "string",
              "enum": [
                "GB",
                "IT",
                "ES",
                "FR",
                "IE",
                "SE",
                "MX",
                "ZA",
                "CA-ON",
                "CA-QC",
                "DE",
                "RO",
                "AR",
                "CO",
                "DK",
                "PL",
                "TH",
                "US-NJ",
                "US-NY",
                "US-AZ",
                "GR",
                "AT",
                "CZ",
                "NG",
                "PT",
                "AU",
                "CH",
                "NL",
                "IN",
                "JP",
                "KE",
                "TR"
              ],
              "enumTitles": [
                "United Kingdom",
                "Italy",
                "Spain",
                "France",
                "Ireland",
                "Sweden",
                "Mexico",
                "South Africa",
                "Canada (Ontario)",
                "Canada (other provinces)",
                "Germany",
                "Romania",
                "Argentina",
                "Colombia",
                "Denmark",
                "Poland",
                "Thailand",
                "USA (New Jersey)",
                "USA (New York)",
                "USA (Arizona)",
                "Greece",
                "Austria",
                "Czechia",
                "Nigeria",
                "Portugal",
                "Australia",
                "Switzerland",
                "Netherlands",
                "India",
                "Japan",
                "Kenya",
                "Turkey"
              ]
            },
            "default": [
              "GB"
            ]
          },
          "onlyNew": {
            "title": "Only new matches",
            "type": "boolean",
            "description": "Save only matches that an earlier run with the same settings did not return. Use it with a schedule (for example daily) to collect each player's new results without paying for old rows again.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many rows in total. 0 means no limit. A long career has 1,000-1,600 singles matches.",
            "default": 10000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many requests run at the same time.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed in most cases: Flashscore answers Apify's servers directly. Turn it on only if runs start failing with \"blocked\".",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}