# Betting Odds Feed — Sports Lines API (`ichigowa/betting-odds-feed`) Actor

Normalized sports betting odds (spread, moneyline, over/under) per event and bookmaker from public ESPN endpoints for MLB, NFL, NBA, NHL, EPL, MLS and more. Informational only; unofficial, not affiliated with ESPN or any sportsbook.

- **URL**: https://apify.com/ichigowa/betting-odds-feed.md
- **Developed by:** [kyle herman](https://apify.com/ichigowa) (community)
- **Categories:** Sports, Business
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.20 / 1,000 odds rows

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Betting Odds Feed — Sports Lines API

Free **betting odds API** style feed on Apify: normalized sports odds JSON
(point spread, moneyline, over/under totals) per event and bookmaker, pulled
from ESPN's public no-auth endpoints. A simple **sports odds api free**
alternative for dashboards, models, alerts and research — including
**nfl odds json**, MLB run lines, NBA/NHL lines and soccer (EPL, MLS).

> **Disclaimer:** Odds are informational only — **not betting advice**.
> This actor is unofficial and **not affiliated with ESPN or any sportsbook**.
> Availability of lines and bookmakers depends entirely on ESPN's public feeds.

### What it does

- Fetches today's (or a chosen date's) events for the leagues you select.
- Normalizes each event's odds into one row per **event × bookmaker**.
- Fast mode (default): uses the scoreboard-embedded consensus line.
- `includeAllProviders: true`: queries ESPN's per-event odds endpoint to
  enumerate every bookmaker ESPN lists for that event (slower — one extra
  request per event).
- Events without any posted odds are skipped (count is logged).

### Input

```json
{
  "leagues": ["mlb", "nfl", "nba", "nhl"],
  "date": "",
  "includeAllProviders": false
}
```

| Field | Type | Default | Notes |
|---|---|---|---|
| `leagues` | array | `["mlb","nfl","nba","nhl"]` | See league codes below |
| `date` | string | `""` (today) | `YYYY-MM-DD` |
| `includeAllProviders` | boolean | `false` | Per-bookmaker enumeration |

#### League codes

`mlb`, `nfl`, `nba`, `nhl`, `wnba`, `ncaaf`, `ncaab`, `epl` (English Premier
League), `mls` (Major League Soccer).

### Output schema

One dataset row per event-provider:

| Field | Type | Description |
|---|---|---|
| `league` | string | Input league code |
| `event_id` | string | ESPN event id |
| `event_name` | string | e.g. `Detroit Tigers at Chicago Cubs` |
| `start_time_utc` | string | ISO 8601 UTC, e.g. `2026-07-22T00:05:00Z` |
| `home_team` | string|null | Home team display name |
| `away_team` | string|null | Away team display name |
| `provider` | string | Bookmaker name (e.g. `DraftKings`) |
| `spread` | float|null | Home-relative point spread (negative = home favored) |
| `spread_details` | string|null | Raw line string, e.g. `PHI -4.5` |
| `over_under` | float|null | Total (O/U) |
| `home_moneyline` | int|null | American odds for home team |
| `away_moneyline` | int|null | American odds for away team |
| `fetched_at` | string | ISO 8601 UTC fetch timestamp |

Example row:

```json
{
  "league": "nfl",
  "event_id": "401872929",
  "event_name": "Washington Commanders at Philadelphia Eagles",
  "start_time_utc": "2026-09-13T20:25:00Z",
  "home_team": "Philadelphia Eagles",
  "away_team": "Washington Commanders",
  "provider": "DraftKings",
  "spread": -4.5,
  "spread_details": "PHI -4.5",
  "over_under": 47.5,
  "home_moneyline": -218,
  "away_moneyline": 180,
  "fetched_at": "2026-07-21T15:49:03Z"
}
```

### Bookmakers / providers note

ESPN currently surfaces mostly a single primary partner book (DraftKings) on
its public feeds; historically the per-event odds endpoint has listed multiple
providers (Caesars, consensus, numberFire, etc.). This actor emits whatever
ESPN exposes — the provider list can change at any time without notice.

### FAQ

**Is this a free sports odds API?**
It reads ESPN's public JSON endpoints — no API key or scraping login needed.
Standard Apify usage charges apply.

**Which markets are covered?**
Game-level spread, moneyline and total (over/under). No props or live
in-play odds.

**Why are some leagues empty?**
Off-season or no games on the selected date, or ESPN posted no lines yet
(pre-season games often have no odds). Skipped-event counts are logged.

**Can I get historical odds?**
Pass `date` for past dates; ESPN keeps closing lines for some leagues, but
coverage is not guaranteed.

**Is this legal / betting advice?**
It's public informational data only, not betting advice. Verify local laws
before wagering; gamble responsibly.

# Actor input Schema

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

League codes to fetch odds for. Supported: mlb, nfl, nba, nhl, wnba, ncaaf, ncaab, epl (English Premier League), mls (Major League Soccer).

## `date` (type: `string`):

Optional date in YYYY-MM-DD format. Leave empty for today's slate.

## `includeAllProviders` (type: `boolean`):

When true, queries ESPN's per-event odds endpoint to enumerate every available bookmaker's line (slower, one extra request per event). When false, uses the fast scoreboard-embedded consensus odds (usually one provider per event).

## Actor input object example

```json
{
  "leagues": [
    "mlb",
    "nfl",
    "nba",
    "nhl"
  ],
  "date": "",
  "includeAllProviders": false
}
```

# 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": [
        "mlb",
        "nfl",
        "nba",
        "nhl"
    ],
    "date": "",
    "includeAllProviders": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("ichigowa/betting-odds-feed").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": [
        "mlb",
        "nfl",
        "nba",
        "nhl",
    ],
    "date": "",
    "includeAllProviders": False,
}

# Run the Actor and wait for it to finish
run = client.actor("ichigowa/betting-odds-feed").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "mlb",
    "nfl",
    "nba",
    "nhl"
  ],
  "date": "",
  "includeAllProviders": false
}' |
apify call ichigowa/betting-odds-feed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ichigowa/betting-odds-feed",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fbbXnnu4VTXhWiMYH/builds/cBsMM56ebrYjB0dxX/openapi.json
