You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, this api wrapper is wonderful and provides so much vital information. Thank you to all who have worked on it!
I keep running into this timeout error (shown below) and based on looking at some previous issues, it might be because my code is pulling from the api too much. Here is the rough rundown of my code and the endpoints I am using. I'm wondering if I'm calling too much or there is some other issue.
I'm pulling the current games that are happening on a certain date. LeagueGameFinder(date_from_nullable=yesterday_date_string, date_to_nullable=yesterday_date_string, league_id_nullable='00')
I'm getting the list of players that played in the game. BoxScoreTraditionalV2(game_id=game_id)
Getting their names. players.find_player_by_id(player)['full_name'], ": N/A"
Using BoxScoreSummaryV2(game_id=game_id) and connecting it to the game ids I had earlier to get the full names of the teams playing.
Since there are a lot of games that can go on in a day and a lot of players there can be 100+ calls I think. Is there an endpoint that gives you this information faster?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/williamwu/Sterdy/nba-twitter.py", line 200, in <module>
get_games()
File "/Users/williamwu/Sterdy/nba-twitter.py", line 49, in get_games
gamelog = endpoints.PlayerGameLog(player_id=player, date_to_nullable=yesterday_date_string, date_from_nullable=yesterday_date_string)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nba_api/stats/endpoints/playergamelog.py", line 40, in __init__
self.get_request()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nba_api/stats/endpoints/playergamelog.py", line 43, in get_request
self.nba_response = NBAStatsHTTP().send_api_request(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nba_api/library/http.py", line 130, in send_api_request
response = requests.get(url=base_url, params=parameters, headers=request_headers, proxies=proxies, timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/adapters.py", line 532, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='stats.nba.com', port=443): Read timed out. (read timeout=30)
The text was updated successfully, but these errors were encountered:
Firstly, this api wrapper is wonderful and provides so much vital information. Thank you to all who have worked on it!
I keep running into this timeout error (shown below) and based on looking at some previous issues, it might be because my code is pulling from the api too much. Here is the rough rundown of my code and the endpoints I am using. I'm wondering if I'm calling too much or there is some other issue.
LeagueGameFinder(date_from_nullable=yesterday_date_string, date_to_nullable=yesterday_date_string, league_id_nullable='00')
BoxScoreTraditionalV2(game_id=game_id)
players.find_player_by_id(player)['full_name'], ": N/A"
BoxScoreSummaryV2(game_id=game_id)
and connecting it to the game ids I had earlier to get the full names of the teams playing.Since there are a lot of games that can go on in a day and a lot of players there can be 100+ calls I think. Is there an endpoint that gives you this information faster?
The text was updated successfully, but these errors were encountered: