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

Moneyline, spread and total betting odds (opening and current) plus live scores, schedules and results for NFL, NBA, MLB, NHL, college sports and 12 soccer leagues. No-vig win probabilities included. No login, no proxies.

- **URL**: https://apify.com/peccarvalho/sports-odds.md
- **Developed by:** [Pedro Carvalho](https://apify.com/peccarvalho) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 game returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Odds & Scores: NFL, NBA, MLB, NHL & Soccer Betting Lines

Get **betting odds, live scores, schedules and results** for 20 leagues as clean JSON, CSV or Excel: NFL, NBA, MLB, NHL, WNBA, college football and basketball, the Premier League, LaLiga, Bundesliga, Serie A, Ligue 1, Champions League, MLS and more.

Every game comes with **moneyline, spread and total lines (opening and current)**, **no-vig win probabilities**, and for finished games, **closing lines and whether each side covered**. That's everything you need for a backtest.

There's no login, no API key, no browser and no proxies. A week of games across all 20 leagues takes about 10 seconds.

### What you get

For every game:

| Field | Example |
|---|---|
| `league`, `startTime`, `status`, `statusDetail` | `NFL`, `2026-10-05T21:00Z`, `live`, `Q3 4:12` |
| `homeTeam`, `awayTeam`, `homeAbbr`, `awayAbbr`, `homeRecord` | "Cleveland Guardians", "CHW", "88-74" |
| `homeScore`, `awayScore`, `winner` | `5`, `2`, `home` |
| `moneylineHome`, `moneylineAway`, `moneylineDraw` | `-149`, `+123`, `+390` (soccer) |
| `spreadHome`, `spreadHomeOdds`, `spreadAwayOdds` | `-1.5`, `+157`, `-191` |
| `total`, `overOdds`, `underOdds` | `6.5`, `-115`, `-104` |
| `...Open` versions of every line | `moneylineHomeOpen: -164`: where the line opened, so you can see how it moved |
| `winProbHome`, `winProbAway`, `winProbDraw` | `0.5716`: implied by the moneyline with the bookmaker's margin removed |
| `spreadResult`, `totalResult` | `away`, `under`: who covered and whether it went over, for finished games |
| `venue`, `city`, `broadcasts`, `week`, `season` | "Progressive Field", "Cleveland, OH", `["ESPN"]` |
| `oddsProvider` | `DraftKings` |
| `url` | a link to the game on ESPN |

### How to use it

**This week's slate:** pick your leagues and set `daysAhead` (default 7).

**Live scores:** `status: "live"`. Put it on an Apify **schedule** every few minutes.

**Historical results and closing lines:** set `dateFrom` and `dateTo` (up to 62 days per run) with `status: "final"`.

**One team:** `teams: ["Chiefs", "Arsenal", "LAL"]` matches names or abbreviations.

**Only games with lines posted:** `onlyWithOdds: true`.

#### Example input

```json
{
  "leagues": ["nfl", "ncaaf"],
  "dateFrom": "2026-09-01",
  "dateTo": "2026-09-30",
  "status": "final",
  "onlyWithOdds": true
}
```

### Pricing

You pay **per game returned**, and `maxItems` caps what a run can cost. Opening lines, closing lines and bet results are included at no extra charge.

### Use cases

- **Bettors and handicappers:** track line movement from open to close, and find where the market moved.
- **Backtesting models:** a full season of closing lines, scores and against-the-spread results in one export.
- **Fantasy and media sites:** schedules, live scores and odds for widgets, newsletters and Discord bots.
- **Prediction market traders:** compare sportsbook win probabilities with [Kalshi](https://apify.com/peccarvalho/kalshi-markets) and [Polymarket](https://apify.com/peccarvalho/polymarket-markets) prices on the same games.

### FAQ

**Where do the odds come from?** They're the sportsbook lines ESPN shows on its scoreboards: DraftKings for most leagues.

**Why do some games have no odds?** Lines usually go up a few days before a game, and preseason or minor games often don't get them. Use `onlyWithOdds` to skip those.

**What time zone are the dates?** `startTime` is in UTC. `dateFrom`, `dateTo` and `daysAhead` follow ESPN's scoreboard days, which are US Eastern time.

**Something's wrong or missing?** Open an issue on the Issues tab, and it'll be fixed quickly.

*Not affiliated with ESPN or any sportsbook. Data is provided as-is and isn't betting advice. 21+. If you or someone you know has a gambling problem, call 1-800-GAMBLER.*

# Actor input Schema

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

Pick one or more leagues.

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

Today plus this many days. Ignored if you set a date range below.

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

First day to fetch (YYYY-MM-DD). Use a past range for historical results and closing lines.

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

Last day to fetch (YYYY-MM-DD). Up to 62 days per run.

## `status` (type: `string`):

Only games in this state.

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

Only games involving these teams, by name or abbreviation, e.g. 'Lakers', 'KC', 'Arsenal'.

## `onlyWithOdds` (type: `boolean`):

Skip games where no sportsbook line is posted yet.

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

Stop after this many games. You're charged per game, so this caps the run's cost.

## Actor input object example

```json
{
  "leagues": [
    "nfl",
    "nba",
    "mlb",
    "nhl",
    "epl"
  ],
  "daysAhead": 7,
  "status": "any",
  "onlyWithOdds": false,
  "maxItems": 500
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `allFields` (type: `string`):

No description

# 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",
        "mlb",
        "nhl",
        "epl"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("peccarvalho/sports-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",
        "mlb",
        "nhl",
        "epl",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("peccarvalho/sports-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",
    "mlb",
    "nhl",
    "epl"
  ]
}' |
apify call peccarvalho/sports-odds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,peccarvalho/sports-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/IDRcyOsnGcSGT5wWO/builds/tTlRCh6txbnFUqiv8/openapi.json
