# ESPN Scraper & API: Scores, Box Scores, Standings, Schedules (`localwire/espn-sports`) Actor

ESPN scraper and sports data API: live scores, results, schedules, box scores, standings and news for the NFL, NBA, MLB, NHL, WNBA, college sports, MLS, the Premier League and other soccer leagues, as JSON from ESPN's public endpoints. Monitor mode for new results. $0.001 per game.

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

## Pricing

from $1.00 / 1,000 games

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/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 Sports Data: Scores, Box Scores, Standings & Schedules API

ESPN scores, results, schedules, box scores, standings and news for the NFL, NBA, MLB, NHL, WNBA, college football and basketball, MLS, the Premier League and other soccer leagues, as JSON from ESPN's public endpoints. **$0.001 per game, $0.003 with a box score, $0.0005 per standings row or headline**, plus $0.0001 per run.

One Actor has five modes: a scoreboard by date, box scores for given games, standings, team schedules and news. A **monitor mode** returns only games that have finished since the last run, so an hourly schedule becomes a results feed. It reads the same JSON espn.com loads: no browser, no proxy, no HTML parsing.

### What you get

Every record has a `type`: `game`, `standing` or `article`. The dataset has **Games**, **Standings** and **News** views.

#### Game

```json
{
  "type": "game",
  "league": "nfl",
  "leagueName": "NFL",
  "sport": "football",
  "gameId": "401873037",
  "name": "Jacksonville Jaguars at Baltimore Ravens",
  "shortName": "JAX @ BAL",
  "startTime": "2026-11-06T01:15Z",
  "seasonYear": 2026,
  "seasonType": "regular-season",
  "week": 9,
  "status": { "state": "post", "completed": true, "description": "Final", "detail": "Final", "period": 4, "clock": "0:00" },
  "venue": { "name": "M&T Bank Stadium", "city": "Baltimore", "state": "MD", "country": "USA" },
  "attendance": 70007,
  "neutralSite": false,
  "broadcasts": ["Prime Video"],
  "home": { "id": "33", "name": "Baltimore Ravens", "shortName": "Ravens", "abbreviation": "BAL", "score": 10, "winner": false, "record": "4-5", "linescores": [3, 0, 0, 7], "logo": "https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/bal.png" },
  "away": { "id": "30", "name": "Jacksonville Jaguars", "abbreviation": "JAX", "score": 24, "winner": true, "record": "6-3", "linescores": [7, 10, 0, 7] },
  "result": "away",
  "gameUrl": "https://www.espn.com/nfl/game/_/gameId/401873037/jaguars-ravens"
}
```

With **Add box scores** (`includeDetails`), or in `gameDetails` mode, each played game also has a `details` object:

- `teamStats`: per team, every stat ESPN shows, as displayed (for example `"1st Downs"`, `"Total Yards"`, `"FG"`, `"Rebounds"`, `"Corner Kicks"`).
- `playerStats`: one line per player per category, with labelled stats (`{"MIN": "21", "PTS": "2", "REB": "4", "AST": "8"}`), and whether the player started.
- `scoringPlays`: period, clock, team, play type, description and running score, for sports where ESPN lists scoring plays (American football, for example).
- `keyEvents` and `lineups` (soccer): goals, cards, penalties and substitutions with the minute; starters, substitutes, positions, shirt numbers and formation.
- `leaders`: the top performer per stat category, where ESPN publishes them.

#### Standing

One row per team per conference, division or table:

```json
{
  "type": "standing",
  "league": "premier-league",
  "leagueName": "English Premier League",
  "sport": "soccer",
  "season": "2026-27 English Premier League",
  "group": "2026-27 English Premier League",
  "position": 1,
  "teamId": "359",
  "team": "Arsenal",
  "abbreviation": "ARS",
  "wins": 8,
  "losses": 1,
  "ties": 0,
  "gamesPlayed": 9,
  "points": 24,
  "winPercent": null,
  "gamesBehind": null,
  "streak": null,
  "record": "8-0-1",
  "note": "Champions League",
  "stats": { "gamesPlayed": "9", "wins": "8", "ties": "0", "losses": "1", "points": "24", "pointsFor": "14", "pointsAgainst": "5", "pointDifferential": "+9", "rank": "1", "overall": "8-0-1" },
  "scrapedAt": "2026-11-07T00:00:00.000Z"
}
```

`stats` carries every statistic ESPN publishes for the row under its ESPN name, so the columns differ by sport: the NBA rows have `winPercent`, `gamesBehind` and `streak`; soccer rows have `points`, `ties` (draws), goals for and against (`pointsFor`, `pointsAgainst`) and a qualification `note`.

#### Article

A news headline: `articleId`, `articleType`, `headline`, `description`, `byline`, `published`, `lastModified`, `url`, `imageUrl`, `premium`, and the `teams` and `athletes` the story is tagged with. The article body is not included.

The run's key-value store also gets an `OUTPUT` record: records per league and per event, any problems, the number of requests made and why the run stopped.

### Quick start

The form opens on the scoreboard for the NBA, NFL and MLB, so at least one league is in season all year. Press **Start** and you get yesterday's and today's games in those leagues, typically 15 to 40 records for 2 to 4 cents:

```json
{
  "mode": "scoreboard",
  "leagues": ["nba", "nfl", "mlb"]
}
```

More examples:

```json
{ "mode": "scoreboard", "leagues": ["premier-league"], "dateFrom": "2026-11-07", "dateTo": "2026-11-09", "includeDetails": true }
```

```json
{ "mode": "standings", "leagues": ["nba", "premier-league"] }
```

```json
{ "mode": "teamSchedules", "leagues": ["nba"], "teams": ["LAL", "Boston Celtics"] }
```

```json
{ "mode": "gameDetails", "gameIds": ["https://www.espn.com/nba/game/_/gameId/401909092/warriors-lakers", "401873037"], "leagues": ["nfl"] }
```

```json
{ "mode": "news", "leagues": ["nfl"], "newsLimit": 20 }
```

A results feed (schedule it hourly):

```json
{ "mode": "scoreboard", "leagues": ["nfl", "nba", "nhl"], "daysBack": 1, "monitorMode": true }
```

### Modes

| Mode | Returns | Charged as |
|---|---|---|
| `scoreboard` | Games for a date range: teams, scores, period scores, status, venue, attendance, TV | `game`, or `game-details` with box scores |
| `gameDetails` | The full box score for given game ids or ESPN game URLs | `game-details` |
| `standings` | One row per team per conference, division or table | `standing-row` |
| `teamSchedules` | Every game of the given teams in a season | `game`, or `game-details` with box scores |
| `news` | The latest headlines per league | `article` |

### What each sport returns

#### American football: NFL and college football

Scoreboard games carry the week number, season type (preseason, regular season, postseason), quarter-by-quarter `linescores`, team records, venue, attendance and broadcasters. Box scores add team stats (first downs, third-down efficiency, total plays and yards, and the rest of ESPN's list), player lines by category (passing, rushing and the other categories ESPN lists, with stats such as `C/ATT`, `YDS`, `TD`, `INT`), every scoring play with its type and the running score, and stat leaders. The college football scoreboard covers all FBS games, not only ranked teams.

#### Basketball: NBA, WNBA and college basketball

Games with quarter (or half) scores, records and broadcasters. Box scores add team totals (field goals, three-pointers, free throws, rebounds, assists, steals, blocks) and a stat line for every player with a starter flag: minutes, points, shooting, rebounds, assists, turnovers, steals, blocks, fouls and plus/minus. Players who did not play are flagged with `didNotPlay`; the reason is never copied. Standings come by conference with wins, losses, win percentage, games behind and streak. College scoreboards cover all Division I games.

#### Baseball: MLB

Games with `linescores` per inning as ESPN reports them, team records, venue and broadcasters. Box scores use the same structure as the other sports: team stats and player lines grouped by ESPN's categories, under the stat names ESPN shows. Standings come grouped as ESPN groups them.

#### Ice hockey: NHL

Games with period `linescores` and team records. Box scores use the same structure: team stats, player lines grouped by ESPN's categories and, where ESPN lists them, scoring plays. Standings rows carry points alongside wins and losses. Other hockey leagues ESPN covers work through `customLeagues`, for example `hockey/mens-college-hockey`.

#### Soccer: Premier League, La Liga, Bundesliga, Serie A, Ligue 1, MLS, Champions League and more

Matches with scores, status, venue and attendance. With box scores you also get `lineups` (starters and substitutes with position, shirt number, formation and substitution flags) and `keyEvents` (goals, cards, penalties and substitutions with the minute and ESPN's description), plus team stats such as fouls, cards, offsides, corner kicks and saves. Soccer box scores have no per-player stat lines. Tables have position, played, wins, draws (`ties`), losses, points and ESPN's qualification note ("Champions League", "Relegation").

Built in: MLS, English Premier League, English Championship, La Liga, Bundesliga, Serie A, Ligue 1, Eredivisie, Scottish Premiership, Liga MX, UEFA Champions League and UEFA Europa League. Any other competition ESPN covers works through `customLeagues` as `soccer/<code>`, for example `soccer/por.1` (Portugal), `soccer/bra.1` (Brazil) or `soccer/arg.1` (Argentina).

### Input reference

| Field | Type | Default | What it does |
|---|---|---|---|
| `mode` | string | `scoreboard` | `scoreboard`, `gameDetails`, `standings`, `teamSchedules` or `news`. |
| `leagues` | string\[] | `nba` when no league is given | `nfl`, `college-football`, `nba`, `wnba`, `mens-college-basketball`, `womens-college-basketball`, `mlb`, `nhl`, `mls`, `premier-league`, `championship`, `la-liga`, `bundesliga`, `serie-a`, `ligue-1`, `eredivisie`, `scottish-premiership`, `liga-mx`, `champions-league`, `europa-league`. |
| `customLeagues` | string\[] | | Any other ESPN league as `sport/league`: `soccer/por.1`, `hockey/mens-college-hockey`. |
| `daysBack` | integer | 1 | Scoreboard: days before today (UTC) to include, 0 to 62. Ignored when `dateFrom` is set. |
| `daysAhead` | integer | 0 | Scoreboard: days after today, for upcoming fixtures. Ignored when `dateTo` is set. |
| `dateFrom` / `dateTo` | string | | Scoreboard: an explicit range (`2026-11-01`). At most 62 days per run. |
| `statusFilter` | string | `all` | `all`, `finished`, `live` or `scheduled`. |
| `includeDetails` | boolean | false | Scoreboard and team schedules: add each played game's box score. Scheduled games come without details. |
| `gameIds` | string\[] | | Game details mode: ESPN game ids or game URLs. For a bare id, the first league in `leagues` is used. |
| `teams` | string\[] | | Team schedules mode: abbreviations, names or ESPN ids (`LAL`, `Arsenal`, `13`). |
| `season` | integer | current | Team schedules and standings: the season year as ESPN numbers it (2027 for the 2026-27 NBA season). |
| `newsLimit` | integer | 25 | News mode: headlines per league (1 to 100). |
| `monitorMode` | boolean | false | Scoreboard and team schedules: return only finished games not returned before. |
| `monitorStoreName` | string | `espn-sports-monitor` | The key-value store that remembers returned games. Use one name per feed. |
| `maxResults` | integer | 1000 | Stop after this many records. |

### Use cases

- **Results feeds.** An hourly run in monitor mode delivers every game once, as soon as it finishes.
- **Analytics and models.** Box scores with team stats and every player's stat line, in one consistent structure across sports.
- **Fantasy and pick'em tools.** Player lines, schedules and standings without maintaining a scraper per league.
- **Fixtures and TV listings.** Upcoming games with venue and broadcaster, for apps, newsletters and bots.
- **League tables.** Standings for dashboards and widgets.
- **Team trackers.** Every game of a team this season or any past season.
- **AI agents.** "What were last night's NBA scores?" or "show the Premier League table" answered from live data.

### Monitor mode

Turn on `monitorMode` and schedule the Actor. Each run returns only finished games it has not returned before (per league), so an hourly schedule gives you a results feed with no duplicates. A game cut off by your spending limit is delivered on the next run. Use different `monitorStoreName` values for separate feeds.

### Pricing

Pay per result. No subscription.

| Event | Price | Per 1,000 |
|---|---|---|
| Game (scoreboard or schedule) | $0.001 | $1.00 |
| Game with box score | $0.003 | $3.00 |
| Standings row | $0.0005 | $0.50 |
| News headline | $0.0005 | $0.50 |
| Run start | $0.0001 | |

| Run | Records | Cost |
|---|---|---|
| An NBA night, about 10 games | 10 games | about **$0.01** |
| The same night with box scores | 10 games with details | about **$0.03** |
| NBA and Premier League standings | 50 rows | **$0.025** |
| A team's 82-game NBA schedule | 82 games | **$0.08** |
| An hourly three-league results monitor, about 25 finished games a day | 24 runs, 25 games | $0.0024 + $0.025 = about **$0.03 a day** |

To cap spending, set `maxResults` or a maximum cost per run in the run options (`maxTotalChargeUsd` in the API). The Actor stops cleanly at the limit.

### Use it from the API

```bash
curl -X POST "https://api.apify.com/v2/acts/localwire~espn-sports/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "content-type: application/json" \
  -d '{"mode": "scoreboard", "leagues": ["nba"], "daysBack": 0}'
```

With the official clients:

```js
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("localwire/espn-sports").call({ mode: "standings", leagues: ["premier-league"] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("localwire/espn-sports").call(run_input={"mode": "scoreboard", "leagues": ["nfl"], "daysBack": 7})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

### Use it from an AI agent (MCP)

Apify hosts an MCP server at `https://mcp.apify.com`. Add it to an MCP client (Claude, ChatGPT, Cursor, VS Code and others) and sign in with your Apify account, or send your API token as an `Authorization: Bearer` header. To expose just this Actor as a tool:

```
https://mcp.apify.com?tools=localwire/espn-sports
```

Then ask "what were last night's NBA scores?" or "show the Premier League table". Notes for agents: with no input the Actor returns yesterday's and today's NBA games; always pass `leagues`. `gameDetails` needs `gameIds` and `teamSchedules` needs `teams`. Box scores are large, so ask for them only for the games you need.

### Integrations

Apify connects runs to Make, n8n, Zapier, LangChain, webhooks and other tools, and datasets export as JSON, CSV, Excel, XML or RSS. Typical setups: a monitor-mode run that posts final scores to Slack or Discord through a webhook; nightly box scores into a database; standings into Google Sheets.

### FAQ

#### Does ESPN have a public API?

ESPN has no official, documented public API. Its website and apps load data from public JSON endpoints that need no login, and this Actor reads those and returns one stable schema. Because the endpoints are undocumented, ESPN can change them.

#### How do I get NFL or NBA box scores as JSON?

Run `scoreboard` mode with `includeDetails: true` for a date range, or `gameDetails` mode with the game ids or ESPN game URLs. Each game's `details` has team stats, player lines, scoring plays and leaders.

#### How do I get live scores?

Run `scoreboard` mode with `daysBack: 0` and, if you only want games in progress, `statusFilter: "live"`. Each run is a snapshot at the moment it runs; schedule it as often as you need. This is not a streaming feed.

#### Where do I find an ESPN game id?

It is the number in the game's URL: `https://www.espn.com/nba/game/_/gameId/401909092/warriors-lakers` has id `401909092`. You can paste the whole URL into `gameIds`. Every scoreboard record also has `gameId`.

#### Which leagues are supported?

The 20 listed under `leagues` are built in. Any other league on ESPN works as `sport/league` in `customLeagues`, using the path ESPN's own data URLs use.

#### Can I get historical seasons?

Scoreboards accept any past dates, up to 62 days per run; split longer ranges across runs. `teamSchedules` and `standings` accept a `season` year.

#### Does it include betting odds or injury reports?

No. Odds, lines, win probabilities, injury reports and the reasons players sat out are left out on purpose.

#### How do I export scores to CSV, Excel or Google Sheets?

Open the run's dataset and choose CSV or Excel, or request `https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=csv&view=games`. For Google Sheets use Apify's integration or a Make or Zapier scenario.

#### How much does a full season cost?

An NBA regular season is 1,230 games: about $1.23 for scores, or $3.69 with box scores. An NFL regular season is 272 games: about $0.27, or $0.82 with box scores.

### Limitations

- **Unofficial source.** ESPN's public site endpoints are not a documented API and can change.
- **Blocks are not worked around.** If ESPN refuses a request (an access-denied page, or rate limiting that persists after one wait), the run stops with a clear message and keeps what it already has.
- **Not included, on purpose:** betting odds and lines, win probabilities, injury reports and the reasons players sat out, and full article text.
- **No play-by-play.** Box scores carry scoring plays and, for soccer, key events; the full play-by-play log is not returned.
- **Snapshots, not streams.** A run reports the state at the time it runs.
- **Dates** are ESPN's game days. At most 62 days per run.
- **Stat names** are ESPN's own and differ by sport; they are returned as displayed (strings).
- **Custom leagues** depend on what ESPN publishes for them: some have no standings or no box scores.

### Disclaimer

This Actor is not affiliated with, endorsed by or sponsored by ESPN or The Walt Disney Company. ESPN is a trademark of ESPN, Inc. Scores and statistics are facts; check ESPN's terms of use for how you may reuse the data, especially commercially.

### More from this developer

- [Flashscore results and fixtures](https://apify.com/localwire/flashscore-sports)
- [UK & EU public tenders](https://apify.com/localwire/uk-public-tenders)
- [Google Trends Trending Now](https://apify.com/localwire/google-trends-trending-now)
- [Hacker News](https://apify.com/localwire/hacker-news)
- [Career Site Jobs API](https://apify.com/localwire/ats-jobs)
- [Workday Jobs](https://apify.com/localwire/workday-jobs)
- [Reed Jobs](https://apify.com/localwire/reed-jobs)
- [Wellfound Jobs](https://apify.com/localwire/wellfound-jobs)
- [App Store Reviews, Details & Top Charts](https://apify.com/localwire/app-store-reviews)
- [Eventbrite Events](https://apify.com/localwire/eventbrite-events)
- [Meetup Events & Groups](https://apify.com/localwire/meetup-events)
- [Gumtree Listings](https://apify.com/localwire/gumtree-listings)
- [Telegram Channels](https://apify.com/localwire/telegram-channels)

# Actor input Schema

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

scoreboard: games by date (scores, status, venue, TV). gameDetails: full box scores for the game ids or URLs in gameIds (required). standings: league tables. teamSchedules: every game of the teams in teams (required) this season. news: latest headlines. scoreboard if left out.

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

One or more leagues by key, e.g. nba, nfl, mlb, nhl, premier-league, champions-league. If no league is given here or in customLeagues, nba is used.

## `customLeagues` (type: `array`):

Any other league ESPN covers, as sport/league from an ESPN API path, e.g. soccer/por.1 (Portugal), soccer/bra.1 (Brazil), hockey/mens-college-hockey.

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

Scoreboard: include this many days before today (UTC). Ignored when 'From date' is set.

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

Scoreboard: include this many days after today, for upcoming fixtures. Ignored when 'To date' is set.

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

Scoreboard: first day, e.g. 2026-11-01. Up to 62 days per run.

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

Scoreboard: last day (inclusive).

## `statusFilter` (type: `string`):

Keep all games, or only finished, live or scheduled ones.

## `includeDetails` (type: `boolean`):

Scoreboard and team schedules: fetch each played game's box score (team stats, player stat lines, scoring plays, soccer lineups and key events). Charged as 'game with box score'. Scheduled games are returned without details.

## `gameIds` (type: `array`):

Game details mode: ESPN game ids (e.g. 401873037) or game URLs (https://www.espn.com/nba/game/\_/gameId/401909092/...). For soccer ids, choose the league above.

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

Team schedules mode: team abbreviations, names or ESPN ids within the chosen league(s), e.g. LAL, Arsenal, 13.

## `season` (type: `integer`):

Team schedules and standings: season year as ESPN numbers it (e.g. 2027 for the 2026-27 NBA season). Leave empty for the current season.

## `newsLimit` (type: `integer`):

News mode: how many headlines to return per league.

## `monitorMode` (type: `boolean`):

Scoreboard and team schedules: remember which finished games were returned and return only games that finished since the last run. Schedule the Actor (e.g. hourly) for a results feed.

## `monitorStoreName` (type: `string`):

Name of the key-value store that remembers returned games. Use a different name for each separate monitor.

## `maxResults` (type: `integer`):

Stop after this many records (1,000 if left out). A game costs $0.001, a game with box score $0.003, a standings row or headline $0.0005.

## Actor input object example

```json
{
  "mode": "scoreboard",
  "leagues": [
    "nba",
    "nfl",
    "mlb"
  ],
  "daysBack": 1,
  "daysAhead": 0,
  "statusFilter": "all",
  "includeDetails": false,
  "newsLimit": 25,
  "monitorMode": false,
  "monitorStoreName": "espn-sports-monitor",
  "maxResults": 1000
}
```

# Actor output Schema

## `games` (type: `string`):

One row per game: teams, score, status and venue.

## `standings` (type: `string`):

One row per team per conference, division or table.

## `news` (type: `string`):

Headlines with links.

## `allResults` (type: `string`):

Every record in the run's default dataset, all fields.

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

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

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

```

## MCP server setup

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

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/KSil6KkjI9eMAa6jZ/builds/hjIKGhWKDW0Yh81aI/openapi.json
