{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Abstract Data API",
    "description": "Export ATP and WTA player match histories from Tennis Abstract, including scores, opponents, surfaces, and available serve and return statistics. Filter by season, surface or head-to-head opponent; export JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "qT1YicL2yaIgMSVgM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/danthedataman~tennis-abstract-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-danthedataman-tennis-abstract-data-api",
        "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/danthedataman~tennis-abstract-data-api/runs": {
      "post": {
        "operationId": "runs-sync-danthedataman-tennis-abstract-data-api",
        "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/danthedataman~tennis-abstract-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-danthedataman-tennis-abstract-data-api",
        "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": "Who to fetch. Each entry is a Tennis Abstract player slug (<code>NovakDjokovic</code>), a pasted player-page URL in either form (<code>player-classic.cgi?p=NovakDjokovic</code>, <code>player.cgi?p=104925/Novak-Djokovic</code>, <code>wplayer-classic.cgi?p=IgaSwiatek</code>), or a discovery token: <code>@elo-top:10</code> takes the top N slugs from the site's own Elo report, <code>@leaders:1-50</code> and <code>@wta-leaders:1-50</code> take the site's leader lists. Left empty the run fetches nothing, writes no result rows and incurs no result-row charge (the automatic start event is charged once per run), and exits with a note in the log &mdash; it is never back-filled with a player you did not ask for.",
            "items": {
              "type": "string"
            }
          },
          "tour": {
            "title": "Tour",
            "type": "string",
            "description": "Which surface family to read a player from. <b>Auto</b> tries the ATP page first and the WTA pages second, and accepts the first whose own published name matches the slug you asked for &mdash; the ATP path answers 200 for a WTA slug with a different player's page, so the name check is what makes auto safe.",
            "default": "auto"
          },
          "span": {
            "title": "Time span",
            "type": "string",
            "description": "Keep only matches in this span, using the site's own <code>Time Span</code> vocabulary: <code>Career</code>, <code>Last 52</code>, or a four-digit season. <code>Last 52</code> counts back from the run clock for an active player and from the player's newest match otherwise, which is the page's own rule. Leave empty to keep every match."
          },
          "surface": {
            "title": "Surface",
            "type": "string",
            "description": "Keep only matches on this surface. The four values are the site's own <code>Surface</code> control and are the only four measured in a full ATP career capture. Leave empty to keep every surface."
          },
          "level": {
            "title": "Tournament level",
            "type": "string",
            "description": "Keep only matches at this level, matched exactly against the site's own raw code. The site's <code>levdict</code> names <code>G M C Q D J S</code>; the rows also carry <code>A</code>, <code>F</code> and <code>O</code>, which the page itself never names, so they are offered as the codes they are rather than under a label we invented. Any other code the source emits is accepted too. Leave empty to keep every level."
          },
          "round": {
            "title": "Round",
            "type": "string",
            "description": "Keep only matches in this round, matched exactly against the site's own raw code. The site's <code>rddict</code> names <code>F SF QF R16 R32 R64 R128 RR</code>; the rows also carry <code>BR</code> and <code>Q1</code>-<code>Q3</code>, which the page itself never names. Any other code the source emits is accepted too. Leave empty to keep every round."
          },
          "tourney": {
            "title": "Tournament",
            "type": "string",
            "description": "Keep only matches whose tournament name contains this text, case-insensitively. A substring rather than an exact match because the site prefixes current-season rows &mdash; <code>US Open</code> keeps both <code>US Open</code> and <code>ATP US Open</code>. Type any tournament; the suggestions are names measured in a saved capture. Leave empty to keep every tournament."
          },
          "result": {
            "title": "Result",
            "type": "string",
            "description": "Keep only wins or only losses, matched against the row's raw <code>W</code> / <code>L</code> value. Leave empty to keep both."
          },
          "opponent": {
            "title": "Head-to-head opponent",
            "type": "string",
            "description": "Keep only matches against this opponent. Written either way &mdash; <code>RafaelNadal</code> or <code>Rafael Nadal</code> &mdash; because the comparison is made on the site's own slug form of the name. This is a filter over rows already fetched, not a second download, so a head-to-head costs the same as the career it came from. Leave empty to keep every opponent."
          },
          "maxMatchesPerPlayer": {
            "title": "Maximum matches per player",
            "minimum": 0,
            "type": "integer",
            "description": "Keep at most this many matches per player, newest first, after the filters above have run. <b>0 means every match</b> &mdash; a full ATP career is around 1,500 rows, so the cap is on by default and 0 is the deliberate way to ask for all of them.",
            "default": 100
          },
          "maxPlayers": {
            "title": "Maximum players per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Fetch at most this many players in one run, applied after the entries above are resolved, so a discovery token can never fan out past it &mdash; <code>@elo-top:200</code> with this left at 50 fetches 50 players. The source is one person's site and pages are fetched at least 1.5 seconds apart.",
            "default": 50
          },
          "includePlayerRecord": {
            "title": "Include a player record row",
            "type": "boolean",
            "description": "Add one <code>recordType: \"player\"</code> row per successfully read player, carrying current and peak rank, birth date, hand, backhand, country, active flag, Twitter handle and the career match count the source publishes. Off by default: it is one extra billable row per player, and the bio would otherwise be repeated on every match row.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. No proxy group is set by default: measured 2026-09-11, this source returned the identical page through Apify's datacenter group, through the residential group and with no proxy at all, so none is needed for correctness. Turn one on if a run is blocked."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}