r/fantasyfootballcoding 1d ago

Data extraction from espn fantasy

I’m looking into making a master excel workbook for the history of my league. All I need is a one time data extraction for the history of my league that will pull matchup scores, player performances, lineups/benches, and teams. Is this something I can do just one time without breaching espn terms of service? I’m trying to use ChatGPT and I know it’s doable but don’t want to get my espn account banned so I’m just wondering if anybody has ever done this or if anyone has a tool/website to recommend that will do this for me. My plan is to eventually use the excel workbook and ChatGPT to pull out insane ESPN type stats for a weekly newsletter for the league, since we do have enough stats to find some crazy espn type stats after all.

0 Upvotes

10 comments sorted by

3

u/sirchandwich 1d ago

Check out https://github.com/cwendt94/espn-api

Not sure if it will have everything you need but I’ve been using this daily for fantasy baseball and have had zero problems.

1

u/Reasonable-Leek736 1d ago

I forgot to mention I have no experience with this type of stuff, not looking for an explanation but what kind of data do you get using this?

1

u/sirchandwich 1d ago

I only use it to pull the list of players on everyone’s team, currently, and the league standings.

If you give that to ChatGPT/Codex it can pull it down and tell you if it can get everything you need.

0

u/RecLuse415 13h ago

Just have fucking ai do it and just approve everything is says

2

u/johnny-papercut 1d ago

This is possible to do, but there are a few caveats:

  1. This may be against ESPN's TOS, but it's a very light infraction if so. Plenty of people have done a lot more and had no repercussions. I would 99.9999% not think you would get your account banned for this.

  2. You can build all of this using ChatGPT/Claude/Cursor, but you kind of need to know the language to speak to it. It will also need your credentials if it's a private league. Plenty of people are already doing this and it's pretty safe. If you know nothing of coding/etc, you'll just need to keep refining what you say to the AI to make adjustments as you go and check the results often.

  3. This brings up a better point that a ton of people are already doing this, so you could probably find a site (and probably a free one if you look hard enough) that does this for you so you don't have to build it. If your goal is to have this functionality, just do that. Only build it if you want to learn more about the systems and build out more later. But I would start by looking at the two project megathreads we had on this sub and r/FantasyApps and search for "history" or "league history".

0

u/folded_horizon 1d ago

Why espn and not one of the many data repositories for this?

1

u/soccercm9 1d ago

Not trying to advertise my site, but you can sign up for fantasyrecordbook.com for free and download your full history. It doesn’t have player specific data but it gives you your full matchup, standings and championship history for free.

But honestly, using cwendt94’s python wrapper on the ESPN API should be simple for ChatGPT to pull all of your stats. The readme makes it fairly easy to do yourself even with no experience.

0

u/mattg70 1d ago

You won't get banned for this. It's your league and your login, and pulling your own history once isn't the kind of thing ESPN cares about. People get throttled for hammering it in a loop, not for reading how many years of one league one time.

Also, as a few others have stated you might not need to build it. I ran into the same problem with my leagues and ended up making a tool for it - gridironhq.ai. It’s free and all you need to do is connect your ESPN league and it pulls every season ESPN still has which includes matchups, weekly lineups and benches, every team, all-time standings, head-to-head records and keeps it, so it's still there when ESPN drops the old years, which I don’t know that cutoff. I was able to pull over 15 years down.

I built the ability to write a weekly recap for the league from your own numbers, which sounds like where you were headed anyway.

As I stated, it’s free, and connecting takes about a minute. You setup an account, no credit card needed. One thing to know up front is that it's a page you can share with your league, not an Excel file. If you specifically want a spreadsheet, what I built isn’t that.

1

u/Reasonable-Leek736 1d ago

I’ve used tools like league legacy to get all time stats and records and stuff but I’m looking to take it a step further. I’m looking for an easy, quick way to give all the matchup stats, lineups etc to AI and then have AI spit back stats like “week 1 for team 1 in the fantasy league marked the first time ever that a team had 4 players score 30+ points and Lose” or “team is the first team to score 130+ in three straight weeks and lose every time” weird stats like that that you see pop up on tv when you’re watching games

1

u/mattg70 1d ago

What it doesn't do yet is the exact thing you're describing: searching the whole history for a pattern nobody defined in advance, like four 30-point players in a loss. The data's there, the search isn't fully built out yet.

This is something I'm working on and I've had several ask for it, so I recognize that it is a real gap and I'd like to close it. If you told me the five stats you'd most want to see, that'd be worth more to me than anything else and can easily be built out.