APBRmetrics

The discussion of the analysis of basketball through objective evidence, especially basketball statistics.
It is currently Thu Aug 21, 2014 11:56 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Wed Feb 15, 2012 2:18 am 
Offline

Joined: Wed Feb 15, 2012 2:16 am
Posts: 21
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?


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 11:41 am 
Offline

Joined: Fri Apr 15, 2011 8:28 am
Posts: 620
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

_________________
http://stats-for-the-nba.appspot.com/


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 3:20 pm 
Offline

Joined: Wed Feb 15, 2012 2:16 am
Posts: 21
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.


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 3:44 pm 
Offline

Joined: Tue Dec 27, 2011 10:36 pm
Posts: 6
espn has shot distance and x,y coordinates for all shots

you have to parse it from
'http://sports.espn.go.com/nba/gamepackage/data/shot?gameId=' + game_id


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 3:49 pm 
Offline

Joined: Wed Feb 15, 2012 2:16 am
Posts: 21
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 :)


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 4:01 pm 
Offline

Joined: Tue Dec 27, 2011 10:36 pm
Posts: 6
i use python with BeautifulSoup, it is quite simple to do

Code:
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


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 4:20 pm 
Offline

Joined: Wed Feb 15, 2012 2:16 am
Posts: 21
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.


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 4:53 pm 
Offline

Joined: Tue Dec 27, 2011 10:36 pm
Posts: 6
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


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 5:12 pm 
Offline

Joined: Wed Feb 15, 2012 2:16 am
Posts: 21
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 :)


Top
 Profile  
 
PostPosted: Sun Jun 03, 2012 3:32 am 
Offline

Joined: Sun Jun 03, 2012 3:27 am
Posts: 2
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.


Top
 Profile  
 
PostPosted: Wed Jun 06, 2012 2:36 am 
Offline

Joined: Wed Feb 15, 2012 2:16 am
Posts: 21
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group