lemmin Tue 11/17/20 8:29 PM

I want to compare the performance of players from each manager across a league, but in a 12-person league, this requires 6 different API requests to get the data for the week in question. Worse, if I want to compare overall performance throughout the season, I would need to make 78 requests to get that information for a 13-week season.

Making dozens of requests is not practical if I want to do it more than once, so I'm wondering if there is any way to get all the box scores for a league in one request. Alternatively, is there any way to export the box scores from the website so as to avoid making a ton of API requests?

If not, would either of those features be something that may be implemented in the future?

PovertyBayOrca Wed 11/25/20 12:47 AM

I just write Python programs to do stuff like that. I pull the data I need then I stuff it into a database table and pull the data from there. So it is not something everyone might be able to do. I believe you are probably stuck doing all those calls. Running a program zips through the extracts quickly. Wading through all that extra data is a pain without a program to pick the fields you need in the JSON file. Good luck

Algirdas Wed 11/25/20 10:18 AM

EDIT: I did not mean this to be a reply to this comment, but so be it.

I am using Google sheets with a couple of scripts for our league requests (I can't post links to other websites so you'll have to fix the urls yourself):

1) Import Json: medium [dot] com/@paulgambill/how-to-import-json-data-into-google-spreadsheets-in-less-than-5-minutes-a3fede1a014a

2) Get current sheet name: support [dot] google [dot] com/docs/thread/8603869?hl=en

I have a couple of templates you can take a look at:

1) Future draft picks: docs [dot] google [dot] com/spreadsheets/d/1R0w20BlQLRycd34dS2igvQEW9tvV2FDdoUzoXu1N1BU/edit?usp=sharing

2) Standings and power rankings: docs [dot] google [dot] com/spreadsheets/d/1TB4HopD4-nAL_a166NKbBKy_HIYWUPwEgSt749bR5VI/edit?usp=sharing

I think you should be able to do something similar for your player comparison. If you manage to do that, please share with the rest of us - we might apply it for our leagues :)

Good luck!

PovertyBayOrca Thu 11/26/20 10:50 AM

no problem on the reply!

I started out using the spreasheet approach but wanted something i could generate various and different reports from on the fly. Plus covid stay at home was the perfect time to learn python. I use it to generate several weekly performance reports and an ever changing attempt to predict the next week's performance. While I don't get an exact score based on our league scoring, it give a trend which helps me pick streamers at every player position. I output graphs and PDFs . Really nice to use those plus what sites such as fantasyrundown to get a handle on what to stream.

lemmin Thu 11/26/20 8:42 PM

I already have the scripts written to automate grabbing all the data with the numerous requests. At this point in the season, it takes over 2 minutes to download all the data for one league. That's fine for a few people looking at this league, but there's no way to scale it up without a more efficient way to access the data (or a way for the user to provide their own league data).

Sounds like there is no solution for this at the moment.

Marc_Baker Tue 3/1/22 4:28 PM

I'm looking for this too. Is there a way to get the fantasy_game_id's from the API for a league to then pump into the fleaflicker.com????? URL?

fleafounder Admin Wed 3/2/22 3:38 PM

Try FetchLeagueScoreboard. It returns matchups for a given week

Marc_Baker Thu 3/3/22 9:16 AM

But is there a way to get it for prior weeks? Or seasons? I'm looking to gather the fantasy score for a season's worth of games, and currently need the fantasy_game_id to do that it appears.

Marc_Baker Mon 3/21/22 5:36 PM

FetchLeagueScoreboard has been working with the league_id, season, and scoring_period. However, I'm trying to call up FetchUserLeagues with the away or home id for a team from FetchLeagueScoreboard, but it doesn't appear that the id correlates to the owner as it's pulling up a different owner in FetchUserLeagues. What is the id value for away/ome in FetchLeagueScoreboard?

Marc_Baker Mon 3/21/22 6:17 PM

Hopefully this helps someone, I found that I could get the owner id from FetchLeagueStandings.