☰
Login
Signup
Home
›
API clients
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
153
Node JS client
40
Go client
793
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
992
Java client
1.1K
API clients
403
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
April 2020
dm121
April 2020
tahseen
Parse Json
dm121
April 2020
in
API clients
@sujith
How do I get last_price from this response from quote/ltp?i=NSE:INFY, in Js. I am able to get the same in Python, but struggling in Js.
{"status":"success","data":{"NSE:INFY":{"instrument_token":408065,"last_price":658}}}
I am able to get the data element. It is nested Json.
var jsonText = response.getContentText();
var Json = JSON.parse(jsonText);
var data = Json.data
How to retrieve "last_price" element in JavaScript. Thanks.
//Mohan
Tagged:
parse
json
JS
tahseen
April 2020
@dm121
I think you should use response.json()
dm121
April 2020
Got this working. There was a bug in the code in forming the URL. Thanks for the reply.
Sign In
or
Register
to comment.
I think you should use response.json()