# ESPN Scraper: Live Scores API & Sports Scores (`devilscrapes/espn-scores-scraper`) Actor

ESPN scraper and ESPN API alternative: pull scoreboards, live and final scores, betting odds, venues and broadcasters for EPL, La Liga, Serie A, NBA, NFL, MLB and NHL. A live scores API and sports scores scraper with one clean row per event across any date range.

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

## Pricing

Pay per event

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />
</div>

## ESPN Scraper: Live Scores API & Sports Scores

**💰 $1.50 / 1 000 events**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

An ESPN scraper and ESPN API alternative that returns scoreboards as clean,
flat rows: fixtures, live and final scores, status, venues, betting odds and
broadcasters, one row per event, across a date range and several leagues in
a single run. Think of it as a live scores API without the date-loop, dedupe
and retry plumbing.

### 🎯 What this scrapes

ESPN's public scoreboard data for seven leagues: English Premier League,
La Liga, Serie A, NBA, NFL, MLB and NHL. Each row is one event with teams,
scores, game state, start time, venue, city, odds line, over/under,
broadcasters and a link to the ESPN summary page. This sports scores scraper
covers scoreboards only; standings, rosters and play-by-play are not included.

### 🔥 Features

- **Multi-league, multi-day in one run.** Pick up to seven leagues and a range of up to 31 days.
- **We dedupe for you.** Each event appears once per league, however many days overlap.
- **We derive the winner.** When ESPN omits it, we work it out from the final score.
- **We retry with exponential backoff** on `408 / 429 / 5xx` and honour `Retry-After`.
- **We keep the dataset clean.** Pydantic-validated rows, ISO-8601 timestamps, stable ids.
- **A bad day never sinks the run.** A failed league-day is logged and skipped; the rest still land.

### 💡 Use cases

- **App and bot builders** who need a live scores API feeding a score ticker or Discord bot.
- **Betting and analytics hobbyists** tracking odds lines next to final results.
- **Newsletter and fantasy authors** pulling the day's fixtures and finals on a schedule.
- **Researchers** building a dataset of results by league and date.

### ⚙️ How to use it

1. Choose one or more `leagues`.
2. Set `startDate` and `endDate` (empty means today, UTC).
3. Set `maxEvents` to cap how many rows you pay for.
4. Run it, then export to JSON, CSV or Excel, or pull the dataset through the Apify API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `leagues` | `array<string>` | no | `["soccer/eng.1"]` | 1 to 7 of `soccer/eng.1`, `soccer/esp.1`, `soccer/ita.1`, `basketball/nba`, `football/nfl`, `baseball/mlb`, `hockey/nhl`. |
| `startDate` | `string` | no | today (UTC) | First day, inclusive, `YYYY-MM-DD`. |
| `endDate` | `string` | no | `startDate` | Last day, inclusive. Range up to 31 days. |
| `maxEvents` | `integer` | no | `100` | Hard cap on rows for the run (1 to 10000). |
| `proxyConfiguration` | `object` | no | direct | Optional. Direct is the default; enable Apify Proxy for very large ranges. |

#### Example input

```json
{
  "leagues": ["soccer/eng.1", "football/nfl"],
  "startDate": "2026-10-10",
  "endDate": "2026-10-11",
  "maxEvents": 40
}
```

### 📤 Output

One row per event.

| Field | Type | Notes |
|---|---|---|
| `event_id` | `string` | ESPN event id. |
| `league` | `string` | `sport/league` key. |
| `league_name` | `string \| null` | League display name. |
| `event_name` | `string` | Full event name. |
| `short_name` | `string \| null` | Short event name. |
| `start_time` | `string` | ISO 8601 UTC. |
| `status_state` | `string` | `pre`, `in` or `post`. |
| `status_detail` | `string \| null` | Human readable status. |
| `completed` | `boolean` | Whether the event finished. |
| `home_team`, `away_team` | `string` | Team display names. |
| `home_score`, `away_score` | `integer \| null` | Scores. |
| `winner` | `string \| null` | Null for draws and unfinished events. |
| `venue`, `city` | `string \| null` | Where it is played. |
| `odds_details`, `over_under` | `string \| null`, `number \| null` | First odds provider. |
| `broadcasts` | `array<string>` | Empty when none. |
| `url` | `string \| null` | ESPN summary page. |
| `scraped_at` | `string` | Run time, ISO 8601 UTC. |

#### Example output

```json
{
  "event_id": "401879268",
  "league": "soccer/eng.1",
  "league_name": "English Premier League",
  "event_name": "Leeds United at Arsenal",
  "short_name": "LEE @ ARS",
  "start_time": "2026-10-10T11:30:00Z",
  "status_state": "pre",
  "completed": false,
  "home_team": "Arsenal",
  "away_team": "Leeds United",
  "home_score": 0,
  "away_score": 0,
  "winner": null,
  "venue": "Emirates Stadium",
  "city": "London",
  "odds_details": "ARS -265",
  "over_under": 2.5,
  "broadcasts": ["USA Net", "Universo"],
  "scraped_at": "2026-10-07T12:00:00Z"
}
```

### 💰 Pricing

Pay-per-event. No subscription, no minimum.

| Event | Price |
|---|---|
| Actor start | $0.20 per run |
| Result | $0.0015 per event row ($1.50 / 1 000) |

A typical run lands at **$1.70 per 1,000 results**: the $0.20 start fee plus 1,000 × $0.0015 per event row. You pay only for rows that land.

You pay only for results that land. A run that finds no events is charged
only the start fee.

### 🚧 Limitations

- Scoreboards only: no standings, rosters, box scores or play-by-play.
- Seven leagues in this version; more are added once verified.
- Odds appear for soccer and NFL; NBA, MLB and most NHL events have none, and those fields are null.
- Up to 31 days per run.
- Scoreboard data belongs to its owner; we return facts only, no logos or media.

### ❓ FAQ

**Is this an official ESPN API?** No. It is an independent ESPN scraper that reads ESPN's public scoreboard data and returns it as a tidy dataset.

**Does it return live scores?** Yes, for events in progress at the moment of the run. Each run is a snapshot; schedule it for continuous updates.

**What if a day has no games?** The run succeeds with zero rows and a status message saying what was searched.

### 💬 Your feedback

Found a league you need or a field that is off? Tell us through the Actor's Issues tab and we will take a look.

# Changelog

This Actor's version history is a separate document: https://apify.com/devilscrapes/espn-scores-scraper/changelog.md

# Actor input Schema

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

Leagues to pull scoreboards for (sport/league keys).

## `startDate` (type: `string`):

First day to pull, inclusive (YYYY-MM-DD). Leave empty for today (UTC).

## `endDate` (type: `string`):

Last day to pull, inclusive (YYYY-MM-DD). Leave empty to use the start date. The range can span at most 31 days.

## `maxEvents` (type: `integer`):

Hard cap on dataset rows for the whole run.

## `proxyConfiguration` (type: `object`):

Optional. Requests go direct by default because this host is a public, keyless API that answers datacenter and home IPs without a proxy, which saves proxy cost. Enable Apify Proxy if you run very large date ranges.

## Actor input object example

```json
{
  "leagues": [
    "soccer/eng.1",
    "football/nfl"
  ],
  "startDate": "2026-10-10",
  "endDate": "2026-10-11",
  "maxEvents": 40
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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": [
        "soccer/eng.1",
        "football/nfl"
    ],
    "startDate": "2026-10-10",
    "endDate": "2026-10-11",
    "maxEvents": 40
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/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 = {
    "leagues": [
        "soccer/eng.1",
        "football/nfl",
    ],
    "startDate": "2026-10-10",
    "endDate": "2026-10-11",
    "maxEvents": 40,
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/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 '{
  "leagues": [
    "soccer/eng.1",
    "football/nfl"
  ],
  "startDate": "2026-10-10",
  "endDate": "2026-10-11",
  "maxEvents": 40
}' |
apify call devilscrapes/espn-scores-scraper --silent --output-dataset

```

## MCP server setup

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