-
Notifications
You must be signed in to change notification settings - Fork 174
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
Stats API rejecting traffic from AWS? #41
Comments
Wow I'm looking over your repo and I'm basically building a very very simple version of what you have! Anyways, I also have had the same issue with the data not being able to load (both on my Digital Ocean server and when locally with a VPN) , but being also to load the data just fine locally (without VPN). I've had a personal workaround by including this library into my own project, but I'm not sure if you could apply that to your project. |
@jonathandiep I'm a bit confused... are you saying when you use this library (i.e. |
@toddwschneider Sorry if I was not being clear. I'll try to clarify and let me know if it makes sense. I originally had a server that used this API to serve data to my front end application. It worked locally, but not on Digital Ocean. So instead of using this library on the server, I used it on my front end application. That way instead of Digital Ocean requesting the NBA data, the front end application will request the NBA data. And for some reason that works 🤔 |
@jonathandiep the "front end application" you describe is running on your own local machine, correct? I'm still not sure I understand from your description, but it sounds like you have not been able to request data from stats.nba.com from within DigitalOcean, which is consistent with my inability to request data from within AWS (I also tried DigitalOcean and it didn't work there either) |
I had the same issue on my AWS to stats.nba.com communication. I resolved by assigning IPv6 to my EC2 instance and it started to work. I'm not 100% sure that it is coincidence or not. |
@toddwschneider Yeah I haven't been able to request data from stats.nba.com through Digital Ocean. And so my workaround was to implement this NBA API into my front end project itself (I have a React/JavaScript project that makes importing npm packages really easy). This means that any browser that uses my web application will access stats.nba.com directly and that it is not dependent on a server (like AWS/Digital Ocean) to fetch that data. Also I'm thinking that stats.nba.com is somehow filtering requests, but I'm not too certain about it. Seems like others have been able to successfully retrieve data by modifying the network requests. |
Is there any update on this My shot chart app is not working all together wondering if it is a missing header i will try to experiment this week to get things working has my website is unusable at the moment. If I learn anything ill post an update here. |
My strong suspicion is that NBA is blocking known cloud provider IP address blocks. In particular, that would fully account for requests with the exact same headers and parameters appear to work from some hosts and not others. @nharrisanalyst where do you host your app? |
I host it on Heroku and I learned from the recent aws outage that it is built on the back of AWS, but recently Stats.NBA is not excepting request from the app when it is locally hosted. Thanks for the Help too. |
Experiencing a similar problem with kshvmdn/nba.js (kshvmdn/nba.js#16). Requests seem to be hanging on Heroku/AWS, but working fine on Digital Ocean and Azure. Local requests started hanging as well, had to make a few header changes for the requests to resolve again. |
I got the whole app to work locally hosted and I migrated it to digital ocean but even on digital ocean that stats.nba.com request are hanging |
Having similar issues. I'm able to hit the endpoint fine locally, but on my ec2 instance it's hanging. |
There is no solution on our side it is an issue with the stats.nba.com api. |
I added a note to the readme with a link to this issue. I'm going to close this issue, nothing we can do to fix it. |
Hi just wondering if anyone has had any luck finding a work around for this issue. I have been searching high and low but don't see that anyone has found a fix but thought I'd check. I am running into the same problem on my heroku rails app....works locally but not from heroku when trying to reach this url: Thanks, Frank |
I even managed to get my local IP addressed blocked due to intermittent stat-retrieval testing which met their threshold to get the IP banned (so much for fostering app development). I can confirm that a VPN works for getting around this IP-based blocking. Unfortunately, I haven't figured out anything more optimal than that. |
@frankburke333 @KZeni I have not I did put together this app to collect all shots into a database: https://github.com/toddwschneider/nba-shots-db. But again, it only works from my local machine, not AWS |
Thanks so much for the responses guys. It's such a frustrating API to work with for so many reasons. I'll try out the VPN option. Todd, great job on the site. Long live the mid-range jumper! :) The attack on this shot is in fashion but its no coincidence that every great player you can name over the last 20 years feasted in the midrange (Kobe, KD, Wade, Lebron etc.). |
For those who want to collect data by just running jupyter notebook on the cloud, one alternative is google colab. I checked with several different urls, it seems to work |
This still appears to be the case. I tried writing a simple Express server and hosting it on Netlify. Just using Functions only, simple little app. The requests all time out, presumably because they use AWS infrastructure. |
About a year ago I wrote a shot chart app in R that uses the the
shotchartdetail
endpoint: https://github.com/toddwschneider/ballrRecently my hosted version of the app stopped working. The app still works fine if I run it on my own computer. It seems like the problem is that the Stats API is rejecting requests that come from AWS, where my app is hosted. I've tried tinkering with request headers but haven't been able to make anything work.
Just curious if anyone here has ideas for how to make a request to
shotchartdetail
from within AWS. Thanks!The text was updated successfully, but these errors were encountered: