How to Scrape NBA Stats API with Python

Поділитися
Вставка
  • Опубліковано 16 вер 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...

КОМЕНТАРІ • 19

  • @carlossoto1466
    @carlossoto1466 2 роки тому +1

    This is beautiful!

  • @dani5318
    @dani5318 2 роки тому +1

    AHHHHHHHHHHHHHHHHHHHHH THANK YOU THIS WOOOOOORRRRRRRKKKKKKKKSSSSSSSSSSSSSSSSS

  • @jaymac7342
    @jaymac7342 3 роки тому +1

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

  • @_harout1128
    @_harout1128 2 роки тому

    Lmfao the intro music 😂😂😂😂

  • @r0bi100
    @r0bi100 3 роки тому

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

  • @ugurdev
    @ugurdev 3 роки тому

    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!

  • @NoriegaRekos
    @NoriegaRekos 2 роки тому +1

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

    • @CreativeDataInnovationscom
      @CreativeDataInnovationscom 2 роки тому

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

  • @kev9617
    @kev9617 2 роки тому +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 Рік тому

      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 Рік тому

      @@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.

  • @mawkuri5496
    @mawkuri5496 4 дні тому

    are you banned now?

  • @alissonsoares5264
    @alissonsoares5264 3 роки тому

    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.

  • @fifadoce
    @fifadoce 2 роки тому

    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 2 роки тому

      having same issue here

    • @charlesrios8542
      @charlesrios8542 2 роки тому

      @@akhilreddy5892 same

    • @azain0
      @azain0 2 роки тому

      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 Рік тому

      did u guys ever figure out how to fix it?

  • @CreativeDataInnovationscom
    @CreativeDataInnovationscom 2 роки тому

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