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

Scrape ESPN public API with scoreboards, standings, teams, news, and game details for NFL, NBA, MLB, NHL, MLS, Premier League, La Liga, F1, UFC, PGA Golf, ATP Tennis, and more. No API key required.

- **URL**: https://apify.com/crawlerbros/espn-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## ESPN Scraper

Scrape live scores, standings, team info, news, and game details from ESPN's public API — covering NFL, NBA, MLB, NHL, MLS, Premier League, La Liga, Bundesliga, ATP Tennis, PGA Golf, UFC, Formula 1, and more.

**No API key, no login, no proxy required.** Works out-of-the-box on the Apify free plan.

### What you can scrape

| Mode | Description |
|------|-------------|
| **Scoreboard** | Live and recent game scores with teams, venue, broadcast info |
| **Standings** | League/conference rankings with wins, losses, win percentage |
| **Teams** | Full team roster for any league with logos and records |
| **Team Detail** | In-depth info for a single team (venue, colors, links) |
| **News** | Latest headlines with descriptions, images, and author |
| **Game Detail** | Full boxscore context — leaders, recap, venue, broadcast |

### Supported Sports & Leagues

| Sport | League | Slug |
|-------|--------|------|
| Football | NFL | `football` / `nfl` |
| Football | College Football | `football` / `college-football` |
| Basketball | NBA | `basketball` / `nba` |
| Basketball | College Basketball | `basketball` / `mens-college-basketball` |
| Baseball | MLB | `baseball` / `mlb` |
| Hockey | NHL | `hockey` / `nhl` |
| Soccer | MLS | `soccer` / `usa.1` |
| Soccer | Premier League | `soccer` / `eng.1` |
| Soccer | La Liga | `soccer` / `esp.1` |
| Soccer | Bundesliga | `soccer` / `ger.1` |
| Tennis | ATP | `tennis` / `atp` |
| Golf | PGA Tour | `golf` / `pga` |
| MMA | UFC | `mma` / `ufc` |
| Racing | Formula 1 | `racing` / `f1` |

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `mode` | select | Yes | What to fetch: `scoreboard`, `standings`, `teams`, `teamDetail`, `news`, `gameDetail` |
| `sport` | select | No | Sport category (e.g. `basketball`). Auto-corrected based on league. |
| `league` | select | No | League slug (e.g. `nba`). Default: `nba`. |
| `teamId` | string | For `teamDetail` | ESPN numeric team ID (get from `teams` mode output) |
| `eventId` | string | For `gameDetail` | ESPN numeric event ID (get from `scoreboard` mode output) |
| `maxItems` | integer | No | Max records to emit (1–500, default 20) |

#### Example inputs

**NBA Scoreboard (today's games):**
```json
{
  "mode": "scoreboard",
  "sport": "basketball",
  "league": "nba",
  "maxItems": 20
}
````

**NFL Standings:**

```json
{
  "mode": "standings",
  "sport": "football",
  "league": "nfl",
  "maxItems": 50
}
```

**Premier League Teams:**

```json
{
  "mode": "teams",
  "sport": "soccer",
  "league": "eng.1",
  "maxItems": 30
}
```

**NBA Game Detail (requires an eventId from scoreboard):**

```json
{
  "mode": "gameDetail",
  "sport": "basketball",
  "league": "nba",
  "eventId": "401873199"
}
```

### Output

All records include `mode`, `sport`, `league`, and `scrapedAt` fields.

#### Scoreboard record

```json
{
  "mode": "scoreboard",
  "sport": "basketball",
  "league": "nba",
  "eventId": "401873199",
  "name": "Oklahoma City Thunder at San Antonio Spurs",
  "date": "2026-05-23T00:30Z",
  "homeTeam": "San Antonio Spurs",
  "homeScore": "98",
  "awayTeam": "Oklahoma City Thunder",
  "awayScore": "110",
  "status": "Final",
  "venue": "Frost Bank Center, San Antonio, TX",
  "broadcast": "TNT",
  "scrapedAt": "2026-05-23T01:00:00+00:00"
}
```

#### Standings record

```json
{
  "mode": "standings",
  "sport": "basketball",
  "league": "nba",
  "team": "Boston Celtics",
  "teamId": "2",
  "abbreviation": "BOS",
  "conference": "Eastern Conference",
  "wins": "64",
  "losses": "18",
  "winPct": ".780",
  "rank": "1",
  "scrapedAt": "2026-05-23T01:00:00+00:00"
}
```

#### Teams record

```json
{
  "mode": "teams",
  "sport": "basketball",
  "league": "nba",
  "teamId": "2",
  "name": "Boston Celtics",
  "abbreviation": "BOS",
  "location": "Boston",
  "color": "007A33",
  "logoUrl": "https://a.espncdn.com/i/teamlogos/nba/500/bos.png",
  "wins": 64,
  "losses": 18,
  "scrapedAt": "2026-05-23T01:00:00+00:00"
}
```

#### News record

```json
{
  "mode": "news",
  "sport": "basketball",
  "league": "nba",
  "headline": "Celtics clinch Eastern Conference title",
  "description": "Boston defeats Miami in six games.",
  "publishDate": "2026-05-22T23:00:00Z",
  "url": "https://www.espn.com/nba/story/_/id/12345/celtics-clinch",
  "imageUrl": "https://a.espncdn.com/photo/2026/0522/celtics.jpg",
  "author": "Adrian Wojnarowski",
  "category": "NBA",
  "scrapedAt": "2026-05-23T01:00:00+00:00"
}
```

#### Game Detail record

```json
{
  "mode": "gameDetail",
  "sport": "basketball",
  "league": "nba",
  "eventId": "401873199",
  "name": "OKC at SA",
  "date": "2026-05-23T00:30Z",
  "homeTeam": "San Antonio Spurs",
  "homeScore": "98",
  "awayTeam": "Oklahoma City Thunder",
  "awayScore": "110",
  "status": "Final",
  "venue": "Frost Bank Center, San Antonio, TX",
  "broadcast": "TNT, ESPN+",
  "leaders": [
    {
      "team": "Oklahoma City Thunder",
      "category": "Points",
      "athlete": "Shai Gilgeous-Alexander",
      "value": "38"
    }
  ],
  "recap": "Thunder take 3-1 series lead with impressive road win.",
  "scrapedAt": "2026-05-23T01:00:00+00:00"
}
```

### Data Source

Data is sourced from **ESPN's public REST API** (`site.api.espn.com` and `site.web.api.espn.com`). These endpoints are publicly accessible, require no authentication, and return full JSON responses from Apify datacenter IPs.

This actor was built as a replacement for SofascoreScraper which was blocked at the API level from datacenter IPs.

### Tips

- Use `mode=teams` first to get valid `teamId` values for `mode=teamDetail`
- Use `mode=scoreboard` to get valid `eventId` values for `mode=gameDetail`
- The `sport` field is auto-corrected if it doesn't match the selected league
- Scoreboard returns today's scheduled or completed games; off-season will return 0 events
- Standings data may be limited or unavailable during off-season periods

### FAQs

**Q: Does this require an API key?**
A: No. ESPN's public API is freely accessible with no authentication.

**Q: How often is the data updated?**
A: ESPN updates scores in near real-time during games. News and standings reflect the latest available data at scrape time.

**Q: Can I get historical game data?**
A: The scoreboard endpoint shows current or recent games. For historical data, use `mode=gameDetail` with a specific `eventId`.

**Q: Why is the scoreboard empty?**
A: If there are no games today (off-season or no scheduled games), the scoreboard will return 0 records. This is expected behavior.

**Q: How do I find a team's ID?**
A: Run `mode=teams` for the relevant sport/league. The `teamId` field in each result is the ESPN numeric ID.

**Q: Is there a rate limit?**
A: ESPN's public API is generous but the actor includes automatic retry logic with exponential backoff for 429/5xx responses.

# Actor input Schema

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

What data to fetch from ESPN.

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

Sport category (must match the league you choose).

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

League slug. Must be compatible with the selected Sport.

## `teamId` (type: `string`):

ESPN numeric team ID. Required for mode=teamDetail. Find it from mode=teams output (teamId field).

## `eventId` (type: `string`):

ESPN numeric event ID. Required for mode=gameDetail. Find it from mode=scoreboard output (eventId field).

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

Maximum number of records to emit. Applies to scoreboard, teams, news, and standings modes.

## Actor input object example

```json
{
  "mode": "news",
  "sport": "basketball",
  "league": "nba",
  "maxItems": 20
}
```

# Actor output Schema

## `espnData` (type: `string`):

Dataset containing all scraped ESPN records (scores, standings, teams, news, or game details).

# 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 = {
    "mode": "news",
    "sport": "basketball",
    "league": "nba",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/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 = {
    "mode": "news",
    "sport": "basketball",
    "league": "nba",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/espn-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "news",
  "sport": "basketball",
  "league": "nba",
  "maxItems": 20
}' |
apify call crawlerbros/espn-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/espn-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ESPN Scraper",
        "description": "Scrape ESPN public API with scoreboards, standings, teams, news, and game details for NFL, NBA, MLB, NHL, MLS, Premier League, La Liga, F1, UFC, PGA Golf, ATP Tennis, and more. No API key required.",
        "version": "1.0",
        "x-build-id": "1ifgPP61kcD7WePNu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~espn-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-espn-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~espn-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-espn-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~espn-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-espn-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "scoreboard",
                            "standings",
                            "teams",
                            "teamDetail",
                            "news",
                            "gameDetail"
                        ],
                        "type": "string",
                        "description": "What data to fetch from ESPN.",
                        "default": "news"
                    },
                    "sport": {
                        "title": "Sport",
                        "enum": [
                            "football",
                            "basketball",
                            "baseball",
                            "hockey",
                            "soccer",
                            "tennis",
                            "golf",
                            "mma",
                            "racing"
                        ],
                        "type": "string",
                        "description": "Sport category (must match the league you choose).",
                        "default": "basketball"
                    },
                    "league": {
                        "title": "League",
                        "enum": [
                            "nfl",
                            "college-football",
                            "nba",
                            "mens-college-basketball",
                            "mlb",
                            "nhl",
                            "usa.1",
                            "eng.1",
                            "esp.1",
                            "ger.1",
                            "atp",
                            "pga",
                            "ufc",
                            "f1"
                        ],
                        "type": "string",
                        "description": "League slug. Must be compatible with the selected Sport.",
                        "default": "nba"
                    },
                    "teamId": {
                        "title": "Team ID (mode=teamDetail)",
                        "type": "string",
                        "description": "ESPN numeric team ID. Required for mode=teamDetail. Find it from mode=teams output (teamId field)."
                    },
                    "eventId": {
                        "title": "Event ID (mode=gameDetail)",
                        "type": "string",
                        "description": "ESPN numeric event ID. Required for mode=gameDetail. Find it from mode=scoreboard output (eventId field)."
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of records to emit. Applies to scoreboard, teams, news, and standings modes.",
                        "default": 20
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
