bttmly / nba

Node.js client for nba.com API endpoints
MIT License
708 stars 173 forks source link

playerProfile calls returning 500 #27

Closed brandly closed 7 years ago

brandly commented 7 years ago
nba.stats.playerProfile({ 
  PlayerID: 201939
}).then(profile => {
  // do something
}, error => {
  console.log(error)
})

i'm seeing an error like

[Error: 500 Internal Server Error – {"Message":"An error has occurred."}]

i'm guessing the API changed underneath you, but i haven't done any digging yet.

thanks nick!

bttmly commented 7 years ago

😞 Yea I noticed this too – it's causing the test suite to fail. I'll take a spin through stats.nba.com and see if I can find them doing a valid request. Usually the error messages are pretty descriptive (they'll tell you which field is missing or malformed) but this one is a head-scratcher.

brandly commented 7 years ago

ha! yeah, it doesn't give you much to work with.

i just clicked around stats.nba.com a bit, and found a request to http://stats.nba.com/stats/playerprofilev2?LeagueID=00&PerMode=PerGame&PlayerID=203076

since they're using a v2 url now, i'm guess this change affects nba-client-template instead of this repo

hope this helps! ⭐️

bttmly commented 7 years ago

nice find -- thanks!!

bttmly commented 7 years ago

fixed & published in 3.1.1 -- @brandly thanks for the assist!! 🏀