# MLB Playoff Odds API — Monte Carlo Simulator & Value Bets (`commodus67/mlb-playoff-odds-monte-carlo`) Actor

MLB playoff odds as data, not a web page. Monte Carlo replays every remaining game on the real schedule for division, wild card, postseason and top-seed probabilities for all 30 baseball teams, plus projected records, value bets vs sportsbook odds and Kelly bet sizing. No API key.

- **URL**: https://apify.com/commodus67/mlb-playoff-odds-monte-carlo.md
- **Developed by:** [ELIO LIBERATORE](https://apify.com/commodus67) (community)
- **Categories:** Developer tools, Automation, News
- **Features:** Limited permissions
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $7.00 / 1,000 team projections

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## MLB Playoff Odds API — Monte Carlo Simulator for Baseball Postseason Probabilities

Get **MLB playoff odds as structured data**, not as a web page. This Actor replays the rest of the Major League Baseball regular season thousands of times on the real remaining schedule and returns, for all 30 teams, the probability of winning the division, taking a wild card, reaching the postseason, and finishing with the best record in the league — plus projected win totals, market edges and Kelly-style bet sizing.

Playoff odds tables are published all over the web, but almost never as an API you can pull into a spreadsheet, a model or an AI agent. This Actor computes them from scratch and hands you clean JSON, CSV, Excel or an API endpoint.

**No API key. No account. No configuration.** Standings and the remaining schedule come from the public ESPN feed. Run it with an empty input and it projects the current season.

***

### What you get

- **Playoff probabilities** for all 30 MLB teams — division, wild card, overall postseason, and top seed
- **Projected final records** — mean wins and losses across every simulated season
- **The strength estimates behind the numbers** — actual win %, Pythagorean win %, and the regressed true-talent estimate the simulation actually uses
- **Market edge** — supply bookmaker implied probabilities and get the gap between model and market, per team
- **Bet sizing** — quarter-Kelly stake suggestions with per-position and total-portfolio caps
- **Three ready-made dataset views** — playoff overview, market edge table, and the records / run differential the model was built from

Export to **JSON, CSV, Excel or XML**, call it from the **Apify API**, schedule it daily, or plug it into n8n, Make, Zapier or an MCP-enabled AI agent.

***

### Who uses this

| Use case | What you do with it |
|---|---|
| **Sports betting models** | Compare fair probabilities against sportsbook futures prices and size positions with the built-in Kelly caps |
| **Fantasy baseball** | Know which teams are still playing meaningful games in September before your trade deadline |
| **Sports media and blogs** | A defensible playoff-odds table you generated yourself, refreshed every morning |
| **Data science and backtesting** | Set a past `season` and project it from where it stood, then score the model against what happened |
| **Dashboards** | A daily scheduled run feeding Google Sheets, a database, or a BI tool |
| **AI agents** | A tool that returns real computed probabilities instead of hallucinated ones |

***

### Quick start

Run it with an empty input:

```json
{}
```

That projects the current season with 10,000 simulated seasons. A full 30-team run finishes in about three seconds.

To compare against the market, add bookmaker implied probabilities:

```json
{
  "iterations": 20000,
  "marketProbabilities": [
    { "team": "New York Yankees", "market": "playoff",  "impliedProbability": 0.98 },
    { "team": "Houston Astros",   "market": "division", "impliedProbability": 0.45 }
  ]
}
```

Team names are matched loosely — `"yankees"` and `"New York Yankees"` both work. `market` accepts `playoff` or `division`.

***

### Why simulate instead of scraping a playoff odds page

Almost every baseball tool on Apify Store copies numbers out of a website. This one computes something that is not published as data anywhere: a full distribution of season outcomes built from the actual games each team still has to play. Three design choices make the difference.

**It simulates the real schedule, not an average one.** MLB schedules are unbalanced. A team fighting for a wild card while facing six games against the best team in its division has a harder path than its record suggests. Every remaining fixture is loaded individually, with the correct home and away side, and played out.

**It leans on run differential, not just the record.** Runs scored and runs allowed predict future wins better than the win-loss column does, because one-run wins and blowout losses carry the same weight in the standings but not in reality. Strength comes from Pythagorean expectation blended with the raw record, and you control the mix.

**It admits it does not know how good the teams are.** A partial season is a noisy sample. The model regresses every team towards .500 by a configurable amount, then, in each simulated season, redraws each team's true talent from a distribution around that estimate. Without that second step the output is wildly overconfident: a 60 percent favourite comes out looking like a 95 percent certainty.

***

### How it works

1. Pull the current standings, split by league and division, including runs scored and runs allowed.
2. Convert each team's record into a strength rating on a log-odds scale: blend Pythagorean win percentage with actual win percentage, regress towards .500 in proportion to how much season is left, then take the log-odds.
3. Load every team's remaining fixtures and deduplicate them into one list of games.
4. For each simulated season, redraw each team's rating with Gaussian noise, then play every remaining game. A home team's win probability is the logistic of the rating gap plus a home field term.
5. At the end of each simulated season, award the three division titles in each league to the best record in each division, then the three wild cards to the best remaining records, and record who got the top seed.
6. Average across all simulations to get probabilities and projected win totals.

**Sanity check.** On a mid-August slate the output lands close to the well-known public playoff-odds models for the clear contenders and clear also-rans, and diverges by ten to twenty points on a handful of teams whose run differential disagrees with their record. That divergence is the point: it is where the model thinks the standings are lying.

***

### Value bets and position sizing

Supply `marketProbabilities` and the Actor does more than print an edge. Every team whose model probability beats the market by at least `edgeThreshold` is flagged, and the output carries a stake suggestion built on quarter-Kelly with two hard ceilings:

- `maxPerPositionPct` caps any single bet as a fraction of bankroll (default 2%).
- `maxTotalExposurePct` caps the sum of all open positions (default 6%).

The ceilings decide how many bets actually fit: 6% over 2% is three. Qualifying bets beyond that limit are still marked as value but come back with zero contracts and a portfolio-limit flag, so nothing is silently dropped. The uncapped Kelly fraction is reported alongside the capped one, so you can see what the model wanted before the clip. `bankroll` only scales the dollar figures — the fraction-of-bankroll column is meaningful whatever capital you run.

***

### Input

Everything is optional.

| Field | Type | Default | What it does |
|---|---|---|---|
| `iterations` | integer | 10000 | Seasons to simulate. 10,000 gives probabilities stable to about half a point. |
| `season` | integer | current | Set a past year to project that season from where it stood. Useful for backtesting. |
| `archiveToNamedDataset` | string | empty | Name of a dataset in your account to also append this run's rows to. Named datasets are kept indefinitely, so scheduled runs accumulate a permanent history. See “Build your own history” below. |
| `regressionGames` | integer | 70 | How hard to pull a partial season towards .500. Equivalent to adding this many .500 games. |
| `pythagoreanWeight` | number | 0.6 | Share of the strength estimate that comes from run differential rather than the record. |
| `homeFieldAdvantage` | number | 0.16 | Home edge in log-odds. 0.16 is roughly a 54 percent home win rate between equals. |
| `strengthUncertainty` | number | 0.1 | Spread of the per-season talent redraw. Set to 0 to see how overconfident the model becomes. |
| `edgeThreshold` | number | 0.05 | How far the model must beat the market before a team is flagged as value. |
| `bankroll` | integer | 1000 | Total betting capital in dollars. Scales the stake columns only. |
| `maxPerPositionPct` | number | 0.02 | Hard ceiling on any single position, as a fraction of bankroll. |
| `maxTotalExposurePct` | number | 0.06 | Ceiling on the sum of all open positions, as a fraction of bankroll. |
| `marketProbabilities` | array | `[]` | Bookmaker implied probabilities to compare against. |

***

### Output

One row per team, sorted by playoff probability.

| Field | Meaning |
|---|---|
| `league`, `division`, `team`, `abbreviation` | Where the team sits |
| `gamesPlayed`, `wins`, `losses`, `gamesRemaining` | Current record |
| `runsScored`, `runsAllowed`, `runDifferential` | Scoring profile |
| `actualWinPct` | Wins divided by games played |
| `pythagoreanWinPct` | Win percentage implied by run differential |
| `trueTalentWinPct` | The blended, regressed estimate the simulation actually uses |
| `projectedWins`, `projectedLosses` | Mean final record across all simulations |
| `fairDivisionProbability` | Chance of winning the division |
| `fairWildCardProbability` | Chance of taking one of the three wild cards |
| `fairPlayoffProbability` | Chance of reaching the postseason by either route |
| `fairTopSeedProbability` | Chance of the best record among division winners in its league |
| `marketPlayoffProbability`, `marketDivisionProbability` | What you supplied, if anything |
| `playoffEdge`, `divisionEdge` | Model probability minus market probability |
| `hasValue` | True when the larger edge clears your threshold |
| `simulations` | Iterations actually run |

Plus the sizing columns described above when you supply market probabilities.

***

### Run it every morning

Playoff races move every night. Schedule the Actor to run each morning and you get a fresh table before the day's games. A full 30-team run with 10,000 iterations finishes in about three seconds, so a daily schedule costs very little.

You can also call it directly from the Apify API:

```bash
curl -X POST "https://api.apify.com/v2/acts/commodus67~mlb-playoff-odds-monte-carlo/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "iterations": 10000 }'
```

***

### Build your own history

A run's own dataset is temporary — Apify deletes it 31 days after the run. A **named** dataset is kept indefinitely.

Set `archiveToNamedDataset` to a name such as `mlb-playoff-odds-history` and every run appends its rows to that dataset as well as writing its normal one. Point a daily schedule at it and you accumulate your own record of how each team's playoff probability moved across the season — a time series you cannot reconstruct afterwards, because the standings and remaining schedule that produced each snapshot no longer exist.

Every row already carries `retrievedAt`, `season` and `simulations`, so stacked snapshots are never ambiguous: you always know when a projection was taken, for which season, and how many simulated seasons it came from.

The named dataset is created the first time it is used and lives in your account under **Storage → Datasets**. Leave the field empty and nothing changes: you get the normal run dataset only.

***

### Pricing

Pay per result. One result is one team, so a full-league run produces 30 results. No subscription, no minimum, no charge for what you do not run.

***

### FAQ

**Is this an MLB playoff odds API?**
Yes. Every run writes a dataset you can read as JSON or CSV over HTTP, and the Actor can be started from the Apify API or an MCP client. There is no key to request and no rate limit to negotiate.

**Where does the data come from?**
Standings and remaining fixtures come from the public ESPN feed. No account or API key of your own is required.

**How accurate is it?**
It agrees closely with well-known public playoff-odds models for clear contenders and clear also-rans, and diverges on teams whose run differential disagrees with their record. It is a probability model, not a prediction: a 30 percent chance happens three times in ten.

**Can I project a past season?**
Yes. Set `season` to a past year and the model projects that season forward from where it stood, which is how you backtest it.

**Does it simulate the postseason itself?**
No. It stops at who qualifies and who takes the top seed. It says nothing about who wins the World Series.

**Can I use it to find value bets?**
Yes. Supply bookmaker implied probabilities in `marketProbabilities` and the output shows the edge per team, flags anything clearing your threshold, and suggests a stake under quarter-Kelly with per-position and portfolio caps.

**How many simulations should I run?**
10,000 gives probabilities stable to about half a point and finishes in a few seconds. Raise it if you want smoother tails.

**Does it know about injuries or trades?**
No. See the caveats below — this is the model's biggest blind spot.

**How much does a run cost?**
One result equals one team, so a full-league run bills 30 results. Check the Pricing tab for the current per-result price and volume tiers.

**Is there a version for soccer?**
Yes — the [Football (Soccer) Monte Carlo Season Predictor](https://apify.com/commodus67/football-soccer-monte-carlo-predictor) runs the same approach across 17 leagues including the Premier League, LaLiga, Serie A, Bundesliga, Ligue 1, Liga MX, Brasileirão and MLS.

**Is there a version for other sports?**
Yes — the [NFL Playoff Odds API — Monte Carlo Simulator](https://apify.com/commodus67/nfl-playoff-odds-api-monte-carlo-simulator) runs the same engine on football: division, wild card, playoff and No. 1 seed probabilities for all 32 NFL teams.

***

### Limitations and honest caveats

**It knows records, not rosters.** The model has no idea who is on the injured list, who was traded at the deadline, or who is starting tomorrow. A team that just lost its best two starting pitchers still looks as strong as its run differential says it is. On a fast-moving roster this is the model's biggest blind spot.

**Tiebreakers are simplified.** Real MLB tiebreakers use head-to-head records and other criteria. Ties in a simulated season are broken at random, which is fine for probabilities across thousands of runs but means no single simulated season should be read as a forecast of the actual tiebreak.

**Postseason series are not simulated.** The output stops at who qualifies and who gets the top seed.

**It depends on ESPN.** If ESPN changes or delays its feed, results change or the run fails. Standings are as fresh as ESPN makes them, which is usually within hours of the last game.

**Probabilities are not predictions.** A 30 percent chance happens three times in ten. The value of this tool is comparing its number with a price, not treating it as a forecast.

**On betting.** If you use this to inform wagers, treat the output as one noisy opinion among many, and never stake money you cannot afford to lose. No model, including this one, turns a losing bet into a winning one.

***

*Not affiliated with, endorsed by, or sponsored by Major League Baseball or ESPN. For informational and research use.*

# Actor input Schema

## `iterations` (type: `integer`):

How many full seasons to simulate. More iterations give smoother probabilities and cost a little more time. 10000 is plenty for stable numbers; the run takes a few seconds either way.

## `season` (type: `integer`):

Leave empty to use the current season. Set a year to project a past season from where it stood, which is useful for backtesting the model.

## `archiveToNamedDataset` (type: `string`):

Leave empty for a normal run. If you put a name here, every run also appends its results to a named dataset in your account, which Apify keeps indefinitely instead of deleting it after a few weeks. Run it on a schedule and you build your own history of how the probabilities moved across the season, which is something you cannot reconstruct later. Use the same name every time, for example mlb-playoff-odds-history.

## `regressionGames` (type: `integer`):

How strongly a partial season is pulled towards .500. Think of it as adding this many imaginary games at a .500 record. Around 70 is the usual choice for baseball. Lower it to trust the current record more, raise it to trust it less.

## `pythagoreanWeight` (type: `number`):

How much of the strength estimate comes from runs scored and allowed (Pythagorean expectation) rather than the raw win-loss record. Run differential predicts future wins better than the record itself, so the default leans on it.

## `homeFieldAdvantage` (type: `number`):

Added to the home team's strength in every simulated game. The default of 0.16 corresponds to roughly a 54 percent win rate for the home side between evenly matched teams, which is the long-run MLB average.

## `strengthUncertainty` (type: `number`):

How unsure the model is about each team's true talent. Every simulated season draws a slightly different version of each team. Setting this to zero makes the output far too confident, because the favourite then wins almost every time.

## `edgeThreshold` (type: `number`):

A team is flagged in the hasValue column when the model probability beats the market probability you supplied by at least this much. 0.05 means five percentage points.

## `bankroll` (type: `integer`):

Your total betting capital, in dollars. It only scales the sizing columns: suggestedContracts and suggested stake grow with it. The suggestedFractionOfBankroll column is independent of this number, so it stays meaningful whatever capital you run.

## `maxPerPositionPct` (type: `number`):

Hard ceiling on any single bet, as a fraction of bankroll. 0.02 means no position ever exceeds 2% of your capital. Quarter-Kelly sizing is clipped to this ceiling, and the kellyFractionUncapped column shows what the model wanted before the clip.

## `maxTotalExposurePct` (type: `number`):

Ceiling on the sum of all open positions, as a fraction of bankroll. This divided by the per-position ceiling is how many bets actually fit: at the defaults, 6% over 2% means three. Qualifying bets beyond that are still marked VALUE but come back with zero contracts and cappedByPortfolioLimit set to true.

## `marketProbabilities` (type: `array`):

Bookmaker implied probabilities to compare against, so the output shows where the model disagrees with the market. Each entry needs a team name, a market of either playoff or division, and a probability between 0 and 1. Example: \[{ "team": "New York Yankees", "market": "playoff", "impliedProbability": 0.78 }]

## Actor input object example

```json
{
  "iterations": 10000,
  "regressionGames": 70,
  "pythagoreanWeight": 0.6,
  "homeFieldAdvantage": 0.16,
  "strengthUncertainty": 0.1,
  "edgeThreshold": 0.05,
  "bankroll": 1000,
  "maxPerPositionPct": 0.02,
  "maxTotalExposurePct": 0.06,
  "marketProbabilities": []
}
```

# Actor output Schema

## `projections` (type: `string`):

Full projection table. Switch between the Playoff overview, Market edge and Records views for a narrower set of columns.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("commodus67/mlb-playoff-odds-monte-carlo").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("commodus67/mlb-playoff-odds-monte-carlo").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call commodus67/mlb-playoff-odds-monte-carlo --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,commodus67/mlb-playoff-odds-monte-carlo"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/YS2iYRcccbwctL5QQ/builds/6Map2V5ZqB7VGaoJC/openapi.json
