# Sleeper Fantasy Sports Scraper (`crawlerbros/sleeper-fantasy-scraper`) Actor

Scrape Sleeper (sleeper.app) fantasy football & basketball data - NFL/NBA players, league info, rosters, members, drafts, draft picks, user profiles, and trending waiver-wire adds/drops. Public JSON API, no login required.

- **URL**: https://apify.com/crawlerbros/sleeper-fantasy-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 7 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## 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/actors/running/actors-in-store.md#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

## Sleeper Fantasy Sports Scraper

Scrape [Sleeper](https://sleeper.com) fantasy football & basketball data — NFL/NBA players, league info, rosters, league members, drafts, draft picks, user profiles, and trending waiver-wire adds/drops. HTTP-only via the public `api.sleeper.app` JSON API. No login, no API key, no cookies.

### What this actor does

- **17 modes:** `players`, `playersByIds`, `trendingPlayers`, `playerOwnership`, `league`, `leagueRosters`, `leagueUsers`, `leagueMatchups`, `leagueTransactions`, `leagueTradedPicks`, `leagueDrafts`, `playoffBracket`, `user`, `userLeagues`, `draft`, `draftPicks`, `userDrafts`
- **Two sports:** NFL and NBA
- **Player search:** by name, position, team, roster status, active-only
- **Trending waiver wire:** most-added / most-dropped players over a configurable lookback window
- **Ownership / start rates:** percent-owned and percent-started for any sport/season/week, regular season or playoffs
- **League intelligence:** settings, roster counts, scoring type, roster/team records with win-loss and points
- **Weekly matchups:** per-roster points, starters, and starter-by-starter scoring for any week
- **Transaction log:** waiver claims and trades per week, with added/dropped players and waiver bid
- **Traded draft picks:** every future pick that has changed hands, by round and season
- **League drafts:** every draft (past or in-progress) a league has ever run
- **Playoff bracket:** winners (championship) or losers (consolation) bracket, round by round
- **Draft history:** full draft settings plus every pick with the drafted player attached
- **Empty fields are omitted**

### Output per record

Fields vary by `recordType`:

- **player** — `playerId`, `sport`, `fullName`, `firstName`, `lastName`, `position`, `positions[]`, `team`, `status`, `active`, `age`, `birthDate`, `height`, `weightLbs`, `college`, `yearsExp`, `jerseyNumber`, `depthChartPosition`, `depthChartOrder`, `injuryStatus`, `injuryBodyPart`, `injuryNotes`, `searchRank`, `espnId`, `yahooId`, `headshotUrl`, `playerUrl`
- **trendingPlayer** — `playerId`, `sport`, `trendType`, `count`, `fullName`, `position`, `team`, `status`, `headshotUrl`, `playerUrl`
- **playerOwnership** — `playerId`, `sport`, `season`, `seasonType`, `week`, `percentOwned`, `percentStarted`, `fullName`, `position`, `team`, `headshotUrl`, `playerUrl`
- **league** — `leagueId`, `name`, `sport`, `season`, `seasonType`, `status`, `totalRosters`, `numTeams`, `playoffTeams`, `playoffWeekStart`, `tradeDeadline`, `waiverBudget`, `pointsPerReception`, `rosterPositions[]`, `draftId`, `previousLeagueId`, `avatarUrl`, `leagueUrl`
- **roster** — `leagueId`, `rosterId`, `ownerId`, `ownerDisplayName`, `wins`, `losses`, `ties`, `pointsFor`, `pointsAgainst`, `waiverBudgetUsed`, `totalMoves`, `playersCount`, `players[]`, `starters[]`, `leagueUrl`
- **leagueUser** — `leagueId`, `userId`, `displayName`, `teamName`, `isOwner`, `avatarUrl`, `leagueUrl`
- **matchup** — `leagueId`, `week`, `matchupId`, `rosterId`, `ownerDisplayName`, `points`, `customPoints`, `starters[]`, `startersPoints[]`, `playersCount`, `players[]`, `leagueUrl`
- **transaction** — `leagueId`, `week`, `transactionId`, `type`, `status`, `createdAt`, `addedPlayerIds[]`, `droppedPlayerIds[]`, `rosterIds[]`, `waiverBid`, `notes`, `draftPicksTradedCount`, `leagueUrl`
- **tradedPick** — `leagueId`, `round`, `season`, `originalRosterId`, `currentOwnerRosterId`, `previousOwnerRosterId`, `leagueUrl`
- **bracketMatch** — `leagueId`, `bracketType`, `matchId`, `round`, `team1RosterId`, `team2RosterId`, `winnerRosterId`, `loserRosterId`, `placementForPosition`, `leagueUrl`
- **user** — `userId`, `username`, `displayName`, `isBot`, `avatarUrl`
- **draft** — `draftId`, `leagueId`, `sport`, `season`, `seasonType`, `status`, `type`, `teams`, `rounds`, `startTime`, `scoringType`, `draftUrl`
- **draftPick** — `draftId`, `round`, `pickNo`, `draftSlot`, `rosterId`, `pickedByUserId`, `isKeeper`, `playerId`, `playerName`, `position`, `team`, `headshotUrl`, `draftUrl`

Every record also carries `recordType` and `scrapedAt`.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `players` | One of the 16 modes above |
| `sport` | string | `nfl` | `nfl` or `nba` |
| `nameSearch` | string | – | Player name substring (mode=players) |
| `position` | string | – | Position filter (mode=players) |
| `team` | string | – | Team abbreviation filter (mode=players) |
| `status` | string | – | Roster status filter (mode=players) |
| `activeOnly` | bool | `false` | Only active players (mode=players) |
| `playerIds` | array | – | Sleeper player IDs (mode=playersByIds); duplicates are deduped |
| `trendType` | string | `add` | `add` or `drop` (mode=trendingPlayers) |
| `lookbackHours` | int | `24` | Trending window (mode=trendingPlayers) |
| `seasonType` | string | `regular` | `regular` or `post` (mode=playerOwnership) |
| `leagueId` | string | – | League ID (mode=league/leagueRosters/leagueUsers/leagueMatchups/leagueTransactions/leagueTradedPicks/leagueDrafts/playoffBracket) |
| `week` | int | `1` | Fantasy week / waiver round, 1-18 (mode=leagueMatchups/leagueTransactions/playerOwnership) |
| `bracketType` | string | `winners` | `winners` or `losers` (mode=playoffBracket) |
| `draftId` | string | – | Draft ID (mode=draft/draftPicks) |
| `username` | string | – | Sleeper username (mode=user/userLeagues/userDrafts) |
| `season` | string | – | 4-digit season; auto-resolved if omitted (mode=userLeagues/userDrafts/playerOwnership) |
| `maxItems` | int | `25` | Hard cap on emitted records |
| `proxyConfiguration` | object | AUTO | Optional; only used as an automatic fallback on 403/429 |

#### Example: browse NFL quarterbacks

```json
{ "mode": "players", "sport": "nfl", "position": "QB", "activeOnly": true, "maxItems": 20 }
```

#### Example: most-added NFL players this week

```json
{ "mode": "trendingPlayers", "sport": "nfl", "trendType": "add", "lookbackHours": 48, "maxItems": 25 }
```

#### Example: waiver-wire ownership / start rates

```json
{ "mode": "playerOwnership", "sport": "nfl", "season": "2025", "week": 1, "seasonType": "regular", "maxItems": 50 }
```

#### Example: league rosters

```json
{ "mode": "leagueRosters", "leagueId": "289646328504385536" }
```

#### Example: draft picks

```json
{ "mode": "draftPicks", "draftId": "289646328508579840", "maxItems": 100 }
```

#### Example: week 1 matchups (scores)

```json
{ "mode": "leagueMatchups", "leagueId": "289646328504385536", "week": 1 }
```

#### Example: week 1 waiver/trade transactions

```json
{ "mode": "leagueTransactions", "leagueId": "289646328504385536", "week": 1 }
```

#### Example: playoff bracket

```json
{ "mode": "playoffBracket", "leagueId": "289646328504385536", "bracketType": "winners" }
```

#### Example: all drafts a league has run

```json
{ "mode": "leagueDrafts", "leagueId": "289646328504385536" }
```

### Use cases

- **Fantasy tools** — build waiver-wire trackers, trade analyzers, or start/sit apps on top of live Sleeper data
- **League dashboards** — pull standings, rosters, and points-for/against for a custom league site
- **Draft recaps** — generate shareable draft-grade reports pick-by-pick
- **Player research** — cross-reference injury status, depth chart, and search-rank popularity
- **Content/media** — power trending-player newsletters or social posts

### FAQ

**Do I need a Sleeper account?** No. Every endpoint used here is Sleeper's public, unauthenticated REST API.

**Where do I find a league ID / draft ID?** They appear in the URL when you open a league or draft on sleeper.com (e.g. `sleeper.com/leagues/<leagueId>`), or via `mode=userLeagues` / `mode=userDrafts` with a username.

**Why is `season` optional?** If omitted, the actor calls Sleeper's `/state/<sport>` endpoint and uses the current season (or the most recently completed one during the off-season) automatically.

**What are `positions[]` vs `position`?** Some players are fantasy-eligible at multiple positions (e.g. a flex-eligible RB/WR). `position` is the primary (first-listed) eligibility; `positions[]` lists all of them.

**Why do some players have no `headshotUrl`?** Team-defense entries (`DEF`) use the team abbreviation instead of a numeric player ID, so no individual headshot exists.

**How fresh is the data?** Sleeper updates player status/injury data multiple times daily during the season; trending data is near-real-time.

# Actor input Schema

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

What to fetch.

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

Used by players / playersByIds / trendingPlayers / playerOwnership / userLeagues / userDrafts modes.

## `nameSearch` (type: `string`):

Case-insensitive substring match against the player's full name.

## `position` (type: `string`):

Filter to a single fantasy position. NFL: QB/RB/WR/TE/K/P/DEF/OL/OT/OG/LS/DL/LB/DB/LEO/K-P. NBA: PG/SG/SF/PF/C.

## `team` (type: `string`):

Filter to a single NFL or NBA team abbreviation.

## `status` (type: `string`):

Filter to a single roster status. NFL and NBA use different status vocabularies.

## `activeOnly` (type: `boolean`):

Only emit players currently marked active on a roster.

## `playerIds` (type: `array`):

Sleeper numeric player IDs, e.g. `4046` (Patrick Mahomes).

## `trendType` (type: `string`):

Waiver-wire adds or drops.

## `lookbackHours` (type: `integer`):

Trending window in hours.

## `leagueId` (type: `string`):

Sleeper league ID (used by mode=league / leagueRosters / leagueUsers / leagueMatchups / leagueTransactions / leagueTradedPicks / leagueDrafts / playoffBracket).

## `week` (type: `integer`):

Fantasy week / waiver round number (1-18, covers regular season plus playoffs).

## `seasonType` (type: `string`):

Regular season or postseason/playoffs ownership data.

## `bracketType` (type: `string`):

Winners bracket (championship side) or losers bracket (consolation side).

## `draftId` (type: `string`):

Sleeper draft ID (used by mode=draft / draftPicks).

## `username` (type: `string`):

Sleeper username (used by mode=user / userLeagues / userDrafts).

## `season` (type: `string`):

4-digit season year, e.g. `2025`. If omitted, the actor uses Sleeper's current (or most recently completed) season for the chosen sport.

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

Hard cap on emitted records.

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

Optional. Sleeper's public API is not blocked from Apify's datacenter IPs; this is only used as an automatic fallback if the API starts returning 403/429 responses.

## Actor input object example

```json
{
  "mode": "players",
  "sport": "nfl",
  "activeOnly": false,
  "playerIds": [],
  "trendType": "add",
  "lookbackHours": 24,
  "week": 1,
  "seasonType": "regular",
  "bracketType": "winners",
  "maxItems": 25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `sleeperRecords` (type: `string`):

Dataset containing all scraped Sleeper records.

# 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": "players",
    "sport": "nfl",
    "activeOnly": false,
    "playerIds": [],
    "trendType": "add",
    "lookbackHours": 24,
    "week": 1,
    "seasonType": "regular",
    "bracketType": "winners",
    "maxItems": 25,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/sleeper-fantasy-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": "players",
    "sport": "nfl",
    "activeOnly": False,
    "playerIds": [],
    "trendType": "add",
    "lookbackHours": 24,
    "week": 1,
    "seasonType": "regular",
    "bracketType": "winners",
    "maxItems": 25,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/sleeper-fantasy-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 '{
  "mode": "players",
  "sport": "nfl",
  "activeOnly": false,
  "playerIds": [],
  "trendType": "add",
  "lookbackHours": 24,
  "week": 1,
  "seasonType": "regular",
  "bracketType": "winners",
  "maxItems": 25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call crawlerbros/sleeper-fantasy-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlerbros/sleeper-fantasy-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/4q299NKnnWt5fHEca/builds/C01yp1rp6iu5Wwr3b/openapi.json
