{
  "openapi": "3.0.1",
  "info": {
    "title": "Sports Odds → Fair Probability API",
    "description": "Aggregate sportsbook odds via The Odds API (bring your own key) and strip the vig with multiplicative/power/Shin de-vig to get fair, vig-free probabilities.",
    "version": "0.1",
    "x-build-id": "ogf8AMdnHJyYllmnj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/westerly_breaker~sports-odds-fair-probability/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-westerly_breaker-sports-odds-fair-probability",
        "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/westerly_breaker~sports-odds-fair-probability/runs": {
      "post": {
        "operationId": "runs-sync-westerly_breaker-sports-odds-fair-probability",
        "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/westerly_breaker~sports-odds-fair-probability/run-sync": {
      "post": {
        "operationId": "run-sync-westerly_breaker-sports-odds-fair-probability",
        "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": [
          "odds_api_key",
          "sport"
        ],
        "properties": {
          "odds_api_key": {
            "title": "The Odds API key (bring your own)",
            "type": "string",
            "description": "Your OWN The Odds API key (https://the-odds-api.com/ -- free tier: 500 requests/month). This actor is bring-your-own-key: it never ships with a shared/pooled key, and your key is never logged, stored in output, or shared. Get one at https://the-odds-api.com/#get-access."
          },
          "sport": {
            "title": "Sport / league key",
            "type": "string",
            "description": "The Odds API sport_key to fetch, e.g. \"basketball_nba\", \"soccer_epl\", \"americanfootball_nfl\". Use the special value \"upcoming\" for the next games across ALL sports when you don't know a specific league key. Validated against The Odds API's live /v4/sports catalog at run time (a free call) -- an unknown key fails the run immediately with a list of valid examples. Call https://api.the-odds-api.com/v4/sports?apiKey=YOUR_KEY to see the full current list."
          },
          "leagues": {
            "title": "Additional leagues",
            "type": "array",
            "description": "Optional list of ADDITIONAL sport_key values to fetch in the SAME run alongside 'sport' (e.g. sport=\"basketball_nba\", leagues=[\"basketball_wnba\"] fetches both). Each additional key costs its own separate Odds API quota (see Pricing/quota notes in the README) and its own fair share of 'max_events'. Leave empty to fetch only 'sport'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "books": {
            "title": "Bookmakers filter",
            "type": "array",
            "description": "Optional list of The Odds API bookmaker keys to restrict results to, e.g. [\"draftkings\", \"fanduel\", \"pinnacle\"]. Maps directly to the Odds API 'bookmakers' param. Leave empty to get every bookmaker available in the requested 'regions' instead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Odds API region codes controlling which bookmakers are eligible, e.g. \"us\", \"uk\", \"eu\", \"au\". Ignored for a book already named explicitly in 'books', but still required by the upstream API in general -- defaults to [\"us\"]. Each additional region multiplies quota cost (cost = markets requested x regions requested, see README).",
            "default": [
              "us"
            ],
            "items": {
              "type": "string"
            }
          },
          "markets": {
            "title": "Markets",
            "type": "array",
            "description": "Which market type(s) to fetch and de-vig: \"h2h\" (moneyline/1x2 -- the clean 2-or-3-way case), \"spreads\" (point spread, 2 outcomes per line), \"totals\" (over/under, 2 outcomes per line). Each requested market multiplies quota cost (cost = markets requested x regions requested, see README) -- fetching all three in one call is 3x the cost of just \"h2h\".",
            "items": {
              "type": "string",
              "enum": [
                "h2h",
                "spreads",
                "totals"
              ],
              "enumTitles": [
                "Moneyline / 1x2 (h2h)",
                "Point spread",
                "Totals (over/under)"
              ]
            },
            "default": [
              "h2h"
            ]
          },
          "devig_method": {
            "title": "De-vig method",
            "enum": [
              "multiplicative",
              "power",
              "shin"
            ],
            "type": "string",
            "description": "How to strip the bookmaker's margin (vig) to compute fair probabilities. \"multiplicative\" (default): normalize raw implied probabilities to sum to 1 -- simple, robust. \"power\": solves for a shared exponent -- shrinks longshot probabilities more aggressively than multiplicative. \"shin\": Shin's (1992) insider-trading model -- generally considered the most theoretically grounded for sports betting markets; falls back to multiplicative (logged) for the rare book with ~zero/negative overround, where Shin's model has no solution.",
            "default": "multiplicative"
          },
          "max_events": {
            "title": "Max events",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of DISTINCT events to include, fair-shared across every requested sport_key ('sport' + 'leagues') so one league can't consume the whole budget. NOTE: this caps events, not output rows -- each included event still produces one output row per (bookmaker x market) it has, so total billed 'event-row's is usually a multiple of this number. Must be between 1 and 200.",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}