# Sports Standings & Team Records API (NFL, NBA, MLB, NHL, EPL) (`ichigowa/sports-standings-api`) Actor

Current league standings and team records for NFL, NBA, MLB, NHL, EPL, WNBA and NCAAF as clean normalized JSON from ESPN's public API. One row per team: wins, losses, win %, games behind, playoff seed, points, streak. No API key needed. Unofficial, not affiliated with ESPN.

- **URL**: https://apify.com/ichigowa/sports-standings-api.md
- **Developed by:** [kyle herman](https://apify.com/ichigowa) (community)
- **Categories:** Sports, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / 1,000 standings rows

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

## Sports Standings & Team Records API (NFL, NBA, MLB, NHL, EPL)

Get **current league standings and team records as clean JSON** — no API key, no scraping HTML, no rate-limit headaches. This actor pulls standings from ESPN's public API and normalizes every team into one stable row: wins, losses, win percentage, games behind, playoff seed, points for/against, streak, and the full raw stat set.

Perfect if you searched for a **sports standings API**, **NFL standings API**, **NBA standings API**, or a **free ESPN standings API** alternative for your app, dashboard, model, or Discord bot.

### What it does

- Fetches live standings for one or more leagues in a single run
- Emits **one row per team**, grouped by conference/division group
- Flattens the most common stats to top-level keys and keeps **all** raw ESPN stats in a `stats` dict (so sport-specific stats like soccer `points`/`rank` are never lost)
- Runs in seconds; leagues are fetched concurrently with retries — one league failing never kills the run

### Supported leagues

| Code | League |
|------|--------|
| `nfl` | NFL (American football) |
| `nba` | NBA (basketball) |
| `mlb` | MLB (baseball) |
| `nhl` | NHL (hockey) |
| `epl` | English Premier League (soccer) |
| `wnba` | WNBA (basketball) |
| `ncaaf` | NCAA college football |

### Input

All fields optional — running with empty input `{}` fetches NFL, NBA, MLB and NHL.

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

### Output

One dataset row per team. Real example row (NFL):

```json
{
  "league": "nfl",
  "conference": "American Football Conference",
  "team_id": "2",
  "team": "Buffalo Bills",
  "abbreviation": "BUF",
  "wins": 11,
  "losses": 6,
  "ties": 0,
  "win_percent": 0.647,
  "games_behind": 0,
  "playoff_seed": 2,
  "points_for": 451,
  "points_against": 368,
  "point_differential": 83,
  "streak": 3,
  "stats": {
    "wins": 11,
    "losses": 6,
    "ties": 0,
    "winPercent": 0.647,
    "gamesBehind": 0,
    "playoffSeed": 2,
    "pointsFor": 451,
    "pointsAgainst": 368,
    "pointDifferential": 83,
    "differential": 83,
    "streak": 3,
    "divisionWins": 5,
    "divisionLosses": 1
  },
  "fetched_at": "2026-08-06T13:13:42Z"
}
```

Notes:

- Flattened keys (`wins`, `losses`, `win_percent`, `games_behind`, `playoff_seed`, `points_for`, `points_against`, `point_differential`, `streak`, `ties`) appear when the league provides them. Soccer leagues use different stat names (`points`, `rank`, `gamesPlayed`, ...) — always available in the `stats` dict.
- During the offseason ESPN reports zeroed stats; rows are still emitted for every team.
- `fetched_at` is the ISO 8601 UTC timestamp of the fetch.

### Pricing

Pay per result: you're charged a tiny fee **per team standings row** pushed to the dataset (e.g. a full NFL run = 32 rows). No subscriptions, no minimums.

### Use cases

- Standings widgets for sports sites and fantasy apps
- Betting/analytics models that need up-to-date team records
- Discord/Slack bots posting daily standings
- Data pipelines replacing fragile HTML scrapers

### Disclaimer

Unofficial; **not affiliated with or endorsed by ESPN**. Data comes from ESPN's publicly accessible API and may change without notice.

# Actor input Schema

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

League codes to fetch standings for. Supported: nfl, nba, mlb, nhl, epl (English Premier League), wnba, ncaaf (college football).

## Actor input object example

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

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("ichigowa/sports-standings-api").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",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ichigowa/sports-standings-api").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"
  ]
}' |
apify call ichigowa/sports-standings-api --silent --output-dataset

```

## MCP server setup

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

```

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/LPFu7gaF8QLrPCsL9/builds/BldpvCL6QYofFZ56y/openapi.json
