-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New data feeds found #28
Comments
This is great info! Props to your girlfriend. I can see the |
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOO! Good work girfriiiend. |
I've done quite a bit of research regarding api.nfl.com. You are mostly right in regards to it being commercial / partner locked. You can, presumably, get around this by creating an account with nfl.com. I ran into issue's trying to glean my token from my user account and gave up. I'm also unsure if you can log in programattically which would make it a non-starter for this project. Given the developments in this project I abandoned that effort and being content w/ nflgame-redux stopped sniffing around api.nfl.com. It could be worth trying to decrypt the mythical authentication nonsense. It really just didn't feel right tho. |
An update here - it's possible to adjust these URLs in order to get older data, like: https://feeds.nfl.com/feeds-rs/scores/2013/POST/20.json (POST week 3, conference finals) Also, if you omit the |
NVM. Check #46. |
So after researching a bit, I (my girlfriend actually, give credit where credit is due) stumbled upon some interesting feeds on nfl.com.
https://feeds.nfl.com/feeds-rs/schedules.json - great for
nflgame
. This file contains the whole of the 2018 season (from HOF to REG17). This means that we could still be restrictive with calls to NFL.com for what it's worth (once a day or so) but we'll get the whole season every time we call so any changes made to a game ten weeks ahead would be included. Maybe they'll fill up with postseason games in the same file, we don't know yet. This one also has more info for each game than its old counterpart. A great addition is the ISO-time-field for kickoffs which is awesome for our purposes. Today's feeds only gives the 12-hour time which is a bit tricky when it comes to Pacific time vs London time games, as can be seen in the code. With ISO-times there's no confusion whatsoever.https://feeds.nfl.com/feeds-rs/scores.json - feeds the score bar on nfl.com it seems. Was previously http://www.nfl.com/liveupdate/scorestrip/scorestrip.json and an equivalent for the postseason. Despite the name, these weren't valid JSON. The new one is, and contains more info (for instance, current position of the ball, points in each quarter and remaining timeouts). This one doesn't matter too much for
nflgame
in the way it is written now, the game data is taken from the respective game's pages anyway (which contain more detail and every play, not just the current). If one is interested in a lighter live-function that gives you pretty much all info of right now in all games without the underlying player stats it could be interesting (one call vs up to 16 calls) to develop. Depends on the use case.https://feeds.nfl.com/feeds-rs/bigPlayVideos.json - havent looked into Andrew's
nflvid
-project myself but yeah, the big play highlights are all collected here with URLs to the videos and other stuff. Easy to link if that should be desirable.A thing to consider with all these feeds is that they all support the
Last-Modified
header (including the game feeds that we use today). None of the files mentioned are massive, but it's possible to just check with a HEAD request if a resource is modified or not before doing an actual (possibly unnecessary) GET of it. They all supportgzip
too (the impact of enabling it probably isn't gonna be huge but still, wouldn't hurt).Also, since there seems to be some confusion on whether what we are using is an API, if the NFL has an API or not...I thought this'd be a good place to clear that out:
Does the NFL have an API? Yes they do. Can we use it for nflgame? No we cant.
The yes part: api.nfl.com does exist and whenever you visit a page on nfl.com then API calls will be made there (as well as to the feeds mentioned above, that's how we found them, just use an inspector tool in your browser and you'll see it).
The no part: If you try to make a call yourself, for example via
curl
or just posting it in the browser, you'll get a permission denied (there are some open calls, but nothing of value that I've found). There is a public documentation of the API. https://api.nfl.com/docs/getting-started/index.html. From what I understand after reading around a bit and checking Stack Overflow-threads on the matter, it seems like it is not easily available but more a commercial or special case-thing. Nothing you can use straight away at the moment and for it to be used here, everyone would probably need their own account and I can't really rule out if it's even possible to get one.So what are we using? We are using data feeds/resources that simply are available from NFL.com. They are not part of an API, they are just there. Why the NFL has chosen to not lock them down (like the actual API) we don't know.
The text was updated successfully, but these errors were encountered: