# Sports Betting Odds: NFL, NBA, NHL, MLB & Soccer Lines (`tacps126/sports-betting-odds`) Actor

Betting odds for NFL, NBA, NHL, MLB, college and European football: moneyline, spread and total with prices, opening vs current and closing lines, line movement, no-vig win probability, and how each line settled (cover, over/under).

- **URL**: https://apify.com/tacps126/sports-betting-odds.md
- **Developed by:** [Tapaswai Choudhary](https://apify.com/tacps126) (community)
- **Categories:** Sports, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 odds line or games

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Sports Betting Odds: NFL, NBA, NHL, MLB & Soccer Lines

**Betting lines** for the **NFL, NBA, NHL, MLB**, WNBA, college football and basketball, and **European football** (Premier League, LaLiga, Bundesliga, Serie A, Ligue 1, Champions League and more): **moneyline, point spread and total** with their prices, **opening vs current lines**, **closing lines** once the game is over, **line movement**, the **no-vig win probability**, and **how each line settled** (who covered, over or under, did the favourite win). Schedule it hourly to catch every line move.

**Built for** sports bettors and handicappers, picks and odds sites, model builders and quants, sports media and newsletters, Discord and Telegram bots, and AI agents.

### What you get

One row per game per sportsbook (DraftKings for US leagues; DraftKings and bet365 for European football):

| Field | Meaning |
|---|---|
| `league`, `name`, `date`, `homeTeam`, `awayTeam`, `status`, `state` | The game |
| `sportsbook`, `lineType` (`current` or `closing`), `details` | Whose line, and whether it is still moving |
| `homeMoneyline`, `awayMoneyline`, `drawMoneyline` + `...Open` | Moneyline now and at open (American odds; draw for football) |
| `homeSpread`, `homeSpreadOdds`, `awaySpreadOdds`, `homeSpreadOpen`, `spreadMove` | Point spread, its prices, the opening spread and how far it moved |
| `total`, `overOdds`, `underOdds`, `totalOpen`, `totalMove` | Total points or goals, prices, opening total and movement |
| `favorite`, `favoriteAtOpen` | The favourite now and at open |
| `homeWinProbability`, `awayWinProbability` | Fair win probability with the bookmaker margin removed |
| `homeScore`, `awayScore`, `spreadResult`, `totalResult`, `favoriteWon` | For finished games: the score, `home covered` / `away covered` / `push`, `over` / `under` / `push` |

```json
{
  "name": "Carolina Panthers at Green Bay Packers",
  "sportsbook": "DraftKings",
  "lineType": "closing",
  "homeMoneyline": -185,
  "homeMoneylineOpen": -325,
  "homeSpread": -3.5,
  "homeSpreadOpen": -7,
  "spreadMove": 3.5,
  "total": 47.5,
  "totalOpen": 45.5,
  "homeWinProbability": 0.623,
  "homeScore": 27,
  "awayScore": 19,
  "spreadResult": "home covered",
  "totalResult": "under",
  "favoriteWon": true
}
```

### Why this Actor

- **Opening, current and closing lines** side by side, with movement already worked out.
- **Settled for you**: cover, over/under and favourite results on finished games, ready for backtests.
- **Fair probability** with the bookmaker margin removed.
- **19 leagues, one shape**: US pro and college sports plus the top European football leagues.
- **Line moves once**: *Only new* + an hourly schedule returns a line again only when it changes.
- **For AI agents.** Callable as an MCP tool.

### How to use it

Lines for the next three days (NFL, NBA, NHL, Premier League):

```json
{}
```

This weekend's NFL and college football lines:

```json
{ "leagues": ["nfl", "ncaaf"], "daysBack": 0, "daysAhead": 3 }
```

Last week's NFL closing lines and how they settled:

```json
{ "leagues": ["nfl"], "daysBack": 7, "gameStatus": "final" }
```

Line-move feed for the Premier League and Champions League (schedule hourly):

```json
{ "leagues": ["premier-league", "champions-league"], "daysAhead": 3, "onlyNew": true }
```

### Options

| Option | What it does |
|---|---|
| **Leagues** (`leagues`) | `nfl`, `ncaaf`, `nba`, `wnba`, `ncaab`, `mlb`, `nhl`, `premier-league`, `championship`, `la-liga`, `bundesliga`, `serie-a`, `ligue-1`, `eredivisie`, `primeira-liga`, `champions-league`, `europa-league`, `mls`, `liga-mx` |
| **Data** (`dataType`) | `odds` (default) or `games` (scores and schedules) |
| **Days back** / **Days ahead** (`daysBack`, `daysAhead`) | Rolling window: `daysBack: 7` = the last week; `daysAhead: 3` = the next three days |
| **From date** / **To date** (`dateFrom`, `dateTo`) | Exact range (`YYYY-MM-DD`) |
| **Game status** (`gameStatus`) | `any`, `final` (closing lines with results), `live` or `scheduled` |
| **Teams** (`teams`) | Names or abbreviations, e.g. `Lakers`, `KC`, `Arsenal`. Empty = all |
| **Max results** (`maxItems`) | Most rows per run |
| **Only new** (`onlyNew`, `monitorName`) | With a schedule, a line comes back only when it moves |

### Pricing

**$3 per 1,000 odds rows** (one game's lines from one sportsbook), plus a small start fee per run. On the Apify free plan a run returns up to 100 rows.

### Good to know

- Lines appear once the sportsbook posts them: NFL lines for the whole week, most other leagues on game day.
- Odds are American (e.g. `-110`, `+154`). Probabilities are 0 to 1.
- Need player stats, standings or rosters? **Sports Data** (tacps126/sports-data) covers 24 leagues with the same fields.
- Odds are for research and analysis, not a live trading feed.
- Questions: **tacps126@gmail.com**.

# Actor input Schema

## `leagues` (type: `array`):

US leagues, college and European football.

## `dataType` (type: `string`):

Odds give opening and current (closing after the game) moneyline, spread and total with prices, the favourite now and at open, line movement, fair win probability and, for finished games, which side covered and whether the total went over.

## `daysBack` (type: `integer`):

0 = today. Use 7 with Game status = Final for last week's closing lines and results.

## `daysAhead` (type: `integer`):

Upcoming games, e.g. 3 for lines on the next three days.

## `dateFrom` (type: `string`):

YYYY-MM-DD; replaces Days back.

## `dateTo` (type: `string`):

YYYY-MM-DD; replaces Days ahead. Up to about one season per run.

## `gameStatus` (type: `string`):

Final gives closing lines with how each line settled.

## `teams` (type: `array`):

Team names or abbreviations, e.g. Lakers, KC, Arsenal. Empty = all.

## `maxItems` (type: `integer`):

Most rows returned per run.

## `onlyNew` (type: `boolean`):

Schedule the Actor and each run returns a line again only when it moves, so an hourly run gives line movement without repeats.

## `monitorName` (type: `string`):

Optional name for the "only new" history, so several monitors can run side by side.

## `tenantId` (type: `string`):

Optional label used to keep separate histories for different clients or teams.

## `debug` (type: `boolean`):

Save extra diagnostics with the run (for support requests).

## Actor input object example

```json
{
  "leagues": [
    "nfl",
    "nba",
    "nhl",
    "premier-league"
  ],
  "dataType": "odds",
  "daysBack": 0,
  "daysAhead": 3,
  "gameStatus": "any",
  "maxItems": 1000,
  "onlyNew": false,
  "debug": false
}
```

# Actor output Schema

## `results` (type: `string`):

The produced items (default dataset items).

# 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 = {
    "leagues": [
        "nfl",
        "nba",
        "nhl",
        "premier-league"
    ],
    "daysBack": 0,
    "daysAhead": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("tacps126/sports-betting-odds").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 = {
    "leagues": [
        "nfl",
        "nba",
        "nhl",
        "premier-league",
    ],
    "daysBack": 0,
    "daysAhead": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("tacps126/sports-betting-odds").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 '{
  "leagues": [
    "nfl",
    "nba",
    "nhl",
    "premier-league"
  ],
  "daysBack": 0,
  "daysAhead": 3
}' |
apify call tacps126/sports-betting-odds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tacps126/sports-betting-odds"
        }
    }
}
```

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/wA2L6IFvLbTC3pRMb/builds/bwPXs5d32TbawGsID/openapi.json
