{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Scraper: ATP & WTA Rankings, Matches, Stats, H2H",
    "description": "Tennis scraper and ATP WTA rankings API: official rankings with Elo, live scores and results, tournaments, player profiles, match-by-match serve/return stats and head-to-head. Search by player name.",
    "version": "0.1",
    "x-build-id": "wvrBdXiQ3SNoHfxfA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/siftwright_data~tennis-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-siftwright_data-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/siftwright_data~tennis-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-siftwright_data-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/siftwright_data~tennis-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-siftwright_data-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "rankings",
              "matches",
              "tournaments",
              "players",
              "playerMatches",
              "headToHead"
            ],
            "type": "string",
            "description": "Rankings: official ATP/WTA top 150 with Elo ratings added, or the full Elo list. Matches: live, finished and scheduled matches with set scores. Tournaments: tournament calendar with champions. Players: profile, ranking, Elo and serve/return stats. Player matches: match-by-match results with full serve and return statistics. Head-to-head: record between two players plus every meeting.",
            "default": "rankings"
          },
          "tours": {
            "title": "Tours",
            "type": "array",
            "description": "ATP (men), WTA (women) or both.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta"
              ],
              "enumTitles": [
                "ATP",
                "WTA"
              ]
            },
            "default": [
              "atp",
              "wta"
            ]
          },
          "players": {
            "title": "Players",
            "maxItems": 200,
            "type": "array",
            "description": "Player names, no IDs needed, e.g. <code>Jannik Sinner</code>, <code>Sabalenka</code>. For head-to-head enter pairs: <code>Sinner vs Alcaraz</code>. In Matches mode this filters matches to these players.",
            "items": {
              "type": "string"
            }
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "official",
              "elo"
            ],
            "type": "string",
            "description": "Official: current ATP/WTA top 150 with points and movement. Elo: the full Elo rating list (overall, hard, clay, grass), a few hundred players per tour.",
            "default": "official"
          },
          "includeElo": {
            "title": "Add Elo ratings to official rankings",
            "type": "boolean",
            "description": "Adds overall, hard, clay and grass Elo to each official ranking row.",
            "default": true
          },
          "date": {
            "title": "Date (or start date)",
            "type": "string",
            "description": "Matches: the day to fetch (YYYY-MM-DD, or today / yesterday / tomorrow). Default today. Tournaments: start of the range, default 1 January of this year."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Optional end of the date range (YYYY-MM-DD). Matches: up to 31 days. Tournaments: default 31 December of this year."
          },
          "matchStatus": {
            "title": "Match status",
            "type": "array",
            "description": "Keep only these match states. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "finished",
                "scheduled"
              ],
              "enumTitles": [
                "Live",
                "Finished",
                "Scheduled"
              ]
            }
          },
          "matchTypes": {
            "title": "Match types",
            "type": "array",
            "description": "Singles, doubles or both.",
            "items": {
              "type": "string",
              "enum": [
                "singles",
                "doubles"
              ],
              "enumTitles": [
                "Singles",
                "Doubles"
              ]
            },
            "default": [
              "singles"
            ]
          },
          "wholeTournament": {
            "title": "Whole tournament",
            "type": "boolean",
            "description": "Return every match of the tournaments running on the date, not only the matches played that day.",
            "default": false
          },
          "year": {
            "title": "Season",
            "minimum": 1968,
            "maximum": 2100,
            "type": "integer",
            "description": "Player match stats and head-to-head: keep only matches from this year."
          },
          "surface": {
            "title": "Surface",
            "enum": [
              "Hard",
              "Clay",
              "Grass",
              "Carpet"
            ],
            "type": "string",
            "description": "Player match stats and head-to-head: keep only matches on this surface."
          },
          "lastNMatches": {
            "title": "Last N matches",
            "minimum": 0,
            "type": "integer",
            "description": "Player match stats: keep only the most recent N matches per player. 0 = all.",
            "default": 0
          },
          "includeH2HMatches": {
            "title": "Include each head-to-head meeting",
            "type": "boolean",
            "description": "Besides the head-to-head summary row, add one row per meeting with full match stats.",
            "default": true
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows. Useful to cap cost.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Only used as a fallback if a request is blocked. The default Apify datacenter proxy is enough.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}