Skip to content

Commit d1dfaa0

Browse files
authored
Merge pull request #609 from brandonhawi/fix/scoreboard-v2-deprecation
Add deprecation warning to ScoreboardV2 for issue #596
2 parents 7f41421 + f4b9685 commit d1dfaa0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

src/nba_api/stats/endpoints/scoreboardv2.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,50 @@
1+
"""
2+
ScoreboardV2 endpoint for NBA daily game schedule and scores.
3+
4+
.. deprecated:: 2025-26
5+
This endpoint has known issues with line score data for games between
6+
2025-10-22 and 2025-12-25. Please use ScoreboardV3 instead.
7+
ScoreboardV3 is fully backward compatible with all historical seasons.
8+
"""
9+
import warnings
10+
111
from nba_api.stats.endpoints._base import Endpoint
212
from nba_api.stats.library.http import NBAStatsHTTP
313
from nba_api.stats.library.parameters import DayOffset, GameDate, LeagueID
414

515

616
class ScoreboardV2(Endpoint):
17+
"""
18+
ScoreboardV2 endpoint.
19+
20+
.. deprecated:: 2025-26
21+
**DEPRECATION WARNING:** This endpoint has known issues with line score data.
22+
Please use :class:`~nba_api.stats.endpoints.ScoreboardV3` instead.
23+
24+
For 2025-26 season games between October 22, 2025 and December 25, 2025,
25+
the line_score dataset returns empty despite games being available.
26+
27+
ScoreboardV3 is fully backward compatible and resolves this issue.
28+
See: https://github.com/swar/nba_api/issues/596
29+
30+
Args:
31+
day_offset (int, optional): Day offset from game_date.
32+
game_date (str, optional): Game date in YYYY-MM-DD format.
33+
league_id (str, optional): League ID ('00' for NBA).
34+
proxy (str, optional): HTTP/HTTPS proxy for requests.
35+
headers (dict, optional): Custom HTTP headers.
36+
timeout (int, optional): Request timeout in seconds. Defaults to 30.
37+
get_request (bool, optional): Whether to fetch data immediately. Defaults to True.
38+
39+
Example:
40+
>>> # Deprecated (has issues with 2025 early season):
41+
>>> from nba_api.stats.endpoints import ScoreboardV2
42+
>>> scoreboard = ScoreboardV2(game_date='2025-10-22')
43+
>>>
44+
>>> # Recommended (works for all seasons):
45+
>>> from nba_api.stats.endpoints import ScoreboardV3
46+
>>> scoreboard = ScoreboardV3(game_date='2025-10-22')
47+
"""
748
endpoint = "scoreboardv2"
849
expected_data = {
950
"Available": ["GAME_ID", "PT_AVAILABLE"],
@@ -146,6 +187,14 @@ def __init__(
146187
timeout=30,
147188
get_request=True,
148189
):
190+
warnings.warn(
191+
"ScoreboardV2 has known issues with line score data for 2025-26 season games "
192+
"(October 22 - December 25, 2025). Please use ScoreboardV3 instead. "
193+
"ScoreboardV3 is fully backward compatible and works for all historical seasons. "
194+
"See: https://github.com/swar/nba_api/issues/596",
195+
DeprecationWarning,
196+
stacklevel=2
197+
)
149198
self.proxy = proxy
150199
if headers is not None:
151200
self.headers = headers

0 commit comments

Comments
 (0)