VarunS2002 / Python-NSE-Option-Chain-Analyzer

The NSE has a website which displays the option chain in near real-time. This program retrieves this data from the NSE site and then generates useful analysis of the Option Chain for the specified Index or Stock. It also continuously refreshes the Option Chain and visually displays the trend in various indicators useful for Technical Analysis.
GNU General Public License v3.0
391 stars 204 forks source link

Need Help with New Nse India Site #9

Closed sonisultania closed 3 years ago

sonisultania commented 3 years ago

Hey,

I came across your solution to access the new nse site on stackoverflow as I was running into authentication issues too. Your solution is neat and works. Could you help me with me some documentation though? I want to understand why you have used f before the url. Here's the stackoverflow soln I'm referring to:

https://stackoverflow.com/questions/63981362/python-requests-get-returns-response-code-401-for-nse-india-website

Thank You!

P.S: I'm a python newbie

VarunS2002 commented 3 years ago

@sonisultania Guide : https://www.geeksforgeeks.org/formatted-string-literals-f-strings-python/ In that example on stackoverflow, I haven't used the 'f' so you can remove it.

sonisultania commented 3 years ago

Thanks for your reply. Sorry to bug you again, but I tried running the code this morning and it works for INDEX data (NIFTY, BANKNIFTY, FINNIFTY). But fails for stock option data. Attaching the code I'm using (it's markdown file).

My earlier code was working fine (on old NSE site) but with the new api I'm running into issues.

Thanks again for your help!

On Fri, Jan 22, 2021 at 11:33 AM Varun Shanbhag notifications@github.com wrote:

@sonisultania https://github.com/sonisultania Guide : https://www.geeksforgeeks.org/formatted-string-literals-f-strings-python/ In that example on stackoverflow, I haven't used the 'f' so you can remove it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9#issuecomment-765152705, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEI6DSE5G7MZPDZLFTMDS3EIMZANCNFSM4WNAAXXQ .

VarunS2002 commented 3 years ago

@sonisultania The api link for stocks and indices are different. Try this: https://www.nseindia.com/api/option-chain-equities?symbol=ACC

sonisultania commented 3 years ago

Oops. That was such a dumb mistake, should have caught it earlier :D Changed it and works fine now . Thanks a ton for your help!

PS: I might bug you again in future

On Fri, Jan 22, 2021 at 12:21 PM Varun Shanbhag notifications@github.com wrote:

@sonisultania https://github.com/sonisultania The api link for stocks and indices are different. Try (this)[https://www.nseindia.com/api/option-chain-equities?symbol=ACC]

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9#issuecomment-765177345, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEI7RTHSHV4F2KG67ID3S3EN5LANCNFSM4WNAAXXQ .

VarunS2002 commented 3 years ago

@sonisultania No problem dude :)

sonisultania commented 2 years ago

Hey,

Do you still access this? I'm getting an error while accessing the NSE website using Python. Do let me know if you could help me with this.

Regards

On Fri, Jan 22, 2021 at 7:24 PM Varun Shanbhag @.***> wrote:

Closed #9 https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9#event-4238653152, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEI3LC3KS6PB6AN7PWA3S3F7QXANCNFSM4WNAAXXQ .

VarunS2002 commented 2 years ago

Hey, Do you still access this? I'm getting an error while accessing the NSE website using Python. Do let me know if you could help me with this. Regards On Fri, Jan 22, 2021 at 7:24 PM Varun Shanbhag @.***> wrote: Closed #9 <#9>. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEI3LC3KS6PB6AN7PWA3S3F7QXANCNFSM4WNAAXXQ .

@sonisultania Are you getting an error while using my program?

sonisultania commented 2 years ago

Yes, I'm getting an error while using ur earlier program. It was working fine till March expiry. Not working since y'day. I'm getting a timeout error. I even changed the header information as per the latest on NSE website. Still getting a request timeout error.

Is it working for you?

On Sat, Apr 2, 2022 at 1:39 PM Varun Shanbhag @.***> wrote:

Hey, Do you still access this? I'm getting an error while accessing the NSE website using Python. Do let me know if you could help me with this. Regards … <#m-2241220701909887541> On Fri, Jan 22, 2021 at 7:24 PM Varun Shanbhag @.***> wrote: Closed #9 https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9 <#9 https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9>. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#9 (comment) https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9#event-4238653152>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEI3LC3KS6PB6AN7PWA3S3F7QXANCNFSM4WNAAXXQ .

@sonisultania https://github.com/sonisultania Are you getting an error while using my program?

— Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9#issuecomment-1086583521, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEI6Z4R5COBK7HW67NRTVC76DPANCNFSM4WNAAXXQ . You are receiving this because you were mentioned.Message ID: @.*** com>

VarunS2002 commented 2 years ago

@sonisultania Which earlier program?

sonisultania commented 2 years ago

The earlier code for option chain data extraction, it's there in the chain mail.

My program is now working, apparently the header info needed to be changed.

Thanks for responding to my email & apologies for bugging you :)

On Sat, Apr 2, 2022 at 10:06 PM Varun Shanbhag @.***> wrote:

@sonisultania https://github.com/sonisultania Which earlier program?

— Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Python-NSE-Option-Chain-Analyzer/issues/9#issuecomment-1086673952, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCGEIY6MM46YWBTLWH37Z3VDBZPHANCNFSM4WNAAXXQ . You are receiving this because you were mentioned.Message ID: @.*** com>

VarunS2002 commented 2 years ago

@sonisultania No problem