# ESPN Teams & Standings Scraper (`ninhothedev/espn-teams-scraper`) Actor

$0.5/1K 🔥 Fast ESPN teams scraper! Team info, records, logos & colors across major leagues. No key. JSON, CSV, Excel or API in seconds. Pull teams & standings for fan apps, analytics & directories ⚡

- **URL**: https://apify.com/ninhothedev/espn-teams-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** News, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Teams & Standings Scraper

Scrape complete **team directories, records, standings, logos and colors** from ESPN across every major league — NFL, NBA, MLB, NHL, college and international soccer — with **no API key** and **no login**. Fast, datacenter-proxy friendly, and cheap.

Perfect for building **sports data pipelines, fantasy and fan apps, betting/analytics dashboards, and team directories**.

### What it does

Given a list of leagues (in `sport/league` format), the actor returns one clean record per team including:

- Team ID, display name, short name and location
- Abbreviation (e.g. `LAL`, `NYY`, `GB`)
- Primary and alternate team colors (hex)
- Official team logo URL
- ESPN clubhouse URL
- Active flag
- **Optional**: win/loss record summary and standing summary (`includeRecord`)

### Example input

```json
{
  "mode": "teams",
  "leagues": ["football/nfl", "basketball/nba"],
  "includeRecord": false,
  "maxItems": 200
}
```

### Example output

```json
{
  "league": "basketball/nba",
  "team_id": "13",
  "display_name": "Los Angeles Lakers",
  "name": "Lakers",
  "location": "Los Angeles",
  "abbreviation": "LAL",
  "color": "552583",
  "alternate_color": "fdb927",
  "logo": "https://a.espncdn.com/i/teamlogos/nba/500/lal.png",
  "url": "https://www.espn.com/nba/team/_/name/lal/los-angeles-lakers",
  "is_active": true,
  "record": "47-35",
  "standing_summary": "3rd in Pacific Division",
  "source": "espn",
  "scraped_at": "2026-07-20T12:00:00+00:00"
}
```

### Supported leagues (examples)

| Sport | `sport/league` |
|-------|----------------|
| NFL | `football/nfl` |
| College Football | `football/college-football` |
| NBA | `basketball/nba` |
| WNBA | `basketball/wnba` |
| Men's College Basketball | `basketball/mens-college-basketball` |
| MLB | `baseball/mlb` |
| NHL | `hockey/nhl` |
| English Premier League | `soccer/eng.1` |
| La Liga | `soccer/esp.1` |
| Bundesliga | `soccer/ger.1` |

Any league ESPN exposes works — just pass the matching `sport/league` slug.

### Input parameters

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | select | `teams` | What to scrape. `teams` lists every team per league. |
| `leagues` | array | `["football/nfl","basketball/nba"]` | Leagues in `sport/league` format. |
| `includeRecord` | boolean | `false` | Also fetch each team's record & standing (one extra request per team). |
| `maxItems` | integer | `200` | Max team records to output (max 2000). |

### Pricing

Roughly **$0.50 per 1,000 team records** on the pay-per-result model — one of the cheapest ways to keep a full sports team database in sync.

### Use cases

- **Sports data** feeds and ETL pipelines
- **Fantasy & fan apps** needing logos, colors and team metadata
- **Analytics & betting** dashboards keyed on team IDs and records
- **Team directories** and content sites

### Related actors

- [ESPN Scores Scraper](https://apify.com/ninhothedev/espn-scores-scraper)
- [ESPN News Scraper](https://apify.com/ninhothedev/espn-news-scraper)
- [Sports Scraper](https://apify.com/ninhothedev/sports-scraper)
- [OpenSky Flights Scraper](https://apify.com/ninhothedev/opensky-flights-scraper)

### Keywords

espn scraper, sports data api, nfl teams, nba teams, mlb teams, nhl teams, team logos, team colors, standings scraper, sports directory, soccer teams, fantasy sports data, sports analytics

### Disclaimer

This actor collects only publicly available data from ESPN's public site endpoints. Use responsibly and in accordance with ESPN's terms and applicable law.

# Actor input Schema

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

What to scrape. Currently 'teams' lists every team in each selected league (with optional records and standings).

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

Leagues to scrape, each in 'sport/league' format. Examples: football/nfl, basketball/nba, baseball/mlb, hockey/nhl, soccer/eng.1 (English Premier League).

## `includeRecord` (type: `boolean`):

If enabled, fetches each team's detail page to add win/loss record and standing summary. Slower (one extra request per team) but richer data.

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

Maximum number of team records to output across all leagues.

## Actor input object example

```json
{
  "mode": "teams",
  "leagues": [
    "football/nfl",
    "basketball/nba"
  ],
  "includeRecord": false,
  "maxItems": 200
}
```

# 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": [
        "football/nfl",
        "basketball/nba"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/espn-teams-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": [
        "football/nfl",
        "basketball/nba",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/espn-teams-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": [
    "football/nfl",
    "basketball/nba"
  ]
}' |
apify call ninhothedev/espn-teams-scraper --silent --output-dataset

```

## MCP server setup

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