Play-by-Play Data of Entire NBA Season as .csv Files

Home for all your discussion of basketball statistical analysis.
Post Reply
b-baller23
Posts: 7
Joined: Fri Apr 12, 2013 5:07 pm

Play-by-Play Data of Entire NBA Season as .csv Files

Post by b-baller23 » Tue Apr 01, 2014 5:41 pm

Hi everyone,

I'm currently working on my PhD and I'm looking for the play-by-play data as .csv files for the NBA seasons 2011/12 through the current 2013/14 season. Does anybody know if there is a place where I can download this type of information? I saw that older data from the 2006 through 2010 seasons could be found on basketballgeek.com and I'm looking for the same information (in the same format) for more recent seasons.

Any help would be greatly appreciated! :)

Thank you so much,
Peter

nileriver
Posts: 63
Joined: Thu Jul 18, 2013 3:24 pm
Location: Vancouver, WA

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by nileriver » Wed Apr 02, 2014 3:11 pm

You can purchase it here:http://downloads.nbastuffer.com/. I will warn you that there are definitely mistakes in the data. My biggest problem with it has been who is on the court. Not sure where else you can get this information without doing web scraping (which I recommend). Hopefully other have more reliable information that you can get.

J.E.
Posts: 815
Joined: Fri Apr 15, 2011 8:28 am

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by J.E. » Wed Apr 02, 2014 4:25 pm

nileriver wrote:You can purchase it here:http://downloads.nbastuffer.com/. I will warn you that there are definitely mistakes in the data. My biggest problem with it has been who is on the court. Not sure where else you can get this information without doing web scraping (which I recommend). Hopefully other have more reliable information that you can get.
Do you know, roughly, how many mistakes there are regarding the 'who is on the court' part?

nileriver
Posts: 63
Joined: Thu Jul 18, 2013 3:24 pm
Location: Vancouver, WA

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by nileriver » Wed Apr 02, 2014 8:15 pm

J.E. wrote:
nileriver wrote:You can purchase it here:http://downloads.nbastuffer.com/. I will warn you that there are definitely mistakes in the data. My biggest problem with it has been who is on the court. Not sure where else you can get this information without doing web scraping (which I recommend). Hopefully other have more reliable information that you can get.
Do you know, roughly, how many mistakes there are regarding the 'who is on the court' part?
There are a lot of them. I actually contacted them about all of the errors that I have found as well as recommendations to make the data set richer. They were responsive and have been working on cleaning up and improving the data. The main issue is that (to my knowledge) no publicly available data that includes who is on the court for every play (I believe that nbastuffer uses EPSN's data). I wrote some SQL to identify situations where I "know" that the data of who is on the court is incorrect. I did this by looking for records where the player had an action (rebound, shot, turnover, foul, etc.), but were not listed as being on the court. Since then, I have been working on doing my own web scraping so that I will be in control of all the ETL operations for the play-by-play data.

Fablepongiste
Posts: 2
Joined: Thu Apr 03, 2014 4:40 pm

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by Fablepongiste » Thu Apr 03, 2014 4:45 pm

Hi.
Not sure where else you can get this information without doing web scraping (which I recommend).
Happy to do the web scrapping, but where can we find this information ?
I cannot find any play by play providers telling us who is starting each quarter (leaving the court at the end of each quarter).

Without having this info, it looks very difficult to get who is on court for each play.

Ideally I would like to build similar csv files to the ones prodied by basketballvalue,com http://basketballvalue.com/downloads.php
Any ideas how to get something similar ?

For b-baller23 these files can help but there is no recent history ...

nileriver
Posts: 63
Joined: Thu Jul 18, 2013 3:24 pm
Location: Vancouver, WA

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by nileriver » Fri Apr 04, 2014 4:14 pm

Fablepongiste wrote:Hi.
Not sure where else you can get this information without doing web scraping (which I recommend).
Happy to do the web scrapping, but where can we find this information ?
I cannot find any play by play providers telling us who is starting each quarter (leaving the court at the end of each quarter).

Without having this info, it looks very difficult to get who is on court for each play.

Ideally I would like to build similar csv files to the ones prodied by basketballvalue,com http://basketballvalue.com/downloads.php
Any ideas how to get something similar ?

For b-baller23 these files can help but there is no recent history ...
http://www.apbr.org/metrics/viewtopic.php?f=2&t=8481

b-baller23
Posts: 7
Joined: Fri Apr 12, 2013 5:07 pm

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by b-baller23 » Sat Apr 05, 2014 2:17 pm

Hi everyone,

Thank you very, very much for your responses and help. :)

I'm sorry, I should have probably been a bit more specific as to what exactly I would need. For example, the information about who is on the court is not important for my study and I'm mainly interested in all the information related to the shot attempts. I don't know if it's possible but I would "only" need to know who attempted a shot, whether it was a make/miss, the shot type, the distance, the remaining time and the game score.

Fablepongiste, do you think you could do the web scrapping to extract this type of information from the play-by-play data? I've never done web scrapping before and don't know too much about this kind of stuff, so I'd really appreciate any kind of help.

Thanks a lot! :)

colts18
Posts: 304
Joined: Fri Aug 31, 2012 1:52 am

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by colts18 » Sat Apr 05, 2014 5:11 pm

b-baller23 wrote: I'm sorry, I should have probably been a bit more specific as to what exactly I would need. For example, the information about who is on the court is not important for my study and I'm mainly interested in all the information related to the shot attempts. I don't know if it's possible but I would "only" need to know who attempted a shot, whether it was a make/miss, the shot type, the distance, the remaining time and the game score.
You can find that information on B-R. Here is that information for 2014

http://www.basketball-reference.com/pla ... der_by=fga

b-baller23
Posts: 7
Joined: Fri Apr 12, 2013 5:07 pm

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by b-baller23 » Sat Apr 05, 2014 7:09 pm

Thanks colts, this might be really helpful. Is there a way to download an entire season's worth of data into a single csv file?

colts18
Posts: 304
Joined: Fri Aug 31, 2012 1:52 am

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by colts18 » Sat Apr 05, 2014 7:11 pm

b-baller23 wrote:Thanks colts, this might be really helpful. Is there a way to download an entire season's worth of data into a single csv file?
There is an option to convert that data into CSV at the top of the table. As far as downloading, I don't think you can download any data from B-R. You might have ask Neil Paine that since he works at B-R.

b-baller23
Posts: 7
Joined: Fri Apr 12, 2013 5:07 pm

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by b-baller23 » Sat Apr 05, 2014 7:14 pm

Yes, I saw the csv option at the top. However, it would be very good to have the entire dataset because it would have to be filtered to put it back into chronological order (so I can see in which order shots occurred per game).

ryannow
Posts: 6
Joined: Sat Feb 15, 2014 1:31 am

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by ryannow » Tue Apr 08, 2014 11:49 am

If you just want the shots in chronological order, you can do that just by sorting by date on the search page here. That gives me this list of shots in the 2013-14 season (sort by ascending date to go from oldest to newest).

If you want to download the entire dataset, you'll have a harder time of it. Sports Reference's download policy states that they try to make it easy to export small amounts of data but cannot afford to give away large datasets. This means you can copy-paste the output from the shot finder in csv format easily, but all of those finders only output 100 items at a time. With 191677 shots taken this season and counting, that would be nearly 2000 pages to query and get the data from.

b-baller23
Posts: 7
Joined: Fri Apr 12, 2013 5:07 pm

Re: Play-by-Play Data of Entire NBA Season as .csv Files

Post by b-baller23 » Wed Apr 09, 2014 10:55 am

Hi Ryannow,
Thanks for your reply and the links you posted. :) The way the information is displayed on basketball reference would be perfect for my work but it would indeed be a bit tedious to download nearly 2,000 pages of data per season (and I'm looking for the data of several seasons). Is this aside from nbastuffer.com the only source you all are aware of or does anyone have some other ideas where I should look for this type of play-by-play data?
Thank you very much! :)

Post Reply