☰
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
14.1K
All Categories
0
Incidents
157
Node JS client
41
Go client
795
.Net API client
385
Kite Publisher
537
.Net / VBA / Excel (3rd party)
463
Algorithms and Strategies
1K
Java client
1.1K
API clients
407
PHP client
4.1K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
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()