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

Extracts public ESPN teams, scoreboards, news, and standings links with explicit fail-closed access diagnostics and no API key.

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

## Pricing

from $2.99 / 1,000 sports records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Collect public ESPN team, game, news, and standings-link records for up to 19 supported leagues through ESPN's public HTTP endpoints. Each saved row is one source-backed record with league, sport, season, provenance, the exact endpoint used, and only the fields that apply to that record type. No ESPN account, API key, private endpoint, proxy, or browser is required.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/espn-scraper) and select **Try for free**, or open the **Input** tab.
2. Choose one or more league codes in `leagues`. Start with a single league while testing.
3. Set `maxItems` and the per-league team and game limits small for the first run.
4. Start the Actor, open the dataset, and export the records as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT`) to check the outcome and counts.

### Input

`leagues` is required and is prefilled with the default list. The remaining fields are optional, and the defaults below are ready to use. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `leagues` | string array | Required | `["nfl","nba","mlb","nhl","epl","laliga"]` | ESPN league codes to query, 1–20 unique values. Allowed: `nfl`, `nba`, `mlb`, `nhl`, `mls`, `epl`, `laliga`, `ucl`, `bundesliga`, `seriea`, `ligue1`, `ligamx`, `ncaaf`, `ncaam`, `ncaaw`, `wnba`, `f1`, `golf`, `atp`. |
| `maxItems` | integer | Optional | `150` | Maximum total team, game, news, and standings-link records saved across all selected leagues, 1–500. |
| `maxTeamsPerLeague` | integer | Optional | `8` | Maximum public team records retained per league, 1–20. |
| `maxGamesPerLeague` | integer | Optional | `10` | Maximum public scoreboard game records retained per league, 1–50. |
| `requestDelayMs` | integer | Optional | `300` | Polite delay between league request groups in milliseconds, 0–5,000. |

Default input:

```json
{
  "leagues": ["nfl", "nba", "mlb", "nhl", "epl", "laliga"],
  "maxItems": 150,
  "maxTeamsPerLeague": 8,
  "maxGamesPerLeague": 10,
  "requestDelayMs": 300
}
```

The Actor reads public ESPN team, scoreboard, news, and standings endpoints. It does not log in, call private endpoints, follow arbitrary URLs, or turn request failures into data rows.

### Output

The dataset contains one row per unique public record. A row contains the fields for its `recordType`; fields that do not apply to that type, or that ESPN does not publish, are omitted rather than filled with placeholder values. No diagnostic rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordType` | string | Always | `espn-team`, `espn-game`, `espn-news-article`, or `espn-standings-link`. |
| `sourceName` | string | Always | Human-readable source label; `ESPN public multi-sport API` in the saved run. |
| `sourceKind` | string | Always | Provenance marker; `public-espn-api` for live collection. |
| `sourceUrl` | string | Always | Exact public ESPN endpoint that supplied the record. |
| `league` | string | Always | ESPN league code, such as `mlb` or `nfl`. |
| `sport` | string | Always | ESPN sport path, such as `baseball` or `football`. |
| `season` | integer | Always | Season year reported by ESPN. |
| `teamId` | string | When published | ESPN team identifier. |
| `teamName` | string | When published | Team display name. |
| `teamAbbreviation` | string | When published | Team abbreviation, such as `ARI`. |
| `teamSlug` | string | When published | Team slug used in ESPN URLs. |
| `teamLocation` | string | When published | Team location or market. |
| `teamLogoUrl` | string | When published | Public team logo URL. |
| `recordSummary` | string | When published | Team record summary when the team payload exposes one. |
| `standingSummary` | string | When published | Team standing summary when the team payload exposes one. |
| `eventId` | string | When published | ESPN game identifier. |
| `eventName` | string | When published | Full game name, such as `Milwaukee Brewers at Tampa Bay Rays`. |
| `eventShortName` | string | When published | Short matchup label, such as `MIL @ TB`. |
| `eventDate` | string | When published | Scheduled or played game time in ISO UTC. |
| `homeTeam` | string | When published | Home team display name. |
| `awayTeam` | string | When published | Away team display name. |
| `homeScore` | number | When published | Home score as published; a scheduled game may be `0`. |
| `awayScore` | number | When published | Away score as published; a scheduled game may be `0`. |
| `eventStatus` | string | When published | ESPN game state, such as `Scheduled` or `Final`. |
| `eventUrl` | string | When published | Public ESPN game page URL. |
| `articleId` | string | When published | ESPN article or clip identifier. |
| `headline` | string | When published | News headline. |
| `articleDescription` | string | When published | News summary or description. |
| `articleUrl` | string | When published | Public ESPN article or clip URL. |
| `publishedAt` | string | When published | Article publication time in ISO UTC. |
| `imageUrl` | string | When published | Public article image URL. |
| `standingsUrl` | string | When published | Public ESPN standings page for the league. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |

The example below is a real saved game row from the 2026-10-25 run.

```json
{
  "recordType": "espn-game",
  "sourceName": "ESPN public multi-sport API",
  "sourceKind": "public-espn-api",
  "sourceUrl": "https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?limit=1000",
  "league": "mlb",
  "sport": "baseball",
  "season": 2026,
  "eventId": "401908044",
  "eventName": "Milwaukee Brewers at Tampa Bay Rays",
  "eventShortName": "MIL @ TB",
  "eventDate": "2026-10-27T00:00:00.000Z",
  "homeTeam": "Tampa Bay Rays",
  "awayTeam": "Milwaukee Brewers",
  "homeScore": 0,
  "awayScore": 0,
  "eventStatus": "Scheduled",
  "eventUrl": "https://www.espn.com/mlb/game/_/gameId/401908044/brewers-rays",
  "scrapedAt": "2026-10-25T20:50:58.924Z"
}
```

### Run summary

**Run summary** is stored separately from the dataset in the run's key-value store under `OUTPUT` and `OUTPUT_SUMMARY`.

| Field | Meaning |
| --- | --- |
| `source` | Source label used by the run. |
| `status` | Actor outcome: `SUCCEEDED` or `FAILED`. |
| `runStatus` | Canonical run status; matches `status`. |
| `dataStatus` | Completeness of saved rows: `COMPLETE`, `PARTIAL`, `NO_RESULTS`, or `FAILED`. |
| `requestedItemCount` | Requested record limit used for the run. |
| `itemCount` | Records saved to the dataset. |
| `datasetItems` | Dataset item count reported by the Actor. |
| `diagnosticItems` | Diagnostic dataset rows; always `0` because diagnostics stay in metadata. |
| `uniqueIdentityCount` | Unique record identities retained. |
| `diagnosticCount` | Operational issues recorded for the run. |
| `duplicateCount` | Duplicate records removed. |
| `attemptedEndpoints` | Public ESPN endpoints attempted. |
| `counts` | Record count by `recordType`. |
| `leagues` | League codes used for the run. |
| `fixtureMode` | Whether bundled fixtures were used instead of live endpoints. |
| `finishedAt` | Time the summary was written, in ISO UTC. |

| Status | Data status | Meaning |
| --- | --- | --- |
| `SUCCEEDED` | `COMPLETE` | All eligible public records were saved without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | Some records were saved, but a later request or parse problem prevented a complete run. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | Requests completed cleanly but no matching public records were returned. |
| `FAILED` | `FAILED` | A fatal error occurred before any usable record was saved. |

Example `OUTPUT` from the saved 2026-10-25 run:

```json
{
  "source": "ESPN public multi-sport API",
  "status": "SUCCEEDED",
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "requestedItemCount": 10,
  "itemCount": 10,
  "datasetItems": 10,
  "diagnosticItems": 0,
  "uniqueIdentityCount": 10,
  "diagnosticCount": 0,
  "duplicateCount": 0,
  "attemptedEndpoints": 3,
  "counts": {
    "espn-team": 2,
    "espn-game": 1,
    "espn-news-article": 6,
    "espn-standings-link": 1
  },
  "leagues": ["mlb"],
  "fixtureMode": false,
  "finishedAt": "2026-10-25T20:50:59.005Z"
}
```

### Coverage and limitations

The saved run queried MLB with `maxItems: 10`, two teams per league, and two games per league, producing two teams, one scheduled game, six news articles, and one standings link. Each record type uses different ESPN endpoints: teams come from a team feed, games from a scoreboard feed, news from a league news feed, and standings links from a public standings page. Record-type-specific fields are therefore absent from other types by design.

The Actor does not crawl all of ESPN, follow article bodies, or guarantee that every league exposes every record type. Postseason and off-season feeds may return empty scoreboards, and some ESPN properties do not publish teams or news for every code. Responses blocked by access controls, paywalls, rate limits, or timeouts are recorded in the run summary instead of being converted into rows. `season` is the year ESPN reports, which may differ from the calendar year used by a league's season naming.

### Usage and support

This is an HTTP-only Actor, so cost is driven by Apify compute and the number of league requests rather than a per-record fee. Keep `leagues`, `maxItems`, and the per-league limits small while testing, then scale after checking the dataset and `OUTPUT`. See the Actor's Pricing tab for current account rates.

Use the [Actor Issues page](https://apify.com/w3crawler/espn-scraper/issues) to report a problem. Include the run ID, the input used, and the run summary; do not include tokens, cookies, or private data. This Actor is not affiliated with, endorsed by, or sponsored by ESPN. Use it only for public data and in accordance with ESPN's terms, robots guidance, and applicable law. Public pages can contain personal information; use the output only for lawful purposes.

# Actor input Schema

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

Supported ESPN codes to query through approved public HTTPS endpoints.

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

Maximum mixed team, game, news, standings-link, and diagnostic records written to the dataset.

## `maxTeamsPerLeague` (type: `integer`):

Maximum public team records retained per league.

## `maxGamesPerLeague` (type: `integer`):

Maximum public scoreboard records retained per league.

## `requestDelayMs` (type: `integer`):

Polite sequential delay between public ESPN league request groups.

## Actor input object example

```json
{
  "leagues": [
    "nfl",
    "nba",
    "mlb",
    "nhl",
    "epl",
    "laliga"
  ],
  "maxItems": 150,
  "maxTeamsPerLeague": 8,
  "maxGamesPerLeague": 10,
  "requestDelayMs": 300
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing normalized source-backed public ESPN records only; operational issues are kept in logs and the run summary.

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

Run status and counters stored by the Actor.

# 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": [
        "nfl",
        "nba",
        "mlb",
        "nhl",
        "epl",
        "laliga"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/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 = { "leagues": [
        "nfl",
        "nba",
        "mlb",
        "nhl",
        "epl",
        "laliga",
    ] }

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

```

## MCP server setup

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