# Sports Results & Fixtures Collector (ESPN) (`datapilot/sports-results-fixtures-collector-espn`) Actor

Scrape live scores, completed results, and upcoming fixtures across major sports leagues, including the Premier League, La Liga, Bundesliga, UEFA Champions League, NBA, NFL, MLB, NHL, and more. Filter matches by league, team, date range, and match status, with  times Dataset in JSON format.

- **URL**: https://apify.com/datapilot/sports-results-fixtures-collector-espn.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (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.00 / 1,000 scraped match results

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

⚽ **Sports Results & Fixtures Collector (ESPN)** is a powerful Apify Actor designed to collect match results, live scores, and upcoming fixtures across major soccer, basketball, American football, baseball, and hockey leagues using ESPN's public scoreboard data. This tool provides **Sports Results & Fixtures Collector (ESPN)** intelligence including teams, scores, match status, kickoff time, and a link to each match page. Whether you're building a sports dashboard, a results archive, or a fixtures calendar, the Sports Results & Fixtures Collector (ESPN) delivers structured data efficiently.

With 16 built-in leagues, support for custom ESPN league paths, a configurable date window, team filtering, parallel requests, and reliable Apify Dataset delivery, this **Sports Results & Fixtures Collector (ESPN)** actor gives you one clean, date-sorted list of matches across every league you choose. It focuses on key signals including score, status, and match date, making **Sports Results & Fixtures Collector (ESPN)** a practical tool for sports data collection.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **Multi-League Collection** – Collects matches from several leagues in one run. This is the core of **Sports Results & Fixtures Collector (ESPN)**.
- **16 Built-In Leagues** – Premier League, La Liga, Bundesliga, Serie A, Ligue 1, UEFA Champions League, UEFA Europa League, MLS, FIFA World Cup, NBA, WNBA, NCAA Men's Basketball, NFL, NCAA Football, MLB, and NHL.
- **Custom League Paths** – Add any other ESPN league with a `sport/league` value such as `soccer/eng.2`.
- **Flexible Date Window** – Choose how many days back and ahead to include around today.
- **Result Type Filter** – Show `results`, `live` matches, `fixtures`, or `all`.
- **Team Filter** – Keep only matches where a team name contains your text.
- **Local Time Field** – Includes a formatted local date and time alongside ESPN's ISO date.
- **Match Links** – Includes a link to the match summary when ESPN provides one.
- **Duplicate Removal** – Removes repeated matches within a league.
- **Parallel Requests** – Fetches several league-and-day combinations at once (6 workers).
- **Apify Proxy Support** – Optional Apify Proxy, with a direct-connection retry on HTTP 403 or 429.
- **Detailed Logging** – Logs request counts and filtering results for every **Sports Results & Fixtures Collector (ESPN)** run.

***

### 📊 Data Source

#### **ESPN Public Scoreboard API**

- **Source**: `https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/scoreboard`
- **Access Method**: Browser-impersonated HTTP GET via `curl_cffi` (Chrome 124 fingerprint), parsing the JSON response
- **Coverage**: The built-in leagues below, or any league path ESPN supports on this endpoint
- **Data**: Teams, score, status, match date, notes, and match links
- **Access**: No login or API key used. This is ESPN's public site API, not an officially documented developer API.
- **Update Frequency**: Reflects ESPN's data at time of run

**Built-in league keys:**

| Key | League |
|-----|--------|
| `epl` | Premier League |
| `laliga` | La Liga |
| `bundesliga` | Bundesliga |
| `seriea` | Serie A |
| `ligue1` | Ligue 1 |
| `ucl` | UEFA Champions League |
| `uel` | UEFA Europa League |
| `mls` | MLS |
| `worldcup` | FIFA World Cup |
| `nba` | NBA |
| `wnba` | WNBA |
| `ncaab` | NCAA Men's Basketball |
| `nfl` | NFL |
| `cfb` | NCAA Football |
| `mlb` | MLB |
| `nhl` | NHL |

***

### ⚙️ How It Works

The Sports Results & Fixtures Collector (ESPN) accepts a list of leagues and a date window. It requests ESPN's scoreboard once for every league and day combination, removes duplicate matches, converts each event into a clean record, applies your team and result-type filters, sorts by date, and pushes everything to the Apify Dataset as one batch.

**Key Processing Steps:**

1. **Input Parsing** – Read `leagues`, `teamFilter`, `daysBack`, `daysAhead`, and `show`
2. **League Resolution** – Match league keys (or `all`, or `sport/league` paths) to ESPN endpoints
3. **Proxy Setup** – Configure Apify Proxy if enabled, with automatic direct fallback
4. **Date Window** – Build the list of days from `daysBack` days before today to `daysAhead` days after
5. **Parallel Fetch** – Request one scoreboard per league and day, 6 at a time
6. **Normalization** – Build one record per match and remove duplicates
7. **Filtering** – Apply the team filter and the `show` filter
8. **Sorting** – Sort matches by date, earliest first
9. **Dataset Push** – Push all **Sports Results & Fixtures Collector (ESPN)** records at once

***

### 📥 Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `leagues` | array | `["epl", "laliga", "nba"]` | League keys, `all`, or custom `sport/league` paths. Entries may also be separated by commas or spaces. |
| `teamFilter` | string | `""` (no filter) | Keep only matches whose teams text contains this value (case-insensitive). Values like `all`, `none`, or `any` mean no filter. |
| `daysBack` | integer | `3` | Number of days before today to include. |
| `daysAhead` | integer | `4` | Number of days after today to include. |
| `show` | string | `"all"` | `results` (finished matches with a score), `live`, `fixtures` (not started), or `all`. |
| `proxyConfiguration` | object | `{"useApifyProxy": true}` | Apify Proxy configuration. |

**Example Input:**

```json
{
  "leagues": ["epl", "laliga", "nba"],
  "daysBack": 3,
  "daysAhead": 4,
  "show": "all"
}
```

**Recent Results for One Team:**

```json
{
  "leagues": ["epl", "ucl"],
  "teamFilter": "Arsenal",
  "daysBack": 14,
  "daysAhead": 0,
  "show": "results"
}
```

**Upcoming Fixtures, Including a Custom League:**

```json
{
  "leagues": ["nfl", "soccer/eng.2"],
  "daysBack": 0,
  "daysAhead": 7,
  "show": "fixtures"
}
```

***

### 📤 Output

The Actor pushes **Sports Results & Fixtures Collector (ESPN)** records with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `event` | string | League name, optional note, and match status, for example `Premier League [Final]` |
| `score` | string | `home-away` score for live and finished matches, otherwise empty |
| `teams` | string | `Home vs Away` |
| `date` | string | ESPN's ISO 8601 start time |
| `local_date` | string | Start time formatted as `YYYY-MM-DD HH:MM (UTC±hh:mm)` in the timezone of the machine running the Actor |
| `link` | string | Match summary link, or the first link ESPN provides, or empty |

**Example Record:**

```json
{
  "event": "Premier League [Full Time]",
  "score": "2-1",
  "teams": "Arsenal vs Chelsea",
  "date": "2026-10-25T16:30Z",
  "local_date": "2026-10-25 16:30 (UTC+00:00)",
  "link": "https://www.espn.com/soccer/match/_/gameId/123456"
}
```

***

### 🧰 Technical Stack

- **HTTP Client:** `curl_cffi` with Chrome 124 TLS fingerprint impersonation
- **Source:** ESPN public scoreboard JSON API
- **Concurrency:** `ThreadPoolExecutor` with 6 workers, combined with `asyncio`
- **Proxy:** Apify Proxy, optional via `useApifyProxy`, with direct fallback on HTTP 403 or 429
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

- **event**: What the match belongs to (league, note) and its current status
- **teams**: The home and away teams
- **score**: The score for live or finished matches
- **date / local_date**: When the match starts or started
- **link**: Where to find more match detail on ESPN

***

### 🎯 Use Cases

- **Sports Dashboards** – Power scoreboards and fixtures widgets
- **Results Archives** – Collect finished-match results on a schedule
- **Fixtures Calendars** – Build upcoming-match calendars for chosen leagues or teams
- **Team Tracking** – Follow one team across leagues and competitions
- **Alerts & Bots** – Feed chat bots and newsletters with fresh results
- **Sports Analytics Prototyping** – Gather structured match data for analysis

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "leagues": ["epl", "nba"],
  "daysBack": 3,
  "daysAhead": 4,
  "show": "all"
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Connect through Apify Proxy if enabled
- Request ESPN's scoreboard for each league and day
- Apply your filters and sort by date
- Push all results to the Dataset

#### **3. Monitor Progress**

Console shows:

```
🛡️ Apify Proxy connected.
🔎 Fetching schedule: 2 league(s) across 8 day(s) (16 requests)...
Raw matches fetched across all days: 74
🎉 Successfully pushed 74 match records to dataset!
Done!
```

#### **4. View & Download Results**

- **Results Tab**: All match records, sorted by date
- **Export**: JSON, CSV, Excel, or HTML
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

Live scores only:

```json
{
  "leagues": ["nba", "nhl"],
  "daysBack": 0,
  "daysAhead": 0,
  "show": "live"
}
```

All built-in leagues for the next week:

```json
{
  "leagues": ["all"],
  "daysBack": 0,
  "daysAhead": 7,
  "show": "fixtures"
}
```

Direct connection without proxy:

```json
{
  "leagues": ["epl"],
  "proxyConfiguration": { "useApifyProxy": false }
}
```

***

### 📈 Performance

#### **Processing Speed**

- One request per league per day, so the number of requests is leagues × days (for example 3 leagues × 8 days = 24 requests)
- Requests run 6 at a time
- Each request is tried up to 2 times

#### **Resource Usage**

- Memory: Low, since no browser instance is launched
- Network: Lightweight JSON requests
- Proxy: Optional Apify Proxy with direct fallback on failure

***

### ⚠️ Important Notes

#### **Legal & Compliance**

- **Unofficial Endpoint**: The Actor uses ESPN's public site API, which is not officially documented for third-party use. Check ESPN's terms of use before using the data, especially for commercial purposes.
- **Public Data Only**: Retrieves only data ESPN publishes publicly
- **Legal**: Not legal advice

#### **Data Quality**

- **Silent Request Failures**: If a request for a league and day fails after retries, it returns no matches without an error message, so a run can finish with missing days or leagues. Check the request count and results if data looks incomplete.
- **Request Volume**: Large date windows with many leagues create many requests (for example `all` leagues over a month). Keep the window as small as you need.
- **Team Filter**: The filter matches text in the `teams` field only, so use the team name as ESPN spells it.
- **Result Filter**: `results` returns finished matches that have a score and excludes postponed, cancelled, suspended, abandoned, and delayed matches.
- **Local Time**: `local_date` uses the timezone of the machine running the Actor, which is typically UTC on Apify. Use `date` for exact, timezone-safe times.
- **Custom Leagues**: Custom `sport/league` paths must be valid ESPN paths. Entries that match neither a built-in key nor contain a `/` are ignored, and the run stops with an error message if no valid league remains.
- **Freshness**: Live scores reflect ESPN at the moment of the run

#### **Best Practices**

- Use specific league keys instead of `all` when you only need a few competitions
- Use `show: "live"` with `daysBack: 0` and `daysAhead: 0` for frequent live-score runs
- Use `show: "results"` on a daily schedule for results archives
- Verify important results on ESPN before publishing

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate research, dashboards, and personal projects
- Respect ESPN's terms of service
- Use data responsibly and in compliance with applicable laws

**Disclaimer:**
Sports Results & Fixtures Collector (ESPN) is provided as-is for research and informational purposes. It is not affiliated with or endorsed by ESPN. Users are responsible for compliance with all applicable laws and the data source's terms. This is not legal advice.

***

### ⚖️ Sports Results & Fixtures Collector (ESPN) Excellence

This Actor is optimized for **Sports Results & Fixtures Collector (ESPN)** use with:

- ✅ 16 built-in leagues plus custom league paths
- ✅ Results, live, and fixtures filters
- ✅ Team filter and flexible date window
- ✅ Parallel requests with proxy fallback
- ✅ Clean, date-sorted records
- ✅ Production-ready code

# Actor input Schema

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

Select leagues to collect matches from. Supports short codes (epl, laliga, nba, ucl) or custom paths (soccer/ger.2).

## `teamFilter` (type: `string`):

Filter matches involving this specific team (e.g. 'Arsenal', 'Lakers'). Leave empty to harvest all teams.

## `daysBack` (type: `integer`):

How many days in the past to pull completed results.

## `daysAhead` (type: `integer`):

How many days in the future to pull scheduled fixtures.

## `show` (type: `string`):

Filter by match status.

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

Apify Proxy configuration.

## Actor input object example

```json
{
  "leagues": [
    "epl",
    "laliga",
    "ucl",
    "nba"
  ],
  "teamFilter": "",
  "daysBack": 3,
  "daysAhead": 4,
  "show": "all",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `crawlResults` (type: `string`):

No description

## `matchesOverview` (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 = {
    "leagues": [
        "epl",
        "laliga",
        "ucl",
        "nba"
    ],
    "teamFilter": "",
    "daysBack": 3,
    "daysAhead": 4
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/sports-results-fixtures-collector-espn").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": [
        "epl",
        "laliga",
        "ucl",
        "nba",
    ],
    "teamFilter": "",
    "daysBack": 3,
    "daysAhead": 4,
}

# Run the Actor and wait for it to finish
run = client.actor("datapilot/sports-results-fixtures-collector-espn").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": [
    "epl",
    "laliga",
    "ucl",
    "nba"
  ],
  "teamFilter": "",
  "daysBack": 3,
  "daysAhead": 4
}' |
apify call datapilot/sports-results-fixtures-collector-espn --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/sports-results-fixtures-collector-espn"
        }
    }
}
```

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/xgmc9PAPPxSaAWsAO/builds/RrN19szMbqmddwMS2/openapi.json
