[Alpha] ESPN Fantasy Football Integration

Why? Because we can.

  • Display your ESPN Fantasy Football matchup as a tile on your dashboard
  • Tile and device attributes indicate:
    - whether your team or your opponent's team is starting a player who is out (injured with a projected score of 0)
    - whether any of your players are playing now, and whether any of your opponent's players are playing now (switch turns to on when you have players playing)
    - minutes left, number of players in play, and number of players yet to play, for your team and your opponent's team
    - number of points scored, both actual and projected

Screenshot 2024-09-29 at 8.24.04 AM

Key To Icons On Tile

Starting Inured Player

Projected Score
projectedIcon

To Install, you'll need your ESPN Fantasy Football league id (see the url on your team's league page). If the league is a private league that is not viewable by the public, you'll also need the values of the SWID cookie and the espn_32 cookie. See instructions here on how to get those. Remove the brackets {} from the cookie values.

On HPM with tags "Dashboards" and "Integration"

1 Like

It was only a matter to time until someone figured out a way to integrate fantasy football, Bravo!

I manually pulled in the cookie values. Should the {} be removed from the SWID value?

Trying to triage an error, it successfully pulls in my league. I am able to select my team but I get a subsequent error after saving.

[app:1085](http://192.168.1.175/logs#)2024-09-30 09:18:30.454 AM[error](http://192.168.1.175/logs#)java.lang.NullPointerException: Cannot get property 'teamId' on null object on line 331 (method updated)

[app:1085](http://192.168.1.175/logs#)2024-09-30 09:18:27.496 AM[debug](http://192.168.1.175/logs#)[mMatchupScore, Api Call: [uri:https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/2024/segments/0/leagues/1917986649/?view=mMatchupScore, path:, contentType:application/json, headers:[Cookie:SWID={272C1020-C079-4837-9C37-A747F8DBAA8F};espn_s2=AEA4YkcXw0Gdkhv%2Fhz4LovsI50ohNwzkcIwJGquMEvoYIOmC0Pd7DlitRVEBMaYRj6SzuqqgUnbT2qRT%2FfJ58AraLgQdBDf0fyrbNvSUjDMqWNi3uWnFP4SLci98hSRtOb9tVLTRLmYVohhaiMKFmPAa%2FwHVGoQ9GQ5srJl0TzQqinYC7yX8li8yyFrYOYClicGesn8qExNtb%2B%2FxRNr8KWzpAFJcze1e85Sv2bj9qg6JZPRzyKxkyegFqje9tVEJyB9MslHZCsj6lABiRz8fAQOYahKH8Lim9QWRZ3LWaeBgTQuIXUwGZbRteOywfgdcwlo%3D, view:[mMatchupScore]], timeout:1000]]

[app:1085](http://192.168.1.175/logs#)2024-09-30 09:18:23.890 AM[debug](http://192.168.1.175/logs#)[mTeam, mRoster, mMatchup, mStandings, mSettings, Api Call: [uri:https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/2024/segments/0/leagues/1917986649/?view=mTeam&view=mRoster&view=mMatchup&view=mStandings&view=mSettings, path:, contentType:application/json, headers:[Cookie:SWID={272C1020-C079-4837-9C37-A747F8DBAA8F};espn_s2=AEA4YkcXw0Gdkhv%2Fhz4LovsI50ohNwzkcIwJGquMEvoYIOmC0Pd7DlitRVEBMaYRj6SzuqqgUnbT2qRT%2FfJ58AraLgQdBDf0fyrbNvSUjDMqWNi3uWnFP4SLci98hSRtOb9tVLTRLmYVohhaiMKFmPAa%2FwHVGoQ9GQ5srJl0TzQqinYC7yX8li8yyFrYOYClicGesn8qExNtb%2B%2FxRNr8KWzpAFJcze1e85Sv2bj9qg6JZPRzyKxkyegFqje9tVEJyB9MslHZCsj6lABiRz8fAQOYahKH8Lim9QWRZ3LWaeBgTQuIXUwGZbRteOywfgdcwlo%3D, view:[mTeam, mRoster, mMatchup, mStandings, mSettings]], timeout:1000]]

Any thoughts?

1 Like

Yes, you need to remove the {}.

Also, I'm currently working on an issue with it updating. I just uploaded a new version that will fix the out-of-game updates, but still working on the (presumably more frequent) in-game updates. Very much an alpha version at this point, but figured better to release while we're already in week 4 of NFL.

EDIT: ok just release 1.0.2 that hopefully should fix the in game updating. At least for now it's the easiest/best way - plan on poking around the undocumented API more to see if there's a better way to do it

Also, the projected score is the projection before the games start. Looking for how to get the live updated projection after games start, and will replace when I figure that out.

It's actually quite frustrating to try to tap into an undocumented API, especially ESPNs - theirs seems quite unorganized with so much overlapping data between API endpoints and so much "encoding" of the meaning of various data points.

100% with you, I was attempting to use their API for game updates until your gameTime app came along.

Still getting an error, different line.
java.lang.NullPointerException: Cannot get property 'teamId' on null object on line 353 (method updated)

EDIT: just a thought, we have an odd number in our league this year; so someone always has a bye. Is that throwing the error since it can't find the matchup?

1 Like

I've done a lot of work on this over the past week. I expect I'll release a new version in the next day or so, with a lot of new features. I will make sure it can handle byes now that you mention it - not something that I had considered yet, so thx.

1 Like

Ok I think I have it coded to handle byes now. But I'll have to wait until tomorrow when a new NFL week starts to test it out.

@fieldsjm
Just released v1.1.0. Major update. You'll definitely need to go into the app and set it back up. Lots of new settings to ensure are configured. Bye weeks are handled now.

Thanks.
I remove the app and re-installed (just in case).
No longer getting the bye related error. Successfully created the two child devices (league and team). But the log is showing no matchup found. I double checked espn and I do have a matchup this week.

[app:1095](http://192.168.1.175/logs#)2024-10-09 09:37:50.623 AM[debug](http://192.168.1.175/logs#)No Matchup Found for Team 14

[app:1095](http://192.168.1.175/logs#)2024-10-09 09:37:50.620 AM[debug](http://192.168.1.175/logs#)selectedTeamIDs = [14] teamsInPlay = [] anySelectedTeamInPlay = false

[app:1095](http://192.168.1.175/logs#)2024-10-09 09:37:47.940 AM[debug](http://192.168.1.175/logs#)[mScoreboard, Api Call: [uri:https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/2024/segments/0/leagues/1917986649/?view=mScoreboard, path:, contentType:application/json, headers:[Cookie:SWID=272C1020-C079-4837-9C37-A747F8DBAA8F;espn_s2=AEA4YkcXw0Gdkhv%2Fhz4LovsI50ohNwzkcIwJGquMEvoYIOmC0Pd7DlitRVEBMaYRj6SzuqqgUnbT2qRT%2FfJ58AraLgQdBDf0fyrbNvSUjDMqWNi3uWnFP4SLci98hSRtOb9tVLTRLmYVohhaiMKFmPAa%2FwHVGoQ9GQ5srJl0TzQqinYC7yX8li8yyFrYOYClicGesn8qExNtb%2B%2FxRNr8KWzpAFJcze1e85Sv2bj9qg6JZPRzyKxkyegFqje9tVEJyB9MslHZCsj6lABiRz8fAQOYahKH8Lim9QWRZ3LWaeBgTQuIXUwGZbRteOywfgdcwlo%3D, view:[mScoreboard]], timeout:1000]]

[app:1095](http://192.168.1.175/logs#)2024-10-09 09:37:47.751 AM[debug](http://192.168.1.175/logs#)[mLiveScoring, Api Call: [uri:https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/2024/segments/0/leagues/1917986649/?view=mLiveScoring, path:, contentType:application/json, headers:[Cookie:SWID=272C1020-C079-4837-9C37-A747F8DBAA8F;espn_s2=AEA4YkcXw0Gdkhv%2Fhz4LovsI50ohNwzkcIwJGquMEvoYIOmC0Pd7DlitRVEBMaYRj6SzuqqgUnbT2qRT%2FfJ58AraLgQdBDf0fyrbNvSUjDMqWNi3uWnFP4SLci98hSRtOb9tVLTRLmYVohhaiMKFmPAa%2FwHVGoQ9GQ5srJl0TzQqinYC7yX8li8yyFrYOYClicGesn8qExNtb%2B%2FxRNr8KWzpAFJcze1e85Sv2bj9qg6JZPRzyKxkyegFqje9tVEJyB9MslHZCsj6lABiRz8fAQOYahKH8Lim9QWRZ3LWaeBgTQuIXUwGZbRteOywfgdcwlo%3D, view:[mLiveScoring]], timeout:1000]]

[app:1095](http://192.168.1.175/logs#)2024-10-09 09:37:43.924 AM[debug](http://192.168.1.175/logs#)[mTeam, mRoster, mMatchup, mStandings, mSettings, mLiveScoring, Api Call: [uri:https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/2024/segments/0/leagues/1917986649/?view=mTeam&view=mRoster&view=mMatchup&view=mStandings&view=mSettings&view=mLiveScoring, path:, contentType:application/json, headers:[Cookie:SWID=272C1020-C079-4837-9C37-A747F8DBAA8F;espn_s2=AEA4YkcXw0Gdkhv%2Fhz4LovsI50ohNwzkcIwJGquMEvoYIOmC0Pd7DlitRVEBMaYRj6SzuqqgUnbT2qRT%2FfJ58AraLgQdBDf0fyrbNvSUjDMqWNi3uWnFP4SLci98hSRtOb9tVLTRLmYVohhaiMKFmPAa%2FwHVGoQ9GQ5srJl0TzQqinYC7yX8li8yyFrYOYClicGesn8qExNtb%2B%2FxRNr8KWzpAFJcze1e85Sv2bj9qg6JZPRzyKxkyegFqje9tVEJyB9MslHZCsj6lABiRz8fAQOYahKH8Lim9QWRZ3LWaeBgTQuIXUwGZbRteOywfgdcwlo%3D, view:[mTeam, mRoster, mMatchup, mStandings, mSettings, mLiveScoring]], timeout:1000]]

What are these values in the application state for you? Wondering if there's something about it being a tuesday that it isn't catching the right matchup week yet.
image

appears to match yours (i skipped on the teams data)
Edit: I dont see matchupPeriodToDisplay


image
image

Ah, found the issue with this. v1.1.1 should be good to go now. Update and go back into the app to press Done

1 Like

Success. Thanks.
image

Now to find a suitable injury replacement :slight_smile:

1 Like

And get you a nice team icon too. I like this AI image generator since it can generate transparent background png files and can generate nice simplistic logos.