[Solved] How should I get a value from this .JSON?

Hi everyone!

I am using an API, which returns this .JSON response -

[{"place_id":"6092977","licence":"https:\/\/locationiq.com\/attribution","osm_type":"node","osm_id":"664161333","boundingbox":["21.0779469","21.3979469","81.4736833","81.7936833"],"lat":"21.2379469","lon":"81.6336833","display_name":"Raipur, Chhattisgarh, 493332, India","class":"place","type":"city","importance":0.97376296369788,"icon":"https:\/\/locationiq.org\/static\/images\/mapicons\/poi_place_city.p.20.png"}]

Formatted .JSON


From which, I would like to get the lat, long & display_name.

I have tried this, but I am getting undefined -

I must be doing something wrong - if you have any ideas, they will help me a lot :slightly_smiling_face:

Thanks! :blush:

Hi,

check response, status and error. If all good convert response to object

изображение

3 Likes

Thanks a lot, @actech! :wave:

As always, you solved my big problem :smile:

Thank you so much! :blush: