maanavshah / stock-market-india

API for Indian Stock Market's NSE and BSE.
MIT License
854 stars 372 forks source link

Not working as a deployment #12

Closed deepakdhamuria closed 3 years ago

deepakdhamuria commented 3 years ago

Hello @maanavshah first of all, this is an awesome package. Great job on this.

I tried installing this on AWS and Heroku, but it times out on both these cases. Any idea why and how can we proceed in resolving this? I would like to collaborate and take this further.

maanavshah commented 3 years ago

Hi Deepak,

Thanks. The issue is that the URL for NSE has changed. We need to fix it to make it work.

kkirankumar1511 commented 3 years ago

Hello Maanav, Thanks for the great package.. good job. I am also facing the same issue after deploying this app on AWS. its working on my local node server without any issue. could you please let me know what fix we need to apply.

deepakdhamuria commented 3 years ago

@maanavshah and @kkirankumar1511 the thing is, this package scrapes data from NSE website as per my understanding. How it does it is by changing the "Referrer" header to NSE website so that the NSE endpoint thinks it to be its own website and sends back data. Now, this would work from Postman or local without any issues, but won't work from a server as the security would strip that header and send it.

So, if we can figure out how to change that header in a server environment, we would be able to make this working.

In short, this cannot be used for a production implementation.

deepakdhamuria commented 3 years ago

I am closing this because I don't think this might be possible to implement this in a server.