# 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:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Betting Odds Feed — Sports Lines API",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "cBsMM56ebrYjB0dxX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ichigowa~betting-odds-feed/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ichigowa-betting-odds-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ichigowa~betting-odds-feed/runs": {
            "post": {
                "operationId": "runs-sync-ichigowa-betting-odds-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ichigowa~betting-odds-feed/run-sync": {
            "post": {
                "operationId": "run-sync-ichigowa-betting-odds-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "leagues": {
                        "title": "Leagues",
                        "type": "array",
                        "description": "League codes to fetch odds for. Supported: mlb, nfl, nba, nhl, wnba, ncaaf, ncaab, epl (English Premier League), mls (Major League Soccer).",
                        "default": [
                            "mlb",
                            "nfl",
                            "nba",
                            "nhl"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "date": {
                        "title": "Date (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Optional date in YYYY-MM-DD format. Leave empty for today's slate.",
                        "default": ""
                    },
                    "includeAllProviders": {
                        "title": "Include all bookmakers",
                        "type": "boolean",
                        "description": "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).",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
