# ESPN Scores Scraper (`leorochasantos/espn-scores`) Actor

A scraper for public ESPN scoreboards and game summaries: teams, scores, status, start time, venue and TV networks for any sport and league.

- **URL**: https://apify.com/leorochasantos/espn-scores.md
- **Developed by:** [Leonardo Santos](https://apify.com/leorochasantos) (community)
- **Categories:** Sports, Automation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.95 / 1,000 espn game rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Scores Scraper

Extract public ESPN scoreboards for any sport, league and day, or resolve
specific public espn.com game URLs into venue, city, TV-network and attendance
detail. Every row is flat, typed and null-safe for research, alerting,
spreadsheets and pipelines.

### Why this actor?

- Two buyer-shaped modes: a whole league day, or one game's summary.
- One flat row per game: teams, scores, status, start time, venue and TV.
- Hard local result limits keep delivery and spend bounded.
- Invalid slugs, dates and URLs, empty league days and blocked requests are
  free error rows.
- Public JSON surface only: no login, no cookies, no challenge bypass, no media.

### Input

```json
{"mode":"scores","sport":"baseball","league":"mlb","dates":"20260916","maxResults":100}
```

For detail mode, set `mode` to `detail` and provide `gameUrls` (or `eventIds`
with `sport`/`league`).

| Input | Meaning |
|---|---|
| `mode` | `scores` (a league scoreboard) or `detail` (specific games). |
| `sport` | ESPN sport slug: `baseball`, `basketball`, `football`, `hockey`, `soccer`… |
| `league` | ESPN league slug: `mlb`, `nba`, `nfl`, `nhl`, `wnba`, `college-football`, `eng.1`… |
| `dates` | Scoreboard day as `YYYYMMDD`. Empty means the league's current card. |
| `maxResults` | Hard local cap on delivered rows and charges in `scores` mode. |
| `gameUrls` | Public espn.com game URLs for `detail` mode; deduplicated, capped at 50. |
| `eventIds` | Numeric ESPN event ids for `detail` mode; needs `sport` and `league`. |
| `proxyConfiguration` | Proxy for ESPN requests; datacenter is the default. |

### Output

```json
{"mode":"scores","input":"baseball/mlb 20260916","event_id":"401816960","sport":"baseball","league":"mlb","league_name":"Major League Baseball","title":"Chicago White Sox at Cleveland Guardians","short_title":"CHW @ CLE","start_time":"2026-09-16T17:00Z","status":"finished","status_detail":"Final","home":"Cleveland Guardians","home_abbr":"CLE","home_score":6,"home_winner":true,"away":"Chicago White Sox","away_abbr":"CHW","away_score":3,"away_winner":false,"venue":"Progressive Field","city":"Cleveland","broadcasts":[],"attendance":null,"url":"https://www.espn.com/mlb/game/_/gameId/401816960/white-sox-guardians","error":null,"scraped_at":"2026-09-17T11:52:31.104Z"}
```

| Field | Meaning |
|---|---|
| `mode` | Which mode produced the row: `scores` or `detail`. |
| `input` | `sport/league [YYYYMMDD]` in `scores` mode, or the game URL / event id in `detail` mode. |
| `event_id` | ESPN event id, also carried in the game URL. |
| `sport` | ESPN sport slug, e.g. `baseball`. |
| `league` | ESPN league slug, e.g. `mlb`. |
| `league_name` | Human league name, e.g. `Major League Baseball`. |
| `title` | Game title, `"away at home"`. |
| `short_title` | Abbreviated title, e.g. `"CHW @ CLE"`. |
| `start_time` | Scheduled start time, ISO 8601, exactly as published. |
| `status` | `scheduled`, `live` or `finished`. |
| `status_detail` | Upstream status line, e.g. `Final`, `Final/10`, `7:10 PM EDT`. |
| `home` | Home team name. |
| `home_abbr` | Home team abbreviation. |
| `home_score` | Home score; null before play starts. |
| `home_winner` | Whether the home team won; null before a result. |
| `away` | Away team name. |
| `away_abbr` | Away team abbreviation. |
| `away_score` | Away score; null before play starts. |
| `away_winner` | Whether the away team won; null before a result. |
| `venue` | Venue name. |
| `city` | Venue city. |
| `broadcasts` | TV networks listing the game; `detail` mode only, always an array. |
| `attendance` | Announced attendance; `detail` mode only. |
| `url` | Canonical public game URL on espn.com. |
| `error` | Free per-input error; null on game rows. |
| `scraped_at` | Extraction timestamp. |

### Pricing

Pay per event, and **the platform usage is on us** — the price you see is the price you pay, with no compute bill on top.

| Event | Price | What one charge buys |
|---|---|---|
| ESPN game row | **$0.003** | One delivered public ESPN game row. An invalid sport/league/date/game URL, a scoreboard day with no games, and an upstream block, 5xx or timeout are free error rows and are never charged. |
| Actor Start | **$0.002** | One run, whatever it returns. |

Higher Apify subscription tiers pay less on every event (Silver −20%, Gold −35%).

### Proxy

Requests use the Apify proxy configured in `proxyConfiguration`. The validated
default is datacenter. This actor does not bypass challenges, log in, or read
private pages.

### Use cases

- Track a league day with scores, statuses and start times.
- Alert on a followed game's result or status change.
- Build a dated results dataset for a sport.
- Find the venue, city and TV networks of a specific game.

### FAQ

**Does this need an ESPN account?** No. Only the public ESPN site JSON surface
is read.

**Do scheduled games have scores?** Scores are `0` before play starts, and
`home_winner` / `away_winner` are null until there is a result.

**Why are `broadcasts` and `attendance` empty in `scores` mode?** They come from
the per-game summary, which only `detail` mode fetches; the keys are always
present.

***

*This Actor is an independent tool and is not affiliated with ESPN.*

# Actor input Schema

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

scores: list one public ESPN scoreboard (sport + league, optional date). detail: resolve public espn.com game URLs (or event ids) into venue, city, TV networks and attendance.

## `sport` (type: `string`):

ESPN sport slug, e.g. baseball, basketball, football, hockey, soccer.

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

ESPN league slug, e.g. mlb, nba, nfl, nhl, wnba, college-football, eng.1.

## `dates` (type: `string`):

Which scoreboard day to read, e.g. 20260917. Leave empty for ESPN's own current card. One date per run.

## `maxResults` (type: `integer`):

Hard local limit on delivered game rows and charges in scores mode.

## `eventIds` (type: `array`):

Numeric ESPN event ids for detail mode (e.g. 401816960). Requires sport and league.

## `gameUrls` (type: `array`):

Public espn.com game URLs for detail mode; deduplicated and capped at 50. Known league paths carry their own sport/league.

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

Proxy for ESPN requests. Datacenter is the validated default.

## Actor input object example

```json
{
  "mode": "scores",
  "sport": "baseball",
  "league": "mlb",
  "maxResults": 100,
  "eventIds": [
    "401816960"
  ],
  "gameUrls": [
    "https://www.espn.com/mlb/game/_/gameId/401816960/white-sox-guardians"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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 = {
    "sport": "baseball",
    "league": "mlb",
    "eventIds": [
        "401816960"
    ],
    "gameUrls": [
        "https://www.espn.com/mlb/game/_/gameId/401816960/white-sox-guardians"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("leorochasantos/espn-scores").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 = {
    "sport": "baseball",
    "league": "mlb",
    "eventIds": ["401816960"],
    "gameUrls": ["https://www.espn.com/mlb/game/_/gameId/401816960/white-sox-guardians"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("leorochasantos/espn-scores").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 '{
  "sport": "baseball",
  "league": "mlb",
  "eventIds": [
    "401816960"
  ],
  "gameUrls": [
    "https://www.espn.com/mlb/game/_/gameId/401816960/white-sox-guardians"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call leorochasantos/espn-scores --silent --output-dataset

```

## MCP server setup

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

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/bghZckOEmJmzyCDMi/builds/mbVT3p6aN6IME3jU8/openapi.json
