Reliable Play by Play Data

Home for all your discussion of basketball statistical analysis.
Post Reply
JohnHasADHD
Posts: 21
Joined: Wed Feb 15, 2012 2:16 am

Reliable Play by Play Data

Post by JohnHasADHD »

Does anyone know where reliable play by play data is? I've been working with the ESPN data because it does have shot distances SOME of the time. Does anyone know a better source of reliable play by play information, or is that the best (free) source?
J.E.
Posts: 852
Joined: Fri Apr 15, 2011 8:28 am

Re: Reliable Play by Play Data

Post by J.E. »

What do you mean with "reliable"?
basketballvalue has (almost daily) updates of their PBP, but you seem to be interested in shot location, and I don't think they have that
JohnHasADHD
Posts: 21
Joined: Wed Feb 15, 2012 2:16 am

Re: Reliable Play by Play Data

Post by JohnHasADHD »

At least shot distance, yes, that's what I'm looking for.
The best freely available one I've found is ESPN but they often have shots, either makes or misses, that lack a distance...with no rhyme nor reason for why some have distance and some don't.
Basketballvalues data was the first I looked at but it lacks the distance of shots.
tignas
Posts: 6
Joined: Tue Dec 27, 2011 10:36 pm

Re: Reliable Play by Play Data

Post by tignas »

espn has shot distance and x,y coordinates for all shots

you have to parse it from
'http://sports.espn.go.com/nba/gamepacka ... ot?gameId=' + game_id
JohnHasADHD
Posts: 21
Joined: Wed Feb 15, 2012 2:16 am

Re: Reliable Play by Play Data

Post by JohnHasADHD »

Tignas

That seems to be absolutely what I'm looking for (if not more)

Now I just have to figure out how to parse XML into MySQL :)
tignas
Posts: 6
Joined: Tue Dec 27, 2011 10:36 pm

Re: Reliable Play by Play Data

Post by tignas »

i use python with BeautifulSoup, it is quite simple to do

Code: Select all

import urllib2
import urllib
from BeautifulSoup import BeautifulStoneSoup

def get_shot_cord(game_id):
    """
    Import Shot Coordinates for game_id
    """
    shot_url = 'http://sports.espn.go.com/nba/gamepackage/data/shot?gameId=%s' % (game_id)
    result = urllib2.urlopen(shot_url)
    body = BeautifulStoneSoup(result)
    shots = body.findAll('shot')
    for shot in shots:
        print shot
JohnHasADHD
Posts: 21
Joined: Wed Feb 15, 2012 2:16 am

Re: Reliable Play by Play Data

Post by JohnHasADHD »

Oh, I have no doubt that it's easy to do, I just don't know perl or python yet - i mostly work with PHP and MySQL :)
Thanks though - this helps immensely - i wonder what other tricky things ESPN is hiding on their web site.
tignas
Posts: 6
Joined: Tue Dec 27, 2011 10:36 pm

Re: Reliable Play by Play Data

Post by tignas »

simplexml for php is pretty good. if you're interested in what espn/other websites are 'hiding' from you, i'd recommend using firebug. you can see what requests are made and figure out the data source from there, making it easier to retrieve the data you're looking for
JohnHasADHD
Posts: 21
Joined: Wed Feb 15, 2012 2:16 am

Re: Reliable Play by Play Data

Post by JohnHasADHD »

I've used firebug a bit but didnt' know it could do that. I have done mlb pitchFX downloading but I've used established modules, never built my own, so sounds like I'm taking on a big project maybe :)
donk
Posts: 2
Joined: Sun Jun 03, 2012 3:27 am

Re: Reliable Play by Play Data

Post by donk »

I want to back-test an NBA half-time betting strategy, but I haven’t been able to find the necessary data from the usual data providers. What I need is at least a couple years of NBA half-time totals (over/under) LINES data including the half time score and the second half score. Any idea where I can find that data? Tks.
JohnHasADHD
Posts: 21
Joined: Wed Feb 15, 2012 2:16 am

Re: Reliable Play by Play Data

Post by JohnHasADHD »

I don't know where you can get betting lines - but i know where you can get half time scores

nba stuffer provides team box scores for every game including quarter by quarter scoring - i did not buy it yet for this past shortened season but i did create a database to track a bunch of things and kept the quarter by quarter scoring so i could provide you half time scores...I don't know where to find the lines though - sorry
Post Reply