Open SuperFexy opened 7 years ago
+1, interested in being able to pull a team's roster.
Here's what I'm interested in from a player
perspective (maybe it's already available). I'm specifically interested in pulling in weekly metrics for a specific player. For example, if you go to the 'Player' tab and then click on the 'Scoring Leaders' sub tab you get a break down of statistics (i.e. passing, rushing, receiving, etc.) for each player. And you can filter on the entire season or a given week. Do you know what the endpoint it to pull in data for a given player for a given week?
@Abundnce10 For that use case, you might want to look at https://github.com/BurntSushi/nflgame. It pulls player stats from a source closer to the "source of truth".
@HardcoreParkore Sweet, thanks for the link! Ultimately, I'm looking to create a Chrome Extension that inject's my own popup icon next to each player so that I can more easily look at more data from within the 'My Team' view. I was hoping to utilize an ESPN endpoint, since the request will originate from the same domain. Do you think I'll run into any issues trying to query the NFL Game Center JSON data
? I'm also planning on making the extension public (or possibly selling subscriptions if I find there's demand for it), so I want to use a data source that won't mind if it's being hit by a couple thousand different users.
@Abundnce10 nflgame doesn't provide a public API that you can hit, it merely gives you the tools to query for and store the data from the publicly accessible NFL Game Center data.
I like the sound of the extension you're planning. I think it would certainly require building your own service that responds to requests for stats, though - I don't think ESPN exposes an endpoint that provides that data.
@danabrey correct me if I'm wrong but I believe this repo is utilizing ESPN's private API endpoints, correct? If that's the case, I'm guessing there must be endpoints for a specific player that just haven't been discovered/documented. For example, when I look at the 'Scoring Leaders' view with the 'Players' tab I see stats for individual players available on a weekly basis, so I'm guessing there is some kind of API endpoint where you can pass in a player ID and week number to get stats for a given week.
I've tried looking through the network calls when that view renders but I can't seem to find any endpoints for a given player. I'm not sure how @rbarton65 originally discovered the endpoints exposed in this repo, but if anyone can help finding a player-specific endpoint I'm happy to add code to the player.py
file and make a pull request. Let me know if anyone finds anything!
@Abundnce10 I was talking about the NFL Game Center JSON, in reply to you asking if you'd run into any issues pulling data from there :)
There's interesting discussion on Reddit involving @rbarton65 about how endpoints were initially discovered.
It's unlikely that the data in all views is covered by an HTTP-accessible API endpoint, to me - stats pages like that could well just be rendered on the server. There's a playerInfo
endpoint but that doesn't return any statistical information such as passing or rushing yards.
I noticed the
player.py
file is empty. Do you plan to add the player endpoints to this library?