MLB odds API

MLB odds API: real-time lines, player props, futures and in-play odds from every book that prices MLB, in one schema over REST and WebSocket.

Baseball produces more priced games than any other major US league. A regular season of 162 games per team means a slate on almost every day from spring to fall, often with a dozen or more games, and every one of them carries a moneyline, a run line, a total, first-five-innings markets and a long list of player props. If you run an odds screen, publish betting content, maintain a pricing model or build a DFS tool, that volume is the main engineering problem.

The PreciseAPI MLB odds API collects those prices from sportsbooks, betting exchanges, contract exchanges and DFS pick'em apps and returns them in one JSON shape, with stable ids for every game, team, player, market and outcome. This page covers what the feed contains, who prices it, how baseball lines behave from a data point of view, and how to start pulling MLB odds data with a few lines of code. It is a data feed only: PreciseAPI does not take bets or offer picks.

What MLB markets does the API cover?

If you are comparing an MLB betting API against others, market depth is the first thing to check. MLB is one of the most complete leagues in the catalog. Its periods are full_game (full game) and f5 (first 5 innings), and player props and futures are both switched on.

Market keyGroupWhat it means in baseball
moneylineMainWhich team wins the game. No draw, so two outcomes. Before a game, a sportsbook that lists only one side sends that side alone.
spreadMainThe run line, almost always -1.5 / +1.5, with the price doing the work.
totalMainCombined runs scored, over or under a number such as 8.5.
alternate_totalAlternateA ladder of totals around the main number, each with its own price.
team_totalTeamRuns scored by one team, over or under.
alternate_team_totalAlternateA book's other team-total lines, one market per line.
player_strikeoutsPropsStrikeouts recorded by the starting pitcher.
player_hitsPropsHits recorded by a batter.
player_total_basesPropsTotal bases recorded by a batter.
outrightFuturesThe World Series winner board.

A moneyline in baseball is just a price on each side, quoted in American odds by default. Because baseball games are low scoring and close, the spread is not a moving number the way it is in football. The run line stays at 1.5 runs and the price moves instead, so a favorite might be -1.5 at +130 one hour and +115 the next. Your UI should treat the price as the thing that changes, not the line. The catalog has both alternate_spread and alternate_total for MLB; the total is where baseball books usually publish a full ladder.

The f5 period isolates the first five innings, when the starting pitchers usually decide the game. It has its own moneyline, run line and total, priced separately from the full game. Many models and screens show F5 next to full-game lines because the two react differently to bullpen news.

MLB prop keys

The catalog defines 19 player prop keys for MLB. /v1/props returns one market per player and stat for the ones a sportsbook or DFS pick'em app has posted, so what a game carries varies:

Market keyStat
player_strikeoutsPitcher strikeouts
player_hitsHits
player_total_basesTotal bases
player_batter_strikeoutsBatter strikeouts
player_fantasy_scoreFantasy score
player_home_runsHome runs
player_rbisRBIs
player_runsRuns scored
player_walksWalks
player_walks_allowedWalks allowed
player_stolen_basesStolen bases
player_hits_allowedHits allowed
player_earned_runsEarned runs
player_pitcher_outsPitcher outs
player_pitches_thrownPitches thrown
player_singlesSingles
player_doublesDoubles
player_triplesTriples
player_hits_runs_rbisHits + runs + RBIs

Which sportsbooks price MLB?

35 sources price MLB in season:

Pass a books parameter to narrow a request to the sources you display. A comparison screen that puts a sharp book such as Pinnacle next to retail books is the most common layout, and DraftKings and FanDuel are usually the first retail columns people add. Exchange outcomes include a liquidity figure, which is useful when you show exchange prices next to fixed-odds books. The coverage page lists every source and league.

How the MLB betting market behaves, and what it means for your app

Baseball has a rhythm that is very different from a weekly sport, and designing your refresh logic around it saves credits and gives users fresher numbers.

A daily slate with staggered start times

Most days have games starting from early afternoon through late evening Eastern time, with occasional morning starts and doubleheaders. That means some games are in-play while others are still pre-match. A single polling loop that treats the whole league the same either wastes requests on games hours away or lags on games already underway. The usual approach is to split events by status: poll scheduled games on a slower cycle and stream live ones.

Pitchers move the lines

Starting pitchers are the single biggest input into a baseball price. Lines for a game typically open the day before, and a change of starter, a scratch or an announced opener can reprice the moneyline, run line, total and F5 markets at once. Lineup cards are usually posted a few hours before first pitch, and a star resting or moving in the order shows up in batter props and team totals. Weather matters too: wind and temperature affect totals, and rain delays or postponements change start times. For a data consumer, the takeaway is that the hours before first pitch carry a lot of line movement, so that window deserves your fastest refresh.

Props appear late and vanish at first pitch

Pitcher strikeout lines often go up once starters are confirmed, and batter props follow lineups. Props stay on the feed after first pitch for as long as each source keeps posting them, with in-play prices on the Syndicate plan. DFS pick'em lines from apps such as PrizePicks and Underdog arrive in the same shape with a variant field (standard, goblin or demon), which matters if you build tools that compare pick'em lines to sportsbook props.

In-play volume

Real-time MLB odds change between pitches and between half-innings, and a run scoring or a pitching change produces a burst of updates across every book. Markets are suspended when a source stops reporting fresh prices, and the response marks them with suspended: true. Do not display a suspended price as live.

The season calendar

The regular season runs from late March or early April to late September or early October, followed by the postseason in October. World Series futures are priced all year, but the board is most active in spring, around the trade deadline and through the playoffs. In the offseason, the daily game feed goes quiet and futures become the main MLB product.

How to use the MLB odds API

Start with an API key from get access (every account gets a free key with 50 credits), then call /v1/odds with league=mlb. Note that this is an MLB API for prices rather than statistics: beyond odds, it returns only the score and game clock, through /v1/scores. This request returns full-game and first-five lines from three books:

curl "https://api.preciseapi.com/v1/odds?league=mlb&markets=moneyline,spread,total&periods=full_game,f5&books=pinnacle,draftkings,fanduel&status=scheduled" \
  -H "Authorization: Bearer $PRECISEAPI_KEY"

Each event has home, away, start_time and status, and a bookmakers array. Every bookmaker holds a list of markets with a key, a period, a line where it applies, and outcomes with a side, a point and a price. This Node script prints each book's run line for every game:

// Node 18+ (built-in fetch)
const params = new URLSearchParams({
  league: 'mlb',
  markets: 'spread',
  periods: 'full_game',
  books: 'pinnacle,draftkings,fanduel',
});

const res = await fetch(`https://api.preciseapi.com/v1/odds?${params}`, {
  headers: { Authorization: `Bearer ${process.env.PRECISEAPI_KEY}` },
});
const { data, meta } = await res.json();

for (const event of data) {
  console.log(`${event.away.abbr} @ ${event.home.abbr}  ${event.start_time}`);
  for (const book of event.bookmakers) {
    const runLine = book.markets.find((m) => m.key === 'spread' && m.period === 'full_game');
    if (!runLine || runLine.suspended) continue;
    const [home, away] = runLine.outcomes;
    console.log(`  ${book.name.padEnd(12)} ${home.point} ${home.price}  /  ${away.point} ${away.price}`);
  }
}
console.log(`credits left: ${meta.credits_remaining}`);

MLB player props API

Props come from /v1/props, which returns sportsbook and DFS lines together. Each market carries a player object with a stable id, name, team and position, and a line with over and under prices. See the props reference for every parameter.

curl "https://api.preciseapi.com/v1/props?league=mlb&markets=player_strikeouts&books=draftkings,fanduel,prizepicks,underdog" \
  -H "Authorization: Bearer $PRECISEAPI_KEY"

Best lines, history and streaming

/v1/best-lines?league=mlb returns, for each outcome, the best_price, the best_books offering it and how many books are quoting (books_quoting). That is the core of a line shopping view without any aggregation code on your side. /v1/history returns the opening price, current price and every move for main full-game markets from a given book, which is what backtests and closing-line studies need.

For in-play games, the MLB live odds API is the WebSocket at /v1/stream. Open a connection and subscribe to mlb. You receive one snapshot and then sequence-numbered deltas containing only the markets that changed. The streaming guide covers resync and reconnect handling.

{ "type": "subscribe", "leagues": ["mlb"], "books": ["pinnacle", "draftkings", "fanduel"], "markets": ["moneyline", "spread", "total"] }

For MLB futures odds, call /v1/futures?league=mlb, which returns the World Series winner market. The board comes back with each source's price for every team.

What you can build with MLB odds data

A simple plan for most MLB apps is REST polling for pre-match games on Edge or Sharp, and the WebSocket stream on Syndicate once in-play games matter. Line history is included from Edge.

MLB and team names are trademarks of their respective owners and are used here for identification only. PreciseAPI is not affiliated with or endorsed by Major League Baseball.

Frequently asked questions

Is there a free MLB odds API?

You can try the data for free. The Sandbox gives you 50 credits for the Sandbox chat with no card required, and it covers pre-game MLB lines along with every other league, book and market, including props. Each question costs 2 credits, and the same credits work on the API with your free key, at 2 credits a /v1/odds call.

How fast do MLB odds update?

In-play prices are published in under 500 ms and pre-match prices refresh every 1 to 2 seconds. On Syndicate, the WebSocket stream pushes changes as they happen, so you do not need to poll live games.

Does the MLB odds API include the run line and first five innings?

Yes. The run line is the spread market, and first-five-innings markets use periods=f5. Both come back alongside moneyline and total in the same request.

Which books and markets are covered for MLB?

35 sources price MLB, including regulated US books, sharp and offshore books, betting exchanges, contract exchanges and DFS apps. Markets include moneyline, run line, totals, alternate totals, team totals, pitcher and batter props, and World Series futures.

Can I get historical MLB lines?

Yes. /v1/history returns the opening price, current price and timestamped moves for main full-game markets, and it is included on every paid plan, from Edge up.

How do I get MLB odds in decimal or probability format?

Add format=decimal or format=probability to any odds request. American odds are the default.