Video není dostupné.
Omlouváme se.

How to Scrape NBA Stats API with Python

Sdílet
Vložit
  • čas přidán 19. 08. 2024
  • Learn how to scrape the NBA Stats API with Python so you can download all of the NBA Data to a local CSV file. We will use Pandas and the Python Requests modules to make this happen. This is a great project for anyone looking to build an NBA Fantasy Basketball model!
    Step-by-Step Article: / building-an-nba-mysql-...
    GitHub Repo: github.com/Jma...
    Greg Reda Blog Post: www.gregreda.co...

Komentáře • 18

  • @carlossoto1466
    @carlossoto1466 Před 2 lety +1

    This is beautiful!

  • @dani5318
    @dani5318 Před 2 lety +1

    AHHHHHHHHHHHHHHHHHHHHH THANK YOU THIS WOOOOOORRRRRRRKKKKKKKKSSSSSSSSSSSSSSSSS

  • @_harout1128
    @_harout1128 Před 2 lety

    Lmfao the intro music 😂😂😂😂

  • @ugurdev
    @ugurdev Před 3 lety

    Thanks Jabe, I tried doing this using the curl on a rest.api client to generate the code but could not get the request to work at all. This one did the trick.
    Subbed!

  • @jaymac7342
    @jaymac7342 Před 3 lety +1

    I followed this exactly and I keep getting a empty set somehow at the end any help would be appreciated.

  • @r0bi100
    @r0bi100 Před 3 lety

    What about lineup starters? One key info some person personally needs

  • @kev9617
    @kev9617 Před rokem +1

    10:15 I keep getting an error saying 65 columns passed, passed data had 68 columns.
    For future people using this: NBA Advanced stats added 3 more columns, check in leagedashplayerstats as shown in 3:00 to see the actual column lists size which updated from 65 to 68 as of this comment date.
    I had to add in 3 more columns: 'nickname', 'wnba_fantasy_pts_rank', AND 'leaguedashplayerstats'.
    Problem solved.

    • @jaredhutchinson4629
      @jaredhutchinson4629 Před rokem

      Seeing that you're the latest to do this even after 2 years, were you able to create what you needed? For some reasone at 8:59 I created a print for "player_info" but nothing came of it. Which makes me think "player_info = response['resultSets'][0]['rowSet']" isn't working or the headers is wrong for me.

    • @kev9617
      @kev9617 Před rokem

      @@jaredhutchinson4629 Yes, I was able to make it but I didn't really finish it all the way to the end. Just enough to see that it works.

  • @NoriegaRekos
    @NoriegaRekos Před 2 lety +1

    great tutorial! my question is how can i download the csv file after doing everything? haha

    • @CreativeDataInnovationscom
      @CreativeDataInnovationscom Před 2 lety

      There's an another way to do this directly in Excel using PowerQuery. Check out this video: czcams.com/video/BlJk-RD3rAI/video.html

  • @fifadoce
    @fifadoce Před 2 lety

    Does anyone else get JSONDecodeError: Expecting value: line 1 column 1 (char 0) when running the response command?
    I've tried to stack overflow myself out but nothing I did worked. Help please 🙏

    • @akhilreddy5892
      @akhilreddy5892 Před 2 lety

      having same issue here

    • @charlesrios8542
      @charlesrios8542 Před 2 lety

      @@akhilreddy5892 same

    • @azain0
      @azain0 Před rokem

      make sure you're requesting from the correct url and using the correct headers described in the video.
      that error comes from having a blank json file which means you either requested the wrong url (so you weren't able to get any data so the json was empty) or you got cockblocked by adam silver (because he detected you were running a python script since you didn't use the headers so you weren't able to extract anything)

    • @ryanuyeki5357
      @ryanuyeki5357 Před rokem

      did u guys ever figure out how to fix it?

  • @alissonsoares5264
    @alissonsoares5264 Před 3 lety

    Hi Jabe,
    Congratulations on the job, I'm trying to develop something that consumes NBA stats.
    but I run into a problem, following your steps my dataframe only contains 23 columns instead of 65
    could you let me know if there is anything i can do?
    again congrats.

  • @CreativeDataInnovationscom

    There's an another way to do this directly in Excel using PowerQuery. Check out this video: czcams.com/video/BlJk-RD3rAI/video.html