# ESPN Scraper: Scores, Schedules & Odds (`bibian/espn-scores-scraper`) Actor

Extract live scores, schedules and betting odds from ESPN's public API for NFL, NBA, WNBA, MLB, NHL, NCAA football, NCAA basketball and Premier League soccer.

- **URL**: https://apify.com/bibian/espn-scores-scraper.md
- **Developed by:** [Vivien MORVAN](https://apify.com/bibian) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 games

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

## ESPN Scraper: Scores, Schedules & Odds

Scrape live scores, schedules and betting odds from ESPN's public JSON API for NFL, NBA, WNBA, MLB, NHL, NCAA football, NCAA basketball and Premier League soccer, and get clean structured data.

### What you can do with it

- **Track live and final scores**: pull recent and in-progress games with the full score, venue and broadcast.
- **Watch upcoming games and odds**: get scheduled games with pre-match spread, moneyline and total before they start.
- **Feed a scores widget or alert**: run daily and get every game of the day for a league in one call.
- **Build a multi-league dataset**: run the same actor once per league to compare schedules, scores and odds side by side.

### Input

| Field | What it does |
|---|---|
| League | `nfl`, `nba`, `wnba`, `mlb`, `nhl`, `ncaaf`, `ncaab` or `eng.1` (Premier League). |
| Mode | `results` reads games going backward from today, with final or live scores. `upcoming` reads games going forward from today, with pre-match odds when published. |
| Number of days | How many calendar days to read (default 14). |
| Maximum number of games | The run stops once this many games are saved. |

### Output

One record per game:

```json
{
  "league": "nfl",
  "id": "401872979",
  "url": "https://www.espn.com/nfl/game/_/gameId/401872979/falcons-saints",
  "date": "2026-10-06T00:15Z",
  "name": "Atlanta Falcons at New Orleans Saints",
  "shortName": "ATL @ NO",
  "state": "pre",
  "statusDetail": "Mon, October 5th at 8:15 PM EDT",
  "completed": false,
  "venue": "Caesars Superdome",
  "venueCity": "New Orleans",
  "homeTeam": "New Orleans Saints",
  "homeTeamAbbreviation": "NO",
  "homeScore": 0,
  "awayTeam": "Atlanta Falcons",
  "awayTeamAbbreviation": "ATL",
  "awayScore": 0,
  "winner": null,
  "broadcast": "ESPN",
  "odds": {
    "provider": "DraftKings",
    "details": "NO -1.5",
    "spread": -1.5,
    "overUnder": 47.5,
    "moneylineHome": "-130",
    "moneylineAway": "+110",
    "favorite": "home"
  }
}
```

Export the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Why this one

- **One actor, eight leagues.** NFL, NBA, WNBA, MLB, NHL, NCAA football, NCAA basketball and Premier League all use the same fields, instead of a different actor per sport.
- **Odds included.** Spread, moneyline and total are already parsed from the raw API response, not just scores.
- **No browser, no proxy.** Reads ESPN's own public JSON API directly, so runs are fast and cheap.

### Good to know

- `odds` is `null` until a sportsbook has posted a line for the game, and is never backfilled for games already finished.
- `winner` is `null` until the game is `completed`; `homeScore`/`awayScore` are `0` before the game starts.
- Only league, team and game data is collected: no player or fan personal data of any kind.

# Actor input Schema

## `league` (type: `string`):

Which league's scoreboard to read.

## `mode` (type: `string`):

"Results" reads games going backward from today, with final or live scores. "Upcoming" reads games going forward from today, with pre-match odds when published.

## `days` (type: `integer`):

How many calendar days to read (today plus this many days back for results, or forward for upcoming games).

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

The run stops once this many games are saved.

## Actor input object example

```json
{
  "league": "nfl",
  "mode": "results",
  "days": 14,
  "maxItems": 50
}
```

# Actor output Schema

## `games` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bibian/espn-scores-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("bibian/espn-scores-scraper").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 '{}' |
apify call bibian/espn-scores-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bibian/espn-scores-scraper"
        }
    }
}
```

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/oCH52tVmpbQxctJV6/builds/Bt2b4JPNrnxSUKuXf/openapi.json
