Skip to content

Connecting ESPN

Batter’s Eye syncs with ESPN Fantasy Baseball to pull your league’s rosters, transaction history, and league settings. To enable this, you’ll need to provide your ESPN credentials.

ESPN’s fantasy API requires authentication to access private league data. Your credentials allow Batter’s Eye to:

  • Sync rosters every 15 minutes
  • Show ownership badges on the Players page (who owns which player)
  • Power pickup recommendations based on your actual roster
  • Display league transaction history and trade trees
  1. Go to Settings (gear icon in the header)
  2. Find the ESPN Credentials section
  3. Enter your ESPN SWID and ESPN_S2 cookies
  1. Log into ESPN Fantasy in your browser
  2. Open your browser’s Developer Tools (F12 or right-click > Inspect)
  3. Go to the Application tab (Chrome) or Storage tab (Firefox)
  4. Under Cookies, find espn.com
  5. Copy the values for:
    • SWID — looks like {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
    • espn_s2 — a long alphanumeric string

Paste both values into Settings and click Save.

Your ESPN credentials are encrypted before being stored in the database using industry-standard Fernet encryption. They are never stored in plain text and are only decrypted server-side when making API calls to ESPN.

You don’t need every league member to enter their credentials. Batter’s Eye uses a league-level fallback — if any member of your league has valid credentials saved, features like league history and trade trees will work for everyone in the league.

  • Credentials expired? ESPN cookies expire periodically. If roster sync stops working, re-enter fresh cookies from your browser.
  • League not syncing? Make sure the ESPN League ID on your league matches your actual ESPN league. Check the URL in ESPN Fantasy.