Skip to main content

ESPN reverse-engineering

ESPN has no public fantasy API. Everything the worker sends to ESPN comes from captured browser traffic, ESPN's own frontend bundles, or live tests against a real league. This section records what was confirmed, how, and what is still a guess.

The short version
  • Reads go to lm-api-reads, writes go to lm-api-writes, and every write is a POST to one transactions/ endpoint.
  • Drafts use a separate WebSocket backend, fantasydraft.espn.com, with plain-text frames.
  • The espn_s2 and SWID cookies are enough for REST and the WebSocket. A rendered page also needs a real interactive login.
  • A live capture against a real league is always reverted, and every write needs explicit approval.

Which page do I need?​

I want to…Read
Find the view= that returns rosters, settings, pending trades or chatRead views
Build a lineup, IR, add or drop requestTransactions endpoint
Propose, accept, decline or counter a tradeTrades
Join a draft room, submit a pick or detect draft completionDraft room
Decode a TRAN_* code or another rejectionError codes
Capture new ESPN traffic without changing the leagueRecon tools
Understand cookies, the saved session, remote login and session healthSession and auth

How confident is each finding?​

Each page labels its findings with one of these levels. Dates are when the finding was confirmed, all in 2026.

LabelMeaning
Confirmed liveSeen on the wire against a real league or draft, or produced by the worker's own code path and verified.
From the bundleRead from ESPN's frontend JavaScript. Nothing was sent. The minified names change between builds.
UnverifiedWhat the code assumes. A flag in espn_api.js usually blocks the write until a capture confirms it.

Placeholders​

The examples use placeholders only. Replace them with your own values when you run a probe.

PlaceholderStands for
{leagueId}, 1234567890Your league ID. Practice drafts get their own ephemeral league ID.
{teamId}, 8Your team's ID within the league.
{SWID-WITH-BRACES}, {00000000-0000-0000-0000-000000000000}The SWID cookie, including its braces. It is also your ESPN memberId.
<espn_s2>The espn_s2 cookie. Never paste a real one into a doc, fixture or log.

Player IDs in examples are ESPN's public player IDs.

  • Bots lists which bot calls each endpoint.
  • How bots run covers DRY_RUN and the other write gates.