# ESPN Scraper (`datahamster/espn-scraper`) Actor

ESPN scraper: scores and schedules for NFL, NBA, MLB, NHL, college and 20+ soccer leagues by date or date range, with score by period, betting line and box score totals, plus standings, teams, rosters and news. Monitor mode sends live score changes.

- **URL**: https://apify.com/datahamster/espn-scraper.md
- **Developed by:** [Viktor Dubnytskiy](https://apify.com/datahamster) (community)
- **Categories:** News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Scraper

Get ESPN scores and schedules, standings, teams, rosters and news headlines for the NFL, NBA, MLB, NHL, college sports and more than 20 soccer leagues, as flat rows you can open in a spreadsheet. Pick one or more leagues and a date or a date range. Each game row has the score by quarter, period or half, the status, venue, broadcasters and the betting line, and on request the box score team totals.

**Try it:** the prefilled example returns 20 rows in about 4 seconds and costs about $0.020. Results cost $1 per 1,000.

Coverage limits: ESPN serves its own data only, so leagues ESPN does not cover are not available. Box score totals are team totals, not player lines. News is ESPN's latest 50 headlines per league, with no article text. Rosters carry name, jersey number and position only.

### Why this one

- **Standings, teams, rosters and news in the same actor.** The most-used ESPN actor in the Store reads the scoreboard only: its input has no standings, roster or news option. Here `dataType` switches between scores, standings, teams, rosters and news.
- **Box score totals and the betting line on each game.** Turn on `includeBoxScore` and every started or finished game gets `homeStats` and `awayStats` (total yards, possession, field goal %, shots on goal and so on) plus the DraftKings spread, total and moneylines. The scoreboard-only leader has no odds or box score fields. A test run on 05.11.2026 read NFL and Premier League games for 1-2 November with `includeBoxScore`: all 15 games came back with team totals and the closing line, in 5 seconds.
- **Score by period.** `homePeriodScores` and `awayPeriodScores` give the score of each quarter, period or inning, e.g. `[10, 6, 7, 13]`.
- **Live score alerts.** Monitor mode returns only new games and games whose status or score changed since the last run. Schedule it every 15-30 minutes on game days (or every 5 minutes during the games you follow) and send the changes to a webhook or Telegram.
- **Any ESPN league.** Besides the 23 short codes, any league ESPN has works as `sport/slug`, e.g. `soccer/bra.1` for Brazil's Serie A.
- **Several leagues and a date range in one run**, with one row per game and the same columns for every sport.

### What you get

One row per game (prefilled run, 05.11.2026, games not started yet):

| league | date (UTC) | game | status | line | total |
|---|---|---|---|---|---|
| nba | 2026-11-06 02:00 | ORL @ PHX | 11/5 - 9:00 PM EST | PHX -1.5 | 222.5 |
| nhl | 2026-11-06 00:00 | UTA @ MTL | 11/5 - 7:00 PM EST | UTAH -122 | 6.5 |
| nfl | 2026-11-06 01:15 | JAX @ BAL | 11/5 - 8:15 PM EST | JAX -10 | 39.5 |
| nfl | 2026-11-08 14:30 | CIN VS ATL | 11/8 - 9:30 AM EST | CIN -3 | 52.5 |
| nfl | 2026-11-08 18:00 | DAL @ IND | 11/8 - 1:00 PM EST | DAL -5.5 | 51.5 |
| nfl | 2026-11-08 18:00 | NYJ @ KC | 11/8 - 1:00 PM EST | KC -10 | 47.5 |

A finished game with `includeBoxScore` (shortened):

```json
{
  "dataType": "game",
  "league": "nfl",
  "gameId": "401873026",
  "date": "2026-11-01T18:00Z",
  "title": "Baltimore Ravens at Buffalo Bills",
  "state": "post",
  "statusDetail": "Final",
  "homeTeam": "Buffalo Bills",
  "homeTeamAbbr": "BUF",
  "homeScore": 36,
  "homeRecord": "6-1",
  "homePeriodScores": [
    10,
    6,
    7,
    13
  ],
  "awayTeam": "Baltimore Ravens",
  "awayTeamAbbr": "BAL",
  "awayScore": 10,
  "awayPeriodScores": [
    7,
    0,
    3,
    0
  ],
  "venue": "Highmark Stadium",
  "attendance": 60642,
  "broadcasts": [
    "CBS"
  ],
  "oddsProvider": "DraftKings",
  "oddsDetails": "BUF -3",
  "spread": -3,
  "overUnder": 54.5,
  "homeMoneyline": -162,
  "awayMoneyline": 136,
  "homeStats": {
    "firstDowns": "24",
    "thirdDownEff": "4-14",
    "totalYards": "426",
    "netPassingYards": "280",
    "rushingYards": "146",
    "totalPenaltiesYards": "10-87",
    "turnovers": "2",
    "possessionTime": "37:36"
  },
  "awayStats": {
    "firstDowns": "10",
    "thirdDownEff": "3-13",
    "totalYards": "144",
    "netPassingYards": "68",
    "rushingYards": "76",
    "totalPenaltiesYards": "7-38",
    "turnovers": "3",
    "possessionTime": "22:24"
  },
  "url": "https://www.espn.com/nfl/game/_/gameId/401873026/ravens-bills"
}
```

Every row has `dataType` (`game`, `standing`, `team`, `player` or `news`), `league`, `sport`, `title`, `summary`, `url` and `scrapedAt`, so one table view works across types.

**Game fields:** `gameId`, `date` (UTC start), `title`, `shortName`, `season`, `seasonType`, `week`, `state` (`pre`, `in`, `post`), `status`, `statusDetail`, `completed`, `period`, `clock`, `homeTeam`, `homeTeamAbbr`, `homeTeamId`, `homeScore`, `homeWinner`, `homeRecord`, `homePeriodScores`, the same for `away`, `venue`, `venueCity`, `attendance`, `neutralSite`, `broadcasts`, `oddsProvider`, `oddsDetails`, `spread`, `overUnder`, `homeMoneyline`, `awayMoneyline`, and with `includeBoxScore` `homeStats`, `awayStats` and `boxScoreStatus` (`ok`, `missing` when ESPN has no box score, `refused` when the summary request was refused). Scores are empty for games that have not started.

**Standing fields:** `team`, `teamAbbr`, `teamId`, `group` (conference or league), `rank`, `seed`, `wins`, `losses`, `ties`, `otLosses`, `winPercent`, `gamesBehind`, `points`, `pointsFor`, `pointsAgainst`, `pointDifferential`, `streak`, `gamesPlayed`, `record`, `season`, and `stats` with every column ESPN shows (home, road, last ten and so on).

**Team fields:** `teamId`, `team`, `teamAbbr`, `location`, `nickname`, `color`, `alternateColor`, `logo`, `isActive`.

**Player fields:** `playerId`, `player`, `jersey`, `position`, `positionName`, `team`, `teamAbbr`, `teamId`. No age, birth date, birthplace, height, weight, college, contract or injury details.

**News fields:** `articleId`, `headline`, `description`, `published`, `lastModified`, `articleType`, `premium`, `byline`, `teams`, `categories`.

### Input

| Field | Meaning | Default |
|---|---|---|
| `dataType` | `scores`, `standings`, `teams`, `rosters` or `news` | `scores` |
| `leagues` | League codes or `sport/slug` | `nba`, `nhl`, `nfl` |
| `dateFrom` | First day: `YYYY-MM-DD`, `today`, `yesterday`, `tomorrow`, `today-7`, `today+3`. Empty = ESPN's current scoreboard | empty |
| `dateTo` | Last day, same formats. Empty = same as `dateFrom` | empty |
| `teams` | Only these teams (abbreviation, name or id) | all |
| `gameStatus` | `pre`, `in`, `post` | all |
| `includeBoxScore` | Add box score team totals and the betting line | false |
| `maxItems` | Stop after this many rows | 100 |
| `mode` | `scrape`, or `monitor` for new and changed rows only | `scrape` |

Examples:

- Last week's NBA and NHL results with box scores: `{"leagues": ["nba", "nhl"], "dateFrom": "today-7", "dateTo": "yesterday", "gameStatus": ["post"], "includeBoxScore": true}`
- A team's season schedule: `{"leagues": ["nfl"], "dateFrom": "2026-09-01", "dateTo": "2027-01-10", "teams": ["KC"]}`
- Premier League table: `{"dataType": "standings", "leagues": ["epl"]}`
- Lakers roster: `{"dataType": "rosters", "leagues": ["nba"], "teams": ["LAL"]}`

### Monitor mode

Set `mode` to `monitor` and schedule the task with `dateFrom` = `today`. Every 15-30 minutes is enough for most uses (every 15 minutes is 96 runs and $0.48 a day in `monitor-check` events); every 5 minutes is 288 runs and $1.44 a day, so keep that for game hours. The first run records what it reads and returns nothing (no result charges). Every later run returns only:

- games that are new, and games whose `state` (scheduled, in progress, final) or score changed (`changeType: "changed"`),
- standings rows whose wins, losses, ties or rank changed,
- news headlines that were not there before,
- roster entries that are new or changed jersey or position.

A relative date such as `today` keeps working day after day: each new day's games arrive as new rows. Each monitor run costs one `monitor-check` event ($0.005) plus $0.001 per returned row. If a monitor run is killed, the next run of the same task may end as `overlapping_run` until the killed run's timeout passes; use a new `monitorStateId` to start over.

### Pricing

| Event | Price |
|---|---|
| result | $0.001 per row ($1 per 1,000) |
| monitor-check | $0.005 per monitor run |
| change | $0.001 per new or changed row in monitor mode |

Apify platform usage is billed to you separately. The actor runs without a proxy and needs little memory: 512 MB is plenty (a run peaks well below that), so a 5-second run uses a fraction of a cent. A run that finds nothing pushes nothing and costs no result events.

### Limits

- ESPN's scoreboard serves one day per request (a range is read day by day), so a 366-day range of one league is 366 requests, about two minutes.
- College football defaults to FBS (`groups=80`) and college basketball to Division I (`groups=50`).
- Odds come from ESPN's feed (DraftKings at the time of writing). Finished games carry the closing line only with `includeBoxScore`.
- Box score totals exist for games that have started. Some smaller leagues have none; those rows are pushed without `homeStats` and `awayStats` and with `boxScoreStatus: "missing"`. If no summary at all could be read, the run log says so and the key-value store gets a `BOX_SCORE_WARNING` record.
- News is the latest 50 headlines ESPN lists per league, without article text.

### FAQ

**What does an empty date do?** It reads ESPN's current scoreboard, the same thing espn.com shows on the league's scores page: today's games, or the current week for the NFL and college football.

**Can I get a whole season?** Yes, as a date range of up to 366 days per run. Combine it with `teams` for one team's schedule and results.

**Is player data included?** Rosters give each player's name, jersey number and position. Personal details such as age, birth date or college are not collected.

### Changelog

- 0.1: first release. Scores and schedules by date or date range for several leagues per run, score by period, betting line, optional box score totals, standings, teams, rosters, news, monitor mode for new games, score changes and new headlines.

### Related actors

- [Yahoo Finance Quotes](https://apify.com/datahamster/yahoo-finance-quotes): quotes and price alerts, the same flat-row style.
- [Google News Feed](https://apify.com/datahamster/google-news-feed): keyword news alerts beyond ESPN.
- [Google Trends Scraper](https://apify.com/datahamster/google-trends-scraper): search interest for teams, players and events.

***

If this actor saved you time, a short review on its Store page helps other people find it. Found a bug or need a field? Open a ticket on the **Issues** tab.

# Actor input Schema

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

Stop after this many rows in total (you are charged only for pushed rows).

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

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## `dataType` (type: `string`):

Scores and schedules return one row per game. Standings return one row per team with wins, losses and the full stat line. Rosters return players' names, jersey numbers and positions. News returns ESPN's latest 50 headlines per league.

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

One or more league codes: nfl, ncaaf, cfl, ufl, nba, wnba, ncaab, ncaaw, mlb, nhl, mls, nwsl, epl, championship, laliga, seriea, bundesliga, ligue1, eredivisie, primeira, ligamx, ucl, uel. Any other ESPN league works as sport/slug, e.g. soccer/bra.1, soccer/arg.1, soccer/jpn.1, baseball/college-baseball.

## `dateFrom` (type: `string`):

First day to read: YYYY-MM-DD, today, yesterday, tomorrow, today-7 or today+3. Leave empty for ESPN's current scoreboard (today's games, or this week's games for the NFL). Days are US Eastern days, as on ESPN.

## `dateTo` (type: `string`):

Last day to read, same formats. Empty means the same day as Date from. One request per league and day, up to 366 days.

## `teams` (type: `array`):

Optional. Team abbreviations (BUF, LAL), names (Lakers, Arsenal) or ESPN team ids. Filters games, standings, teams and rosters.

## `gameStatus` (type: `array`):

Optional. Keep only scheduled (pre), in-progress (in) or final (post) games. Empty keeps all.

## `includeBoxScore` (type: `boolean`):

Scores only. For each started or finished game, also read the game summary and add homeStats and awayStats (team totals such as total yards, field goal %, possession, shots on goal) and the DraftKings line (spread, over/under, moneylines). One extra request per game.

## Actor input object example

```json
{
  "maxItems": 20,
  "mode": "scrape",
  "dataType": "scores",
  "leagues": [
    "nba",
    "nhl",
    "nfl"
  ],
  "dateFrom": "",
  "dateTo": "",
  "teams": [],
  "gameStatus": [],
  "includeBoxScore": false
}
```

# Actor output Schema

## `results` (type: `string`):

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# 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 = {
    "maxItems": 20,
    "dataType": "scores",
    "leagues": [
        "nba",
        "nhl",
        "nfl"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/espn-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 = {
    "maxItems": 20,
    "dataType": "scores",
    "leagues": [
        "nba",
        "nhl",
        "nfl",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("datahamster/espn-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 '{
  "maxItems": 20,
  "dataType": "scores",
  "leagues": [
    "nba",
    "nhl",
    "nfl"
  ]
}' |
apify call datahamster/espn-scraper --silent --output-dataset

```

## MCP server setup

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