{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Scraper — ATP/WTA Matches, Sofascore Stats & Odds",
    "description": "Scrape ATP, WTA, Challenger, ITF and UTR tennis from Sofascore and Flashscore. Flat rows for matches (surface, round, seeds, live ranks, set scores, winner, pre-match odds, H2H), match statistics (serve, return, break points, point-by-point) and player rankings.",
    "version": "1.0",
    "x-build-id": "IQSw63XV6VACclqqb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdatalabs~tennis-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdatalabs-tennis-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/webdatalabs~tennis-scraper/runs": {
      "post": {
        "operationId": "runs-sync-webdatalabs-tennis-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/webdatalabs~tennis-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-webdatalabs-tennis-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 scrape",
            "enum": [
              "date",
              "live",
              "tournament",
              "player",
              "rankings"
            ],
            "type": "string",
            "description": "<b>Matches on a date</b> returns every match for the day. <b>Live matches</b> returns only what is in progress right now. <b>By tournament</b> and <b>By player</b> use the IDs in the Advanced section. <b>Rankings</b> returns the ATP/WTA ranking lists instead of matches.",
            "default": "date"
          },
          "date": {
            "title": "Date",
            "type": "string",
            "description": "Day to scrape, as YYYY-MM-DD. Leave empty for today (UTC). Ignored for Live and Rankings."
          },
          "tours": {
            "title": "Tours",
            "uniqueItems": true,
            "type": "array",
            "description": "Which tiers to include. ATP, WTA and Challenger are on by default so a first run stays fast; add ITF and UTR for full coverage (a typical day has roughly 10x more ITF/UTR matches than main-tour ones).",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta",
                "challenger",
                "itf",
                "utr"
              ],
              "enumTitles": [
                "ATP",
                "WTA",
                "Challenger",
                "ITF",
                "UTR"
              ]
            },
            "default": [
              "atp",
              "wta",
              "challenger"
            ]
          },
          "includeStats": {
            "title": "Include match statistics",
            "type": "boolean",
            "description": "Adds a match-stats row per match: serve, return and break-point statistics plus point-by-point where published. This is the slowest and most expensive option — it adds two requests per match and bills at the match-stats rate. Matches that have not started have no statistics and produce no row.",
            "default": false
          },
          "includeOdds": {
            "title": "Include pre-match odds and H2H",
            "type": "boolean",
            "description": "Adds pre-match decimal odds (current and opening) and the head-to-head record to each match row. Odds are left empty when no line has been published for that match.",
            "default": true
          },
          "maxMatches": {
            "title": "Maximum matches",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper bound on match rows for this run. Raise it for a full day across every tour.",
            "default": 100
          },
          "matchIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Sofascore event IDs. When set, these matches are scraped directly and the date and tour filters are ignored.",
            "default": []
          },
          "playerIds": {
            "title": "Player IDs",
            "type": "array",
            "description": "Sofascore player (team) IDs, used by the \"By player\" mode. Returns full player profiles including recent form.",
            "default": []
          },
          "tournamentIds": {
            "title": "Tournament IDs",
            "type": "array",
            "description": "Sofascore unique-tournament IDs, used by the \"By tournament\" mode together with the selected date.",
            "default": []
          },
          "statuses": {
            "title": "Only these statuses",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only matches in these states. Leave empty to keep all.",
            "items": {
              "type": "string",
              "enum": [
                "notstarted",
                "inprogress",
                "finished",
                "canceled",
                "postponed",
                "suspended",
                "retired",
                "walkover"
              ],
              "enumTitles": [
                "Not started",
                "In progress",
                "Finished",
                "Cancelled",
                "Postponed",
                "Suspended",
                "Retired",
                "Walkover"
              ]
            },
            "default": []
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxy is required — Sofascore rejects datacenter IPs with HTTP 403. Leave the default unless you know you need a specific country.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}