bttmly / nba

Node.js client for nba.com API endpoints
MIT License
710 stars 180 forks source link

Play by play call seems very delayed #78

Closed switz closed 4 years ago

switz commented 4 years ago

When calling play by play, it rarely seems to be "live", often being 5-10 minutes behind the game. This contrasts to this direct endpoint, which seems to be very "live" (~10s): https://data.nba.com/data/10s/v2015/json/mobile_teams/nba/2019/scores/pbp/0021900110_full_pbp.json

Any ideas why?

bttmly commented 4 years ago

are you referring to the nba.stats.playByPlay method? If so, it seems that nba.com is migrating away from the endpoints hosted on stats.nba.com (which are the endpoints used by this library for the nba.stats namespace) to newer endpoints on data.nba.com (which is where the endpoint you noted lives).

Adding new endpoints is somewhat laborious – currently it involves navigating around stats.nba.com and capturing requests their site makes. This task could likely be somewhat automated but that's an undertaking on its own. There are a few data.nba.com endpoints supported by this package (under nba.data – you can check the test file to see a list) but I haven't had time to further expand the list. Pull requests very welcome though!