Comments (6)
Seems like none of the boxscores work however i can get some of the others
from nba_api.
Do i need special headers.
Update added the chrome headers to postman and it worked! Now python...
from nba_api.
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.
@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.
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.
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)
- No Endpoint for Opponent Shooting (not just 2pt and 3pt)
- A Little Help: How to pull player "playtype" stats. Is there an endpoint? HOT 1
- Question: Team defensive stats vs position HOT 3
- [Bug]: Road Games not returning from cumestatsplayergames when using "location_nulalble" parameter HOT 1
- works on local flask server but not on GCP? HOT 3
- Any way to obtain the score that player has in live match? HOT 1
- Slack HOT 4
- Starting Lineups HOT 2
- [Bug]: Potential Assists HOT 1
- [Bug]: Class - PlayerPositionAbbreviationNullable in nba_api/docs/nba_api/stats/library/paramters.md is not working HOT 2
- [Bug]: Why are there decimals in fields that should not have decimals? For example, opponent points. HOT 4
- How do I pull a certain player game splits/stats for the last "n" of games? HOT 1
- Play by Play not starting from 0-0 for these Games
- [Bug]: Name Zhou Qi has no first name in the dictionar
- Game_id HOT 2
- [Bug]: playbyplayv3 throws an error when running get_dat_sets() within get_request HOT 1
- [Bug]: teams.py shows the Golden State Warrior's city name as "Golden State" HOT 1
- No response trying to get the data I need HOT 3
- [Bug]: BoxScoreMiscV3 and related classes and Start_Period and End_Period
- [Feature Request] WNBA players & teams in static data HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nba_api.