Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newest Version #87

Closed
dtkavana opened this issue Jan 27, 2020 · 2 comments
Closed

Newest Version #87

dtkavana opened this issue Jan 27, 2020 · 2 comments

Comments

@dtkavana
Copy link

The stats api calls are still hanging for me even after the latest update. An example of a call that is hanging is:
NBA.stats.playerStats({ Season: "2019-20" }).then(response => {
this.playerStats = response.leagueDashPlayerStats;
});

@bttmly
Copy link
Owner

bttmly commented Jan 27, 2020

> NBA.stats.playerStats({ Season: "2019-20" }).then(r => console.log(`found ${r.leagueDashPlayerStats.length} entries`))
> found 490 entries

The above worked for me in my Node REPL from my local machine, using nba@4.13.0 installed from NPM, not source. I'm curious where you're running this code? The NBA's API is picky about what IP addresses it accepts requests from. In particular, they block most cloud computing providers. So if you're running this from an EC2 instance, or similar on Azure, or even on something more stripped down like Linode, it will probably hang. I think they do this to make it harder to build production 3rd party applications that use their API – you're blocked in the browser by CORS restrictions, and on the backend by IP address restrictions.

@bttmly
Copy link
Owner

bttmly commented Feb 12, 2020

closing this, feel free to re-open but I'm pretty sure its an issue with IP blocking.

@bttmly bttmly closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants