Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know if this is available for (American)Football?




Author here! That's a pretty nice visualization :-)

I thought I'd just squeeze in a few words about nflgame/nfldb. Both offer access to the same stuff: play-by-play data back to 2009. Both can be used with live games so that they are updated in real time (well, at least as frequently as NFL.com).

nflgame is responsible for pulling the JSON data and provides some rudimentary searching features. But it's slow.

nfldb stores all this data for you in a relational database. It comes with a script that updates the database while games are playing so that you can get access to live data. (It will even migrate the database for you if I've made any changes to the schema.)

Here's a quick example that shows how to get all of Julian Edelman's touchdown plays from last season:

    import nfldb
    
    db = nfldb.connect()
    
    q = nfldb.Query(db)
    q.game(season_year=2013, season_type='Regular')
    q.player(full_name='Julian Edelman').play(offense_tds=1)
    for g in q.as_plays():
        print g
Easy as pie!

There's an extensive wiki (almost 20,000 words) with tons of examples and explanation: https://github.com/BurntSushi/nfldb/wiki

Other features: aggregating data, player meta data (college, height, weight, etc.) and fuzzy player name matching.


The same project seems to offer NFL play-by-play, but only for two seasons:

https://github.com/opensport/american-football.db

The best public football repository I am aware of is this, though:

http://www.advancedfootballanalytics.com/2010/04/play-by-pla...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: