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

incorrect json format is returned by APIS #17

Closed
ydevendra opened this issue Aug 15, 2022 · 4 comments
Closed

incorrect json format is returned by APIS #17

ydevendra opened this issue Aug 15, 2022 · 4 comments

Comments

@ydevendra
Copy link

from nsepython import *

print(nsetools_get_quote("reliance"))

This piece of code is returning

{'symbol': 'RELIANCE', 'identifier': '', 'series': 'EQ', 'open': '2590.3', 'dayHigh': '2641.35', 'dayLow': '2582.2', 'lastPrice': '2632', 'previousClose': '2591.1', 'change': 40.9, 'pChange': 1.58, 'totalTradedVolume': 5838244, 'totalTradedValue': 15332513157.68, 'lastUpdateTime': '31-DEC-2999', 'yearHigh': '2856.15', 'yearLow': '2083.4', 'nearWKH': 7.847977172067296, 'nearWKL': -26.33195737736392, 'perChange365d': 20.76, 'date365dAgo': '13-Aug-2021', 'chart365dPath': 'https://static.nseindia.com/sparklines/365d/RELIANCE-EQ.jpg', 'date30dAgo': '15-Jul-2022', 'perChange30d': 7.88, 'chart30dPath': 'https://static.nseindia.com/sparklines/30d/RELIANCE-EQ.jpg', 'chartTodayPath': 'https://static.nseindia.com/sparklines/today/RELIANCEEQN.jpg', 'meta': {'symbol': 'RELIANCE', 'companyName': 'Reliance Industries Limited', 'industry': 'REFINERIES', 'activeSeries': ['EQ'], 'debtSeries': [], 'tempSuspendedSeries': [], 'isFNOSec': True, 'isCASec': False, 'isSLBSec': True, 'isDebtSec': False, 'isSuspended': False, 'isETFSec': False, 'isDelisted': False, 'isin': 'INE002A01018'}}

a valid JSON requires double quotes for its strings.

@palkar
Copy link

palkar commented Aug 17, 2022

Write the following code:
type(nse_get_tools("reliance")).
Should answer your question.

@aeron7 aeron7 closed this as completed Aug 18, 2022
@ydevendra
Copy link
Author

@aeron7 as per documents expectation was json but seems your returning dict.
Anyway thanks for hint.

@ydevendra
Copy link
Author

Seems doc is outdated e.g https://unofficed.com/nse-python/documentation/basic/#stocks-api look for Quote Meta API

@aeron7
Copy link
Owner

aeron7 commented Aug 22, 2022

Yes. Pardon me. I will update it accordingly.

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

3 participants