MLB Betting Data

MLB API — Real-Time Odds from 43 Sportsbooks

Live MLB moneylines, run lines, game totals, and player props from DraftKings, FanDuel, Pinnacle, and 40 other sportsbooks. One endpoint, one schema, sub-89ms latency.

By theFounder·SharpAPI

SharpAPI's MLB API returns real-time betting odds for every MLB game — regular season, playoffs, and World Series. Call GET /v1/odds?sport=baseball_mlb&markets=h2h,spreads,totals and get moneylines, run lines (+/-1.5), and game totals from all sportsbooks on your plan, or stream live line movements via SSE the instant books move.

What the MLB API Returns

Moneylines (h2h)

Home/away win prices from every sportsbook on your plan. Updated in real-time as books shade lines.

Run Lines (Spreads)

Standard +/-1.5 run lines and alternate run lines from all covered sportsbooks.

Game Totals

Full-game over/under totals. First 5-inning totals available on Pro+.

Player Props

Strikeout totals, home run scorer, hits, RBIs, total bases from major books (Pro+).

Live In-Game Odds

Real-time in-game lines streamed via SSE as books update during live MLB games.

No-Vig Fair Odds

Pinnacle no-vig lines for every MLB game to calculate true probabilities and +EV (Pro+).

Quick Start

REST — Fetch MLB Odds

// Fetch live MLB moneylines, run lines, and totals
const res = await fetch(
  'https://api.sharpapi.io/v1/odds?sport=baseball_mlb&markets=h2h,spreads,totals',
  { headers: { Authorization: `Bearer ${process.env.SHARPAPI_KEY}` } }
)
const { data: events } = await res.json()

for (const event of events) {
  console.log(`${event.home_team} vs ${event.away_team}`)
  for (const book of event.bookmakers) {
    const runLine = book.markets.find(m => m.key === 'spreads')
    if (runLine) {
      const [home, away] = runLine.outcomes
      console.log(`  ${book.title} run line: ${home.name} ${home.point} (${home.price}) / ${away.name} ${away.point} (${away.price})`)
    }
  }
}

SSE — Stream Live MLB Lines

// Stream live MLB line movements via SSE
const source = new EventSource(
  'https://api.sharpapi.io/v1/stream?sport=baseball_mlb',
  { headers: { Authorization: `Bearer ${process.env.SHARPAPI_KEY}` } }
)

source.addEventListener('odds:update', (e) => {
  const update = JSON.parse(e.data)
  // Called the instant a sportsbook moves a line
  console.log(`[${update.sportsbook}] ${update.market} ${update.outcome}: ${update.old_price} → ${update.new_price}`)
})

Get a free API key in 30 seconds — no credit card required.

Plans

PlanPriceSportsbooksLatencyStreaming
Free$0260s delayREST only
Hobby$79/mo5Real-timeSSE included
Pro$229/mo15Real-timeSSE + +EV + Arb

All plans include a free trial. See full pricing.

Frequently Asked Questions

Does SharpAPI have an MLB API?

Yes. SharpAPI provides real-time MLB betting odds from 43 US sportsbooks including DraftKings, FanDuel, BetMGM, Caesars, Pinnacle, and 38 others. You get moneylines, run lines (spreads), game totals (over/under), and player props for every MLB regular season, postseason, and All-Star game.

What MLB markets does the API cover?

SharpAPI returns MLB moneylines (h2h), run lines (+/-1.5 spreads and alternates), game totals, first 5-inning lines, and player props including strikeout totals, home run scorer, hits, RBIs, and total bases. SharpAPI does not provide historical box scores, batting averages, or play-by-play — for those use SportsData.io or the MLB Stats API.

Is there a free MLB API?

SharpAPI's free tier includes 12 requests per minute with no credit card required. Free tier covers MLB odds from 2 sportsbooks with a 60-second data delay. Hobby ($79/mo) adds real-time data, SSE streaming, and 5 sportsbooks.

What is a run line in the MLB API?

The run line is baseball's version of the point spread — typically +/-1.5 runs. SharpAPI returns run line odds under the "spreads" market key. Each outcome includes the team name, the points value (+1.5 or -1.5), and the American odds price from each sportsbook.

Can I get live in-game MLB odds?

Yes. SharpAPI streams live in-game MLB odds via SSE on Hobby plan and above. In-game lines update the instant a sportsbook moves them — no polling required. The SSE stream covers moneylines, totals, and run lines during live games.

How does SharpAPI compare to the MLB Stats API?

The official MLB Stats API (statsapi.mlb.com) provides free historical stats, game schedules, roster data, and play-by-play. It does not provide betting odds. SharpAPI provides real-time betting odds from 43 sportsbooks but not historical game stats. They complement each other — many developers use both.

Related

Ready to Build?
Start free. Scale when you're ready. No credit card required.

No credit card required