{
  "openapi": "3.0.1",
  "info": {
    "title": "Flashscore Tennis Scraper - Live Scores, Stats, H2H & Odds",
    "description": "Scrape ATP, WTA, Challenger and ITF tennis from Flashscore: results, fixtures and live scores with set by set scores, tiebreaks and the current game score. Both doubles players are identified. Switch modes for statistics, head to head history or bookmaker odds. No proxy needed.",
    "version": "0.0",
    "x-build-id": "UzMcyiSN1nAWdTl4B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sourabhbgp~flashscore-tennis-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sourabhbgp-flashscore-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/sourabhbgp~flashscore-tennis-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sourabhbgp-flashscore-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/sourabhbgp~flashscore-tennis-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sourabhbgp-flashscore-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": [
              "matches",
              "statistics",
              "h2h",
              "odds"
            ],
            "type": "string",
            "description": "Matches returns fixtures and results with set by set scores. Statistics, head to head and odds each add one row per match on top of the same match selection, so they cost more per match. Start with matches.",
            "default": "matches"
          },
          "startUrls": {
            "title": "Tournament URLs",
            "type": "array",
            "description": "Keep only matches from these Flashscore tournaments, for example https://www.flashscore.com/tennis/atp-singles/cincinnati/. Deeper addresses such as the results or draw page of the same tournament work too. A category address such as https://www.flashscore.com/tennis/atp-singles/ keeps every tournament under it. Singles and doubles have separate addresses on Flashscore, so a singles URL returns no doubles. Combine with the date fields to choose which days to search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dayOffsets": {
            "title": "Specific days",
            "type": "array",
            "description": "Pick individual days instead of a continuous range, for example today and tomorrow only. When set, this replaces the date from and date to fields. Only the days Flashscore actually publishes are offered.",
            "items": {
              "type": "string",
              "enum": [
                "-7",
                "-6",
                "-5",
                "-4",
                "-3",
                "-2",
                "-1",
                "0",
                "1"
              ],
              "enumTitles": [
                "7 days ago",
                "6 days ago",
                "5 days ago",
                "4 days ago",
                "3 days ago",
                "2 days ago",
                "Yesterday",
                "Today",
                "Tomorrow"
              ]
            },
            "default": []
          },
          "dateFrom": {
            "title": "Date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "First match day to include, as YYYY-MM-DD. Flashscore only serves a rolling 9 day window: 7 days back through 1 day ahead. Dates outside that window are clamped and reported in the run log. Days follow Flashscore's own scheduling day, so a late night match can carry a startTime on the previous UTC date. Leave empty for today. Ignored when Specific days is set."
          },
          "dateTo": {
            "title": "Date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Last match day to include, as YYYY-MM-DD. Must be on or after the date from. Leave empty to use the date from. Ignored when Specific days is set."
          },
          "tours": {
            "title": "Tours",
            "type": "array",
            "description": "Keep only these tours. Leave empty to include every tour.",
            "items": {
              "type": "string",
              "enum": [
                "ATP",
                "WTA",
                "CHALLENGER",
                "ITF_MEN",
                "ITF_WOMEN",
                "JUNIORS",
                "TEAMS"
              ],
              "enumTitles": [
                "ATP",
                "WTA",
                "Challenger",
                "ITF Men",
                "ITF Women",
                "Juniors (boys and girls)",
                "Team events (Davis Cup, BJK Cup)"
              ]
            },
            "default": []
          },
          "drawType": {
            "title": "Singles or doubles",
            "enum": [
              "all",
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "Keep only singles or only doubles matches.",
            "default": "all"
          },
          "surfaces": {
            "title": "Surfaces",
            "type": "array",
            "description": "Keep only matches on these surfaces. Team events often have no surface listed and are excluded when this filter is set.",
            "items": {
              "type": "string",
              "enum": [
                "hard",
                "clay",
                "grass",
                "carpet"
              ],
              "enumTitles": [
                "Hard",
                "Clay",
                "Grass",
                "Carpet"
              ]
            },
            "default": []
          },
          "statuses": {
            "title": "Match status",
            "type": "array",
            "description": "Keep only matches in these states. Leave empty to include every state.",
            "items": {
              "type": "string",
              "enum": [
                "scheduled",
                "live",
                "finished"
              ],
              "enumTitles": [
                "Scheduled",
                "Live",
                "Finished"
              ]
            },
            "default": []
          },
          "tournamentQuery": {
            "title": "Tournament name contains",
            "type": "array",
            "description": "Keep only matches whose tournament name contains any one of these, for example Cincinnati. Case insensitive, and one entry per line. Use this when you know the event by name; use Tournament URLs when you have the exact Flashscore address.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "matchIds": {
            "title": "Match IDs",
            "type": "array",
            "description": "Scrape these exact Flashscore match IDs instead of searching by date, for example fVjaLWSG. The ID is the last part of a Flashscore match URL. When set, every date and filter field above is ignored.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many rows. You are charged per row delivered, so this is your cost ceiling.",
            "default": 100
          },
          "oddsCountry": {
            "title": "Odds market (odds mode only)",
            "enum": [
              "GB",
              "BR",
              "US",
              "DE",
              "IN"
            ],
            "type": "string",
            "description": "Which country's bookmaker line up to return. This selects the market, not your own location, and needs no proxy. Great Britain returns the widest set.",
            "default": "GB"
          },
          "oddsBetTypes": {
            "title": "Bet types (odds mode only)",
            "type": "array",
            "description": "Which markets to return. Each extra bet type adds bookmaker lines to the row but never adds rows or charges. Correct score is by far the largest.",
            "items": {
              "type": "string",
              "enum": [
                "HOME_AWAY",
                "OVER_UNDER",
                "ASIAN_HANDICAP",
                "CORRECT_SCORE",
                "ODD_OR_EVEN"
              ],
              "enumTitles": [
                "Match winner",
                "Over / under games",
                "Asian handicap",
                "Correct score",
                "Odd or even"
              ]
            },
            "default": [
              "HOME_AWAY"
            ]
          },
          "oddsScopes": {
            "title": "Bet scopes (odds mode only)",
            "type": "array",
            "description": "Whole match, first set or second set lines.",
            "items": {
              "type": "string",
              "enum": [
                "FULL_TIME",
                "FIRST_SET",
                "SECOND_SET"
              ],
              "enumTitles": [
                "Whole match",
                "First set",
                "Second set"
              ]
            },
            "default": [
              "FULL_TIME"
            ]
          },
          "h2hMaxPerSection": {
            "title": "Past matches per section (h2h mode only)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many past matches to keep for each player's recent form and for the head to head list. Flashscore serves up to 50 per player, which is large for CSV export, so this trims it.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}