Giter VIP home page Giter VIP logo

Comments (6)

shaunwhyte avatar shaunwhyte commented on May 21, 2024

Seems like none of the boxscores work however i can get some of the others

from nba_api.

shaunwhyte avatar shaunwhyte commented on May 21, 2024

Do i need special headers.
Update added the chrome headers to postman and it worked! Now python...

from nba_api.

swar avatar swar commented on May 21, 2024

@shaun2416

That link is working for me. You may need special headers to mimic your browser, because I do not know if headers are specific to a certain region. Someone from France had luck by changing the headers.

from nba_api.

rsforbes avatar rsforbes commented on May 21, 2024

@shaun2416 - Try the following...

#Get the Pacers team_id
from nba_api.stats.static import teams
nba_teams = teams.get_teams()

#Select the dictionary for the Pacers, which contains their team ID
pacers = [team for team in nba_teams if team['abbreviation'] == 'IND'][0]
pacers_id = pacers['id']

#Query for the last regular season game where the Pacers were playing
from nba_api.stats.endpoints import leaguegamefinder
from nba_api.stats.library.parameters import Season
from nba_api.stats.library.parameters import SeasonType

gamefinder = leaguegamefinder.LeagueGameFinder(team_id_nullable=pacers_id,
                            season_nullable=Season.default,
                            season_type_nullable=SeasonType.regular)  

games_dict = gamefinder.get_normalized_dict()
games = games_dict['LeagueGameFinderResults']
game = games[0]
game_id = game['GAME_ID']

#boxscoreadvancedv2
from nba_api.stats.endpoints import boxscoreadvancedv2
boxscore = boxscoreadvancedv2.BoxScoreAdvancedV2(game_id)
boxscore.get_normalized_json()

from nba_api.

shaunwhyte avatar shaunwhyte commented on May 21, 2024

Yeah i think it might be a region thing cos I had some headers that worked then put my vpn on then it stopped Thanks

from nba_api.

swar avatar swar commented on May 21, 2024

Headers may be specific to region. If you are seeing issues with requests, you should try changing your headers. This especially applies if you are not from the US.

from nba_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.