{
  "openapi": "3.0.1",
  "info": {
    "title": "Historical Odds Scraper: Closing Lines, Opening Odds & Results",
    "description": "Historical betting odds for any Flashscore league and season: opening and closing moneyline, 1X2, spread and total from up to 20 bookmakers per country, with scores and results. Soccer, NBA, NFL, MLB, NHL, tennis.",
    "version": "0.1",
    "x-build-id": "RgNEi4NtMbBetsdKL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/keelwright~historical-odds-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-keelwright-historical-odds-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/keelwright~historical-odds-scraper/runs": {
      "post": {
        "operationId": "runs-sync-keelwright-historical-odds-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/keelwright~historical-odds-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-keelwright-historical-odds-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": [
          "leagues"
        ],
        "properties": {
          "leagues": {
            "title": "Leagues",
            "type": "array",
            "description": "League or tournament pages from flashscore.com, for example https://www.flashscore.com/football/england/premier-league/ or https://www.flashscore.com/basketball/usa/nba/. A season's page (…/premier-league-2023-2024/) gives that season only.",
            "items": {
              "type": "string"
            }
          },
          "seasons": {
            "title": "Seasons",
            "type": "array",
            "description": "Seasons as Flashscore names them: 2023/2024 for most leagues, 2023 for MLB and tennis tournaments (2023-24 and 23/24 work too). Leave empty to use \"Number of seasons\".",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "seasonCount": {
            "title": "Number of seasons",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Used when \"Seasons\" is empty: the latest seasons with results, newest first. 1 is the current season so far (or the last one, before a new season starts).",
            "default": 1
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Only games on or after this day (UTC), for example 2024-01-01."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Only games on or before this day (UTC)."
          },
          "teams": {
            "title": "Teams or players",
            "type": "array",
            "description": "Only games of these teams or players, for example Arsenal, Lakers or Alcaraz. Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Bookmaker regions",
            "maxItems": 10,
            "type": "array",
            "description": "Bookmakers that Flashscore shows to visitors from these places (up to 10). Each region adds its bookmakers and one request per game; a bookmaker found in several regions is listed once. The United Kingdom has the most bookmakers and the longest history (about 20 today). US states add DraftKings, FanDuel and BetMGM for recent seasons only.",
            "items": {
              "type": "string",
              "enum": [
                "US-NJ",
                "US-NY",
                "US-VA",
                "US-MA",
                "CA-ON",
                "GB",
                "IE",
                "AU",
                "DE",
                "IT",
                "ES",
                "FR",
                "NL",
                "SE",
                "DK",
                "PL",
                "CZ",
                "AT",
                "CH",
                "PT",
                "GR",
                "RO",
                "TR",
                "MX",
                "AR",
                "CO",
                "ZA",
                "NG",
                "KE",
                "IN",
                "JP"
              ],
              "enumTitles": [
                "USA, New Jersey: FanDuel, DraftKings, BetMGM, Fanatics, bet365",
                "USA, New York: FanDuel, DraftKings, BetMGM, Fanatics",
                "USA, Virginia: FanDuel, DraftKings, BetMGM, Fanatics, bet365, Betr",
                "USA, Massachusetts: FanDuel, DraftKings, BetMGM, Fanatics, Betr",
                "Canada, Ontario: bet365, Betway, Sports Interaction, Betano, PointsBet and 6 more",
                "United Kingdom: bet365, Betfair, William Hill, Ladbrokes, Paddy Power, Sky Bet and 14 more",
                "Ireland: bet365, Paddy Power, Betway, Unibet and 4 more",
                "Australia: bet365, Unibet",
                "Germany: bet365, bwin, Interwetten, Betano, Oddset and 2 more",
                "Italy: bet365, Sisal, SNAI, GoldBet, Eurobet and 8 more",
                "Spain: bet365, Codere, Sportium, William Hill and 5 more",
                "France: Betclic, Winamax, Unibet, PMU and 4 more",
                "Netherlands: bet365 and 1 more",
                "Sweden: Unibet, bet365, BetMGM, Expekt and 4 more",
                "Denmark: bet365, Betano, Unibet, Expekt and 2 more",
                "Poland: STS, Fortuna, Superbet, Betclic and 2 more",
                "Czech Republic: Tipsport, Fortuna, Chance, Betano",
                "Austria: bet365, bwin, Admiral, bet-at-home",
                "Switzerland: bet365, bet-at-home",
                "Portugal: Betano, Solverde, bwin",
                "Greece: Stoiximan, bet365, Novibet, bwin and 2 more",
                "Romania: Superbet, Betano, Unibet, Fortuna and 3 more",
                "Turkey: 1xBet",
                "Mexico: Caliente, Codere, Betway, 1xBet and 4 more",
                "Argentina: bet365, Betfair, William Hill, bwin and 2 more",
                "Colombia: Wplay, BetPlay, Betano, bwin and 2 more",
                "South Africa: Betway, Sportingbet, Sunbet, Easybet and 4 more",
                "Nigeria: Bet9ja, BetKing, 1xBet",
                "Kenya: 1xBet",
                "India: 1xBet",
                "Japan: 1xBet"
              ]
            },
            "default": [
              "GB"
            ]
          },
          "bookmakers": {
            "title": "Bookmakers",
            "type": "array",
            "description": "Only these bookmakers, for example DraftKings, FanDuel or bet365 (bet365 matches every bet365 site). Leave empty for all bookmakers in the chosen regions.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "markets": {
            "title": "Markets",
            "enum": [
              "main",
              "all"
            ],
            "type": "string",
            "description": "Main markets: moneyline, three-way (1X2), spread and total for each bookmaker, with opening and closing prices and results. All markets adds every other price the bookmakers listed (alternate lines, halves, quarters, double chance, both teams to score, correct score and more), one entry per price with how it settled.",
            "default": "main"
          },
          "oddsFormat": {
            "title": "Odds format",
            "enum": [
              "decimal",
              "american"
            ],
            "type": "string",
            "description": "Decimal (1.91) or American (-110) odds.",
            "default": "decimal"
          },
          "maxItems": {
            "title": "Max games",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many games. 0 means no limit.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many games to load at the same time.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: Flashscore answers Apify's servers directly. Turn on only if requests start failing.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}