{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Point-by-Point Scraper — Rally & Match Stats",
    "description": "Point-by-point tennis data no other scraper sells — every serve, rally, and break point of a match, in play order, plus the complete match- and set-level statistics table. Find players by name, then export full match records as JSON, CSV, or Excel. No API key.",
    "version": "1.0",
    "x-build-id": "k9B1THG9aOdcfZePe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~tennis-point-by-point-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-tennis-point-by-point-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/sian.agency~tennis-point-by-point-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-tennis-point-by-point-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/sian.agency~tennis-point-by-point-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-tennis-point-by-point-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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "🎯 Operation — what do you want to do?",
            "enum": [
              "scrape-matches",
              "discover-players",
              "discover-matches",
              "scrape-match-ids"
            ],
            "type": "string",
            "description": "🎯 **Pick one operation per run.** Each run produces one clean dataset matching the chosen mode.\n\n- **🎾 Scrape a player's matches** — the main event. Full matches: every point in play order plus the complete statistics table\n- **🔎 Find players** — look up a player by name to get their ID\n- **📋 Build a match list** — collect unique match IDs for a roster without scraping them yet (not billed)\n- **📋 Scrape specific matches** — scrape match IDs you already have\n\n💡 **Just hit Start.** A player is already filled in below, so a default run returns real matches straight away.\n\n🔎 **Scraping someone else?** Switch to `Find players`, search their name, copy the `playerId` from the results into 🎾 Player IDs, then switch back here.\n\n🧭 **For big jobs:** `Build a match list` first — it deduplicates matches shared between players so you never pay for the same match twice — then feed the IDs to `Scrape specific matches` in batches.",
            "default": "scrape-matches"
          },
          "playerIds": {
            "title": "🎾 Player IDs",
            "maxItems": 500,
            "type": "array",
            "description": "🎾 **Required for `Scrape a player's matches` and `Build a match list`.** Ignored by the other operations.\n\nPaste one or more player IDs from your `Find players` results. Add as many as you like — up to 500 — and a match shared by two of them is fetched, and billed, only once.\n\n💡 Not every player in the directory has matches on file; coverage is strongest on ATP Challenger and ITF events. Run `Build a match list` first to see what exists for your roster without being billed for it.",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "default": []
          },
          "search": {
            "title": "🔎 Player name",
            "type": "string",
            "description": "🔎 **Used by `Find players`.** Ignored by every other operation.\n\nType part of a player's name — first name, surname, or both. Matching is partial and case-insensitive, so `dinev` and `Dinev` both work.\n\n⚠️ **Leave this empty and you get the whole directory — about 2,600 players, billed per row.** Keep a name here unless you deliberately want the full list.\n\n💡 **Next step:** copy the `playerId` from your results into 🎾 Player IDs, then switch the operation back to `Scrape a player's matches`.",
            "default": "Dinev"
          },
          "maxPlayers": {
            "title": "Player limit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The hard ceiling on player rows returned by `Find players`.\n\nThis is your spend guard: every player row is billed, and an empty name field matches the whole directory of roughly 2,600 players. Raise it when you genuinely want a bigger slice — up to 10,000.",
            "default": 100
          },
          "matchRequests": {
            "title": "📋 Match IDs to scrape",
            "maxItems": 250,
            "type": "array",
            "description": "📋 **Required for `Scrape specific matches`.** Ignored by every other operation — most users never touch this field.\n\nUse it only when you already hold match IDs, typically from a `Build a match list` run, and want to scrape them in controlled batches. Up to 250 per run.\n\nEach entry takes a `matchId`, and optionally the players it belongs to:\n\n```json\n[{ \"matchId\": \"313b5434-cffc-4938-804c-e6edeec28e8e\" }]\n```\n\n💡 **Scraping one player?** Ignore this and use `Scrape a player's matches` instead.",
            "items": {
              "type": "object",
              "required": [
                "matchId"
              ],
              "properties": {
                "matchId": {
                  "title": "Match ID",
                  "description": "A match ID from a `Build a match list` run.",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
                },
                "requestedPlayerIds": {
                  "title": "Player IDs this match belongs to",
                  "description": "Optional. Carried through to the output so you can trace a match back to the players you asked for.",
                  "type": "array",
                  "default": [],
                  "items": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
                  }
                }
              }
            },
            "default": []
          },
          "maxMatchesPerPlayer": {
            "title": "Matches per player",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap how many matches to take from each player's history. Set `0` to take every match on file.\n\nStarts at `5` so your first run is quick and cheap. Raise it once you have seen the data — there is no upper limit beyond the total cap below.",
            "default": 5
          },
          "maxTotalMatches": {
            "title": "Total match limit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The hard ceiling on matches scraped in one run, applied after duplicates are removed.\n\nThis is your spend guard: a run can never bill more matches than this number. Raise it deliberately for a planned bulk retrieval — up to 10,000.",
            "default": 20
          },
          "matchFormat": {
            "title": "Singles or doubles",
            "enum": [
              "all",
              "singles"
            ],
            "type": "string",
            "description": "Choose `Singles only` to skip doubles matches.\n\nDoubles are identified from match metadata and dropped before any point or statistics parsing, so **you are never billed for a match this filter removes**.",
            "default": "all"
          },
          "includePoints": {
            "title": "Include point-by-point data",
            "type": "boolean",
            "description": "Keep this on for the rally-level data — sets, games, and every point in play order, each with server, receiver, shot sequence, and break-point flags.\n\nTurn it off for a lighter payload when you only want scorelines and statistics. The price per match is the same either way.",
            "default": true
          },
          "includeStats": {
            "title": "Include match & set statistics",
            "type": "boolean",
            "description": "Keep this on for the full statistics table — serve, return, break points, and shot-quality ratings, at both match and set level. A typical match carries 40–90 statistic rows.\n\nTurn it off for a lighter payload. The price per match is the same either way.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}