Arbitrage Betting API Tutorial: Find Arb Opportunities with MoneyLine

What Is Arbitrage Betting and Why Build an API-Powered Tool?

Arbitrage betting — commonly called 'arbing' — is the practice of placing bets on all possible outcomes of an event across different sportsbooks such that you guarantee a profit regardless of the result. This is possible when bookmakers disagree enough on odds that the combined implied probabilities across outcomes sum to less than 100%.

Building an arbitrage detector manually used to mean scraping dozens of sportsbooks, normalizing data formats, and constantly fighting rate limits. A dedicated sports betting analytics API changes that equation entirely. MoneyLine's API aggregates lines from multiple bookmakers into a single normalized JSON feed, giving your application everything it needs to calculate arb percentages in real time.

This tutorial walks you through using MoneyLine's /v1/edge endpoint — which surfaces arbitrage opportunities directly — alongside /v1/odds for raw bookmaker data so you can build your own custom arb calculator. Whether you're building a personal dashboard, a Discord bot, or a commercial alerting tool, the free tier supports both use cases.

Understanding the MoneyLine API Data Model for Arb Detection

Before writing a single line of code, you need to understand how MoneyLine structures its response data. Every request to /v1/odds, /v1/events, or /v1/edge requires your API key passed in the request header as x-api-key. Without it, you'll receive a 401.

The events endpoint (/v1/events) is your starting point. Each event object carries an eventId and a leagueId — these are the two identifiers you'll use across every other endpoint. For example, a Monday Night Football game returns an eventId you then pass to /v1/odds to retrieve per-bookmaker pricing.

The /v1/odds response has two major sections. First, an event summary with moneyline, spread, and total — each of these is an array of objects shaped like { name, point?, fairOdds, bestOdds, avgOdds }. The name field is the outcome label (e.g., 'Kansas City Chiefs', 'Over', 'Away -3.5'). The bestOdds value is the best American-format price available across all indexed books. This summary is perfect for a quick arb percentage calculation.

Second, there's a bookmakers array. Each entry has a bookmakerId, bookmakerName, sourceType (exchange vs. sportsbook), and a markets array. Each market has a marketType (like 'moneyline' or 'spread') and an outcomes array of { name, point?, price }. The price field is the American-format odds from that specific book. This granular data is what you need to know exactly which two or more books to place your opposing bets at.

For the fastest path to arb detection, use /v1/edge. This endpoint pre-calculates positive expected value and arbitrage scenarios across all indexed events. The response surfaces opportunities where the combined implied probability of all outcomes drops below 100%, meaning a guaranteed profit margin exists if you act quickly enough.

Step-by-Step: Building an Arb Calculator with the MoneyLine API

Step 1 — Fetch Active Events. Start by calling GET /v1/events with a leagueId filter for the sport you want to monitor. For NFL games, pass leagueId=NFL. The response gives you a list of upcoming events. Extract each eventId and store it in memory or a lightweight database for the next polling cycle.

Step 2 — Pull Per-Bookmaker Odds. For each eventId, call GET /v1/odds?eventId={eventId}. Parse the bookmakers array and for each market of type 'moneyline', extract all outcomes and their price values keyed by bookmakerName. You now have a structure like: { 'DraftKings': { 'Chiefs': -115, 'Eagles': +105 }, 'FanDuel': { 'Chiefs': -110, 'Eagles': +110 } }.

Step 3 — Calculate Implied Probabilities. Convert American odds to implied probability using the standard formula. For a negative price like -115: implied_prob = 115 / (115 + 100) = 0.535. For a positive price like +110: implied_prob = 100 / (110 + 100) = 0.476. To find the best arb scenario, take the lowest implied probability for each outcome across all books — this represents the best price available for each side.

Step 4 — Check for Arbitrage. Sum the best implied probabilities across all outcomes. For a two-outcome market, if bestImpliedProb(outcome1) + bestImpliedProb(outcome2) < 1.0, you have an arb. The profit margin percentage is (1 - sum) * 100. For example, if the sum is 0.975, your guaranteed profit margin is 2.5% on total stake.

Step 5 — Calculate Optimal Stakes. Given a total bankroll B, the stake for each outcome i is: stake_i = B * (1 / impliedProb_i) / sum_of_all_inverse_impliedProbs. This ensures equal profit regardless of which outcome occurs. Display the bookmakerName, outcome name, price, and recommended stake amount in your UI.

Step 6 — Use /v1/edge as a Fast-Path Filter. Instead of computing this for every event manually, call GET /v1/edge and filter responses where the opportunity type indicates arbitrage. Use these pre-calculated results to quickly triage which events to drill into with the full /v1/odds call for stake calculations.

Here is a minimal JavaScript fetch example: const headers = { 'x-api-key': 'YOUR_API_KEY' }; const eventsRes = await fetch('https://api.moneyline.com/v1/events?leagueId=NFL', { headers }); const { events } = await eventsRes.json(); for (const event of events) { const oddsRes = await fetch(`https://api.moneyline.com/v1/odds?eventId=${event.eventId}`, { headers }); const oddsData = await oddsRes.json(); // Parse oddsData.bookmakers and run your arb calculation }

Arb Detection Across Player Props

Moneyline arbitrage on game outcomes is the most visible form of arbing, but some of the richest opportunities exist in player props — particularly for NFL passing yards, NBA points totals, and MLB strikeouts — where book-to-book disagreement is highest and lines move slower.

The /v1/player-props endpoint returns props organized per player. Each player object includes teamAbbr and teamName for easy filtering. Under each player you'll find prop markets with outcomes that follow the same { name, point?, price } structure you already know from /v1/odds. For a passing yards prop, you might see outcomes like { name: 'Over', point: 247.5, price: -115 } at one book and { name: 'Under', point: 247.5, price: -105 } at another — and occasionally a third book prices the Over at +105, creating an arb.

When building your prop arb scanner, note that the line (point) must match across books for a true arb. A player priced Over 247.5 at one book cannot be arbed against Under 250.5 at another — those are different markets. Your code should group outcomes by both marketType and point value before running the implied probability summation.

Prop arbs tend to be smaller in margin (often 0.5–1.5%) but they're also less likely to trigger account restrictions at books compared to heavy game-total arbing. Building a diversified arb tool that covers both game lines and props via the MoneyLine API gives you more volume and reduces concentration risk.

Polling Strategy, Latency, and Production Considerations

Arb opportunities are fleeting — books correct their lines within minutes, sometimes seconds, of a sharp bet or a competitor adjustment. Your polling interval is critical. For game-day use, polling /v1/edge every 60–90 seconds is a reasonable starting point on the free tier. For production commercial applications, tighter intervals may be appropriate depending on your plan.

To avoid redundant processing, cache the last seen price for each { eventId, bookmakerId, marketType, outcomeName, point } tuple. Only re-run your arb calculation when at least one price in the tuple has changed. This reduces CPU overhead dramatically if you're monitoring hundreds of events simultaneously.

Latency between your arb alert and execution is the biggest practical challenge. By the time your API call completes, your calculation runs, and you navigate to the book's bet slip, lines can shift. Structure your app to surface the bookmakerName and outcome name prominently so users can act immediately. Consider a browser notification or mobile push via your frontend when a new arb is detected.

Always log the timestamp of your API response alongside each detected opportunity. If you're tracking your arb hit rate over time, you'll want to correlate detection time with the window of opportunity to understand how quickly specific markets close on each bookmaker. MoneyLine's normalized data makes this longitudinal analysis straightforward since all responses use consistent field names across sports.

FAQ

Which MoneyLine API endpoint is best for finding arbitrage opportunities?

The /v1/edge endpoint is purpose-built for this — it pre-calculates arbitrage and +EV scenarios so you don't have to scan every event manually. For custom stake calculations and to identify which specific bookmakers to bet at, drill into /v1/odds using the eventId from your arb candidate. The bookmakers array with its { bookmakerId, bookmakerName, markets } structure gives you exactly the per-book pricing you need.

Does MoneyLine's API cover player prop arbitrage, not just game lines?

Yes. The /v1/player-props endpoint returns per-player prop markets with outcomes shaped as { name, point?, price }. You can run the same implied probability summation across books for props like passing yards, points scored, or shots on goal. Make sure you match on both marketType and point value — only identical lines across books constitute a true arbitrage opportunity.

What sports and leagues does the arbitrage data cover?

MoneyLine supports NFL, NBA, MLB, NHL, NCAAF, and NCAAB. All six leagues are accessible via the same endpoints — you filter by leagueId in your requests. This means a single arb scanner codebase can monitor all major North American sports simultaneously by iterating over leagueId values.

How do I authenticate my API requests?

All MoneyLine API requests require your API key passed as the value of the x-api-key HTTP request header. There is no query-string authentication option. For example, in JavaScript: fetch(url, { headers: { 'x-api-key': 'YOUR_KEY' } }). The free tier is available for both personal and commercial use, making it viable for production arbitrage tools.

Can I calculate guaranteed profit margin from the API response alone?

Yes. From the /v1/odds event summary, each outcome in the moneyline, spread, or total array includes a bestOdds field representing the best available American-format price across all indexed books. Convert each bestOdds to implied probability, sum them across outcomes, and if the sum is less than 1.0, the difference is your guaranteed profit margin percentage. For exact stake allocation per book, use the granular per-bookmaker price from the bookmakers array.

How frequently should I poll the API to catch arb opportunities before lines close?

For game-day monitoring, polling /v1/edge every 60–90 seconds is a practical starting point. Cache previously seen prices per { eventId, bookmakerId, marketType, outcomeName, point } tuple and only re-run your calculation when something changes. This keeps your application efficient while ensuring you're not missing line movements that create or close arb windows.

Explore the MoneyLine API