npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

espn-fantasy-wnba-api

v2.0.1

Published

The first and only public API for ESPN's Fantasy WNBA - reverse-engineered endpoints for fantasy league data

Readme

ESPN Fantasy WNBA API

The first and only public API for ESPN's Fantasy WNBA

This library provides access to ESPN's internal Fantasy WNBA endpoints, reverse-engineered and documented for public use.

Prerequisites

This package is designed for Node.js environments and requires:

npm install node-fetch  # Required dependency

Installation

Since this package isn't published to npm yet, install directly from GitHub:

npm install matthewh8/espn-fantasy-wnba-api
npm install node-fetch  # Required dependency

Quick Start

import ESPNWNBAFantasyAPI from 'espn-fantasy-wnba-api';

// Public data (no authentication)
const api = new ESPNWNBAFantasyAPI();
const players = await api.getAllPlayers();

// Private league data (requires ESPN cookies)
const privateApi = new ESPNWNBAFantasyAPI({
    espnS2: 'your_espn_s2_cookie',
    swid: 'your_swid_cookie'
});

const rosters = await privateApi.getLeagueRosters('YOUR_LEAGUE_ID_HERE');

Authentication

For private league data, you need ESPN authentication cookies:

  1. Go to ESPN Fantasy WNBA in your browser
  2. Open DevTools (F12) → Application → Cookies → espn.com
  3. Copy espn_s2 and SWID values

Available Methods

Public Endpoints (No Auth Required)

  • getAllPlayers(scoringPeriodId?) - All WNBA players with ownership data
  • getProTeamSchedules() - WNBA team schedules
  • getGameState() - Current game state info

Private Endpoints (Auth Required)

  • getLeagueRosters(leagueId) - All team rosters in league
  • getLeagueSettings(leagueId) - League scoring settings
  • getPendingTransactions(leagueId) - Waivers and pending trades
  • getCurrentMatchups(leagueId, scoringPeriodId?) - Current week matchups
  • getScoreboard(leagueId, scoringPeriodId?) - League scoreboard

Example: Get Team Rosters

const api = new ESPNWNBAFantasyAPI({
    espnS2: 'your_cookie',
    swid: 'your_swid'
});

const data = await api.getLeagueRosters('YOUR_LEAGUE_ID_HERE');
const rosters = api.extractRosters(data);

rosters.forEach(team => {
    console.log(`${team.name}:`);
    team.players.forEach(player => {
        console.log(`  - ${player.name}`);
    });
});

Troubleshooting

Common Issues:

  • "fetch is not defined" - Make sure you've installed node-fetch
  • 401 Unauthorized - Check that your ESPN cookies are valid and not expired
  • Module not found - Ensure you're using Node.js 14+ with ES modules support

Getting Your League ID: Your league ID can be found in the URL when viewing your ESPN Fantasy WNBA league: https://fantasy.espn.com/basketball/league?leagueId=YOUR_LEAGUE_ID_HERE

Discovered Endpoints

This API exposes ESPN's internal Fantasy WNBA endpoints. All discovered endpoints are documented in the source code for developers who want to expand functionality.

Base URL: https://lm-api-reads.fantasy.espn.com/apis/v3/games/wfba

Game Code: wfba (Women's Fantasy Basketball Association)

Environment Support

  • Node.js: 14.0.0 or higher
  • ES Modules: Required
  • Browser: Not supported (due to CORS restrictions)

Contributing

Found more endpoints or want to add features? PRs welcome!

License

MIT - Use freely for personal or commercial projects.