Difficulty Fetching Real-Time Market Data Using NSE Python API

Hello

I am currently working on a project that requires real-time market data from the National Stock Exchange (NSE) through the official NSE Python API. However; I have faced an issue where the real-time stock price data isn’t updating as expected. Initially; the connection to the API works fine; but after some time, the data seems to freeze, and I am unable to fetch the latest prices. :innocent:

The API documentation suggests using the get_live_data() function, but in my case, I receive either outdated data or no data at all after a certain period of time. I have checked my API keys & they seem to be correct, and I have ensured my request is within the rate limits specified by the API. I’ve also tried different stocks, but the problem exist . :upside_down_face: I have referred https://forum.unofficed.com/c/programming/12 selenium guide but the issue remains unresolved .

Has anyone faced similar issues with the NSE Python API? If so; how did you resolve it? :thinking: Any insights into proper connection handling / potential workarounds to confirm continuous data updates would be greatly appreciated.

Thanks in advance for any help! :blush:

Its not problem of API.

The API is just a wrapper to NSE. So NSE datafeed is fluctuating. I was facing same. Its due to some load balancing error on their end. They usually fix these stuff anyways.

So if you fix x, then when they fix it back; then this fix will become new problem… So just wait, it will be fine.

it means they are doing a timeout to your server; this is firewall protection mostly likely with a 30 minute timeout. So quickest solution is add an IP rotator or something like that.

I/We/Most of us uses amazon ec2 bangalore or digital ocean bangalore or google collab. Works fine.