{
  "openapi": "3.0.1",
  "info": {
    "title": "NBA, NFL, MLB & NHL Odds: Historical & Closing Lines",
    "description": "NBA, NFL, MLB and NHL odds from up to 42 bookmakers incl. DraftKings, FanDuel, BetMGM and Fanatics: moneyline, spread, total, 3-way. Opening and closing lines, no-vig consensus, line movement. Recent games or full seasons back to 2009, scores by period, team stats.",
    "version": "0.1",
    "x-build-id": "cH9CdfpJRYeChFqRU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sports-odds-lab~nba-nfl-mlb-nhl-odds/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sports-odds-lab-nba-nfl-mlb-nhl-odds",
        "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/sports-odds-lab~nba-nfl-mlb-nhl-odds/runs": {
      "post": {
        "operationId": "runs-sync-sports-odds-lab-nba-nfl-mlb-nhl-odds",
        "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/sports-odds-lab~nba-nfl-mlb-nhl-odds/run-sync": {
      "post": {
        "operationId": "run-sync-sports-odds-lab-nba-nfl-mlb-nhl-odds",
        "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": "What to scrape",
            "enum": [
              "recent",
              "seasons"
            ],
            "type": "string",
            "description": "Recent games: every league of the chosen sports from up to 7 days back to 7 days ahead (upcoming games with current odds). Full seasons: complete seasons of the leagues you list below, odds history back to 2009 — add the leagues in the 'Full seasons' section.",
            "default": "recent"
          },
          "statuses": {
            "title": "Game status",
            "type": "array",
            "description": "Finished includes games decided in overtime, extra innings or a shoot-out.",
            "items": {
              "type": "string",
              "enum": [
                "finished",
                "scheduled",
                "live",
                "other"
              ],
              "enumTitles": [
                "Finished",
                "Scheduled",
                "Live",
                "Postponed / cancelled"
              ]
            },
            "default": [
              "finished",
              "scheduled"
            ]
          },
          "seasonTypes": {
            "title": "Season types",
            "type": "array",
            "description": "Regular season, postseason (play-offs, play-in, wild card, bowls, Final Four), preseason and all-star games.",
            "items": {
              "type": "string",
              "enum": [
                "regular",
                "postseason",
                "preseason",
                "allstar"
              ],
              "enumTitles": [
                "Regular season",
                "Postseason",
                "Preseason",
                "All-star"
              ]
            },
            "default": [
              "regular",
              "postseason"
            ]
          },
          "sports": {
            "title": "Sports",
            "type": "array",
            "description": "Every league of these sports: NBA, WNBA, NCAA, EuroLeague …; NFL, NCAA, CFL …; NHL, KHL, AHL, SHL …; MLB, NPB, KBO …",
            "items": {
              "type": "string",
              "enum": [
                "basketball",
                "americanFootball",
                "hockey",
                "baseball"
              ],
              "enumTitles": [
                "Basketball",
                "American football",
                "Ice hockey",
                "Baseball"
              ]
            },
            "default": [
              "basketball",
              "americanFootball",
              "hockey",
              "baseball"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 7,
            "type": "integer",
            "description": "How many past days to include (0 = today only). Up to 7.",
            "default": 1
          },
          "daysAhead": {
            "title": "Days ahead",
            "minimum": 0,
            "maximum": 7,
            "type": "integer",
            "description": "How many upcoming days to include. Up to 7. Upcoming games carry the current prices instead of closing lines.",
            "default": 0
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Optional. Country names as shown on Flashscore, e.g. USA, Canada, Spain, Japan, Europe (EuroLeague). Leave empty for every country.",
            "items": {
              "type": "string"
            }
          },
          "competitions": {
            "title": "Competitions",
            "type": "array",
            "description": "Optional. 'Country: Competition' as shown on Flashscore, e.g. 'USA: NBA', 'USA: NFL', 'USA: NCAA', 'Europe: Euroleague'. Stages (play-offs, preseason) are included automatically.",
            "items": {
              "type": "string"
            }
          },
          "includeWomen": {
            "title": "Include women's leagues",
            "type": "boolean",
            "description": "WNBA and other women's competitions.",
            "default": true
          },
          "includeYouth": {
            "title": "Include youth leagues",
            "type": "boolean",
            "description": "U18–U23, junior and academy competitions.",
            "default": true
          },
          "leagues": {
            "title": "Leagues",
            "type": "array",
            "description": "Short names NBA, NFL, MLB, NHL, WNBA, NCAAB, NCAAF, EuroLeague, KHL, AHL, CFL, NPB, KBO — or 'Sport: Country: League' as shown on Flashscore (e.g. 'Basketball: Spain: ACB', 'Hockey: Sweden: SHL'), or the league's Flashscore URL.",
            "items": {
              "type": "string"
            }
          },
          "seasons": {
            "title": "Seasons",
            "type": "array",
            "description": "Optional. 2024-2025 for NBA/NHL/NFL-style seasons (for the NFL, 2024 also works), 2024 for MLB and other calendar-year leagues. Leave empty to use 'Last seasons'.",
            "items": {
              "type": "string"
            }
          },
          "lastSeasons": {
            "title": "Last seasons",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Used when Seasons is empty: the current season (games played so far) plus this many minus one before it; seasons that have not started are skipped.",
            "default": 1
          },
          "markets": {
            "title": "Betting markets",
            "type": "array",
            "description": "Moneyline, spread and total include overtime / extra innings (as US books settle them). 3-way is on regulation time. The moneyline is always included — it shows which bookmakers priced the game.",
            "items": {
              "type": "string",
              "enum": [
                "moneyline",
                "spread",
                "total",
                "threeWay"
              ],
              "enumTitles": [
                "Moneyline",
                "Spread (point spread, run line, puck line)",
                "Total (over/under)",
                "3-way (regulation time)"
              ]
            },
            "default": [
              "moneyline",
              "spread",
              "total"
            ]
          },
          "spreadLines": {
            "title": "Spread lines",
            "enum": [
              "main",
              "all"
            ],
            "type": "string",
            "description": "The consensus always reports the market's main line at the open and at the close.",
            "default": "main"
          },
          "totalLines": {
            "title": "Total lines",
            "enum": [
              "main",
              "all"
            ],
            "type": "string",
            "description": "The consensus always reports the market's main line at the open and at the close.",
            "default": "main"
          },
          "oddsFormat": {
            "title": "Odds format",
            "enum": [
              "decimal",
              "american"
            ],
            "type": "string",
            "description": "Format of every price in the output. Probabilities are always 0–1.",
            "default": "decimal"
          },
          "bookmakers": {
            "title": "Only these bookmakers",
            "type": "array",
            "description": "Optional. Names or parts of names, e.g. DraftKings, FanDuel, BetMGM, bet365. Leave empty for all available (up to 42).",
            "items": {
              "type": "string"
            }
          },
          "includeOdds": {
            "title": "Include odds",
            "type": "boolean",
            "description": "Opening and latest (closing) odds per bookmaker plus the no-vig consensus.",
            "default": true
          },
          "onlyWithOdds": {
            "title": "Skip games without odds",
            "type": "boolean",
            "description": "Do not save (and do not pay for) games that no bookmaker priced — mostly minor and youth leagues.",
            "default": true
          },
          "includeStats": {
            "title": "Include team statistics",
            "type": "boolean",
            "description": "Box-score team statistics where available: field goals, rebounds, turnovers; shots, power plays, faceoffs; hits, errors, home runs; yards, turnovers …",
            "default": true
          },
          "maxGames": {
            "title": "Max games",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after saving this many games (0 = no limit). A full NBA season is ~1,300 games, MLB ~2,500.",
            "default": 0
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "Advanced. Higher is faster; the default is safe.",
            "default": 16
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}