{
  "openapi": "3.0.1",
  "info": {
    "title": "Sports Betting Odds Scraper — DraftKings Lines via ESPN",
    "description": "Sports betting odds scraper: one row per game and sportsbook with spread, total and moneyline (American + decimal), opening and closing lines, favorite and final result. NFL, NBA, MLB, NHL, college, MLS, Premier League and other soccer leagues, UFC.",
    "version": "0.1",
    "x-build-id": "nEfo6gQjK6Whxtegf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~sports-odds-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-sports-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/fabrikit~sports-odds-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-sports-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/fabrikit~sports-odds-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-sports-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",
        "properties": {
          "leagues": {
            "title": "Leagues",
            "type": "array",
            "description": "Leagues to scrape. NFL and college football default to ESPN's current week when no dates are given; the others use today plus `days` - 1 more days (US Eastern dates).",
            "items": {
              "type": "string",
              "enum": [
                "nfl",
                "ncaaf",
                "nba",
                "ncaab",
                "mlb",
                "nhl",
                "mls",
                "epl",
                "laliga",
                "bundesliga",
                "seriea",
                "ligue1",
                "ucl",
                "ligamx",
                "ufc"
              ],
              "enumTitles": [
                "NFL",
                "NCAA Football (FBS)",
                "NBA",
                "NCAA Men's Basketball (Division I)",
                "MLB",
                "NHL",
                "MLS",
                "English Premier League",
                "Spanish LaLiga",
                "German Bundesliga",
                "Italian Serie A",
                "French Ligue 1",
                "UEFA Champions League",
                "Mexican Liga MX",
                "UFC (one row per fight)"
              ]
            }
          },
          "customLeagues": {
            "title": "Other ESPN leagues (advanced)",
            "type": "array",
            "description": "Any other league ESPN has a scoreboard for, as `sport/league` exactly like in ESPN URLs: soccer/ned.1 (Eredivisie), soccer/por.1, soccer/uefa.europa, basketball/wnba, football/cfl... Lines exist only where DraftKings prices the league; leagues ESPN does not know are reported and skipped.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "First game day to include, YYYY-MM-DD (US Eastern). Also accepts `today`, `tomorrow` or `+2` (days from today). Empty = today."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Last game day to include (inclusive), YYYY-MM-DD. Empty = `dateFrom` plus `days` - 1. At most 31 days per run."
          },
          "days": {
            "title": "Days to cover",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "How many days to scrape starting at `dateFrom` when `dateTo` is empty. One scoreboard request per league and day.",
            "default": 3
          },
          "gameStates": {
            "title": "Game states",
            "type": "array",
            "description": "Keep only games in these states. Empty = all. Finished games come with scores, closing lines and spread / total / moneyline results.",
            "items": {
              "type": "string",
              "enum": [
                "pre",
                "in",
                "post"
              ],
              "enumTitles": [
                "Scheduled (upcoming)",
                "Live",
                "Finished"
              ]
            }
          },
          "providers": {
            "title": "Sportsbooks",
            "type": "array",
            "description": "Keep only these sportsbooks, by name or ESPN provider id (DraftKings = 100, Bet 365 = 2000). Empty = every book ESPN returns for the game.",
            "items": {
              "type": "string"
            }
          },
          "oddsSource": {
            "title": "Odds source",
            "enum": [
              "core",
              "scoreboard"
            ],
            "type": "string",
            "description": "`core`: one extra request per game to ESPN's odds API, which gives every sportsbook plus opening, current and closing lines (also for finished games). `scoreboard`: only the DraftKings line embedded in the scoreboard (no extra requests, fastest; upcoming games only).",
            "default": "core"
          },
          "includeEventsWithoutOdds": {
            "title": "Include games without lines",
            "type": "boolean",
            "description": "Also save a row (with empty odds fields) for games that have no sportsbook line yet, so you still get the schedule. Off by default: rows are only saved, and charged, when there is a line.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many rows in total (exact; one row = one game x one sportsbook).",
            "default": 500
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. ESPN's public API accepts direct connections, so no proxy is used by default. If ESPN ever blocks the platform's IP, the Actor retries with other browser headers and then with Apify Proxy (datacenter) by itself.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}