{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Abstract Scraper - Match History, Serve Stats, Elo",
    "description": "Scrape Tennis Abstract without login: every ATP match of a player with score, surface, level, round, rank, serve and return stats and dominance ratio, plus the player profile and the ATP and WTA Elo ratings (overall, hard, clay, grass). Filter by year, surface and level. Export to Excel, CSV or API.",
    "version": "0.1",
    "x-build-id": "dBWfBabuMNY6wtadR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pshivam~tennis-abstract-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pshivam-tennis-abstract-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/pshivam~tennis-abstract-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pshivam-tennis-abstract-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/pshivam~tennis-abstract-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pshivam-tennis-abstract-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": {
          "players": {
            "title": "Players",
            "type": "array",
            "description": "Men's players to read, one per line: a name (Jannik Sinner, Alex de Minaur) or a Tennis Abstract player link (www.tennisabstract.com/cgi-bin/player.cgi?p=JannikSinner). Names are matched with the ATP rating report, so accents and hyphens do not matter.",
            "items": {
              "type": "string"
            }
          },
          "topEloPlayers": {
            "title": "Top players by Elo",
            "minimum": 0,
            "maximum": 600,
            "type": "integer",
            "description": "Also read the best ATP players of the Elo rating, 1 to 600 (0 = none). Each player is a page of the site, read about every 2 seconds.",
            "default": 0
          },
          "includeProfiles": {
            "title": "Include player profiles",
            "type": "boolean",
            "description": "One profile record per player: country, hand, height, birth date, rank, peak rank, Elo rating, win and loss count.",
            "default": true
          },
          "includeMatches": {
            "title": "Include matches",
            "type": "boolean",
            "description": "One record per match of each player, newest first: score, surface, level, round, ranks, serve stats and dominance ratio.",
            "default": true
          },
          "matchesSince": {
            "title": "Matches since",
            "type": "string",
            "description": "Only matches from this year, month or day on: 2023, 2023-06 or 2023-06-15. Leave empty for the whole career."
          },
          "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",
                "Clay",
                "Grass",
                "Carpet"
              ]
            }
          },
          "levels": {
            "title": "Levels",
            "type": "array",
            "description": "Only matches at these levels. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "grandSlam",
                "masters",
                "tour",
                "finals",
                "davisCup",
                "challenger",
                "itf"
              ],
              "enumTitles": [
                "Grand Slam",
                "Masters 1000",
                "ATP Tour (250 / 500)",
                "Tour Finals",
                "Davis Cup",
                "Challenger",
                "ITF and satellite events"
              ]
            }
          },
          "maxMatchesPerPlayer": {
            "title": "Matches per player",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each player after this many matches, newest first. 0 means all of them (a long career has 1,000 or more).",
            "default": 0
          },
          "eloRankings": {
            "title": "Elo ratings",
            "type": "array",
            "description": "Also return the Elo rating report of these tours: one record per player with the overall, hard, clay and grass Elo, age and peak. The women's tour has ratings only, no match lists.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta"
              ],
              "enumTitles": [
                "ATP (men)",
                "WTA (women)"
              ]
            }
          },
          "eloRankingRows": {
            "title": "Players per rating",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "How many players of each rating to return, best first.",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip records that earlier runs of this same input already returned, so you get and pay for new ones only. The first run works as usual and remembers what it returned, in your key-value store 'tennis-abstract-scraper-only-new'.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop after this many records in total (profiles, matches and rating lines). You are charged per record.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Players at the same time",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "How many player pages are read at the same time. The site limits fast readers, so keep this low.",
            "default": 2
          },
          "secondsBetweenRequests": {
            "title": "Seconds between requests",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Pause between requests. Tennis Abstract refuses an address that reads too fast: the Actor then lets it rest and lengthens the pause.",
            "default": 2
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The Actor reads with its own address and uses this proxy only while the site refuses that address (a new address for every request). Apify Proxy is used when your account has it. Turn the proxy off to wait instead.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}