{
  "openapi": "3.0.1",
  "info": {
    "title": "TennisExplorer Scraper — Odds, Line Movement, Players, H2H",
    "description": "Scrape tennisexplorer.com — fixtures & results with odds, match details with per-bookmaker odds history (opening price, every move, 4 markets), player profiles, head-to-head records, ATP/WTA rankings incl. history. Pick a mode or paste any URL. JSON, CSV or Excel out.",
    "version": "0.0",
    "x-build-id": "VUBB26bq10uX3yrzD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~tennisexplorer-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-tennisexplorer-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/memo23~tennisexplorer-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-tennisexplorer-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/memo23~tennisexplorer-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-tennisexplorer-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "fixtures",
              "results",
              "matchDetails",
              "players",
              "h2h",
              "rankings",
              "searchPlayers"
            ],
            "type": "string",
            "description": "What this run scrapes. `fixtures` = upcoming matches with odds (today by default), `results` = finished matches with scores and closing odds (yesterday by default), `matchDetails` = deep per-match records including per-bookmaker odds history, `players` = full player profiles, `h2h` = head-to-head records, `rankings` = ATP/WTA ranking tables (current or historical), `searchPlayers` = find players and their slugs by name.",
            "default": "fixtures"
          },
          "startUrls": {
            "title": "TennisExplorer URLs (optional — overrides Mode)",
            "type": "array",
            "description": "Any tennisexplorer.com URLs: `/matches/`, `/next/`, `/results/`, `/match-detail/?id=…`, `/player/{slug}/`, `/mutual/{a}/{b}/`, `/ranking/…` or `/list-players/…`. Each URL is auto-classified and routed to the right parser. Leave empty to use Mode instead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tourType": {
            "title": "Tour / discipline",
            "enum": [
              "all",
              "atp-single",
              "wta-single",
              "atp-double",
              "wta-double"
            ],
            "type": "string",
            "description": "Which tournaments to include: both tours, or a single tour, singles or doubles.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "First day to scrape. Defaults: fixtures = today, results = yesterday. Fixtures for past dates are automatically served from the results pages."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Last day, inclusive. Defaults to Date from (a single day). Ranges are capped at 62 days per run."
          },
          "matchIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Numeric match ids (e.g. `3290771`) or full `/match-detail/?id=…` URLs. Get ids from fixtures/results rows (`matchId` field) or from any TennisExplorer match link.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeOddsHistory": {
            "title": "Include odds history (line movement)",
            "type": "boolean",
            "description": "Keep the full per-bookmaker odds movement — every price change with timestamp plus the opening price — on matchDetails rows, across all four markets (Home/Away, Over/Under, Asian Handicap, Correct Score). Turn off for lighter rows with current + opening odds only.",
            "default": true
          },
          "includeRecentForm": {
            "title": "Include recent form & mutual matches",
            "type": "boolean",
            "description": "Keep the recent-matches blocks (each player's last matches and their mutual meetings) on matchDetails rows.",
            "default": true
          },
          "playerSlugs": {
            "title": "Player slugs or URLs",
            "type": "array",
            "description": "For the players mode: slugs like `djokovic` or full `/player/…` URLs. Find slugs with the searchPlayers mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "h2hPairs": {
            "title": "Head-to-head pairs",
            "type": "array",
            "description": "For the h2h mode. One pair per line: `djokovic vs alcaraz-5ab70`, `djokovic, alcaraz-5ab70` or a full `/mutual/…/…/` URL.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Player search query",
            "type": "string",
            "description": "For the searchPlayers mode: part of a player's name, case-insensitive (e.g. `alcaraz`). Returns matching players with their slugs and current rank for both tours."
          },
          "rankingTour": {
            "title": "Ranking table",
            "enum": [
              "atp-men",
              "wta-women"
            ],
            "type": "string",
            "description": "Which ranking to walk in rankings mode.",
            "default": "atp-men"
          },
          "rankingDate": {
            "title": "Ranking snapshot date (YYYY-MM-DD)",
            "type": "string",
            "description": "Historical weekly snapshot to read (Mondays). Leave empty for the latest ranking. TennisExplorer keeps weekly snapshots going back years."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap on dataset rows for the run. You are billed per row, so this is your spend guard.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Parallel page fetches. 10 is a good default; raise it for large matchDetails batches.",
            "default": 10
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "tennisexplorer.com is served fine over a direct connection, so no proxy is used unless you configure one here."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}