# \[Solved\] Geocoding API to locate the address

**URL:** https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005
**Category:** Questions about Thunkable X
**Tags:** solved, map
**Created:** [March 20, 2021, 7:15am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005 "2021-03-20T07:15:39Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![sasi26preetha4r](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@sasi26preetha4r](https://community.thunkable.com/u/sasi26preetha4r)
#### Post date: [March 20, 2021, 7:15am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/1 "2021-03-20T07:15:40Z")

</div>

Hi,

I am trying to get the address details via following API [https://api.geoapify.com/v1/geocode/search?text=](https://api.geoapify.com/v1/geocode/search?text=)[place name]&apiKey=YOUR\_API\_KEY

Below is the Json response:

{“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“properties”:{“datasource”:{“sourcename”:“openstreetmap”,“attribution”:“© OpenStreetMap contributors”,“license”:“Open Database Licence”,“url”:“[https://www.openstreetmap.org/copyright"},“name”:"Annai](https://www.openstreetmap.org/copyright%22%7D,%22name%22:%22Annai) Arul Hospital”,“street”:“Tambaram-Sriperumbudur Highway”,“neighbourhood”:“Peerkankaranai”,“suburb”:“Perungalathur”,“city”:“Tambaram”,“county”:“Tambaram”,“state\_district”:“Chengalpattu District”,“state”:“Tamil Nadu”,“postcode”:“600063”,“country”:“India”,“country\_code”:“in”,“lon”:80.08801007859745,“lat”:12.9207815,“formatted”:“Annai Arul Hospital, Tambaram-Sriperumbudur Highway, Tambaram - 600063, Tamil Nadu, India”,“address\_line1”:“Annai Arul Hospital”,“address\_line2”:“Tambaram-Sriperumbudur Highway, Tambaram - 600063, Tamil Nadu, India”,“result\_type”:“amenity”,“rank”:{“importance”:0.30100000000000005,“popularity”:1.6891035262901575,“confidence”:1,“match\_type”:“full\_match”},“place\_id”:“51d85206f5a1055440590e863aac70d72940f00102f90125a4fe1b00000000c00201920313416e6e6169204172756c20486f73706974616c”},“bbox”:[80.0877133,12.9203822,80.0884227,12.9210841],“geometry”:{“type”:“Point”,“coordinates”:[80.08801007859745,12.9207815]}}],“query”:{“text”:“annai arul hospital”}}

I do not get any error but I get the reply as undefined.

Sharling the link [Thunkable](https://x.thunkable.com/copy/08d7bf3b462f6c50e0881ca9daaa499b)

Your input/assistance would be highly appreciated.

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [March 20, 2021, 8:18am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/2 "2021-03-20T08:18:37Z")

</div>

Hey @sasi26preetha4r - there are lots of great JSON tutorials in the community.

Here are two of them:

> [@JSON / Object Tutorial](https://community.thunkable.com/t/json-object-tutorial/1085666):
>
> Working with JSON data is a common Thunkable Discussion topic. Here I will try to answer the most common questions and provide solutions to the most common problems. This tutiorial has six parts: [Basic JSON](https://community.thunkable.com/t/json-object-tutorial/1085666/2)[JSON Errors](https://community.thunkable.com/t/json-object-tutorial/1085666/)[Intermediate JSON](https://community.thunkable.com/t/json-object-tutorial/1085666/4)[Advanced JSON](https://community.thunkable.com/t/json-object-tutorial/1085666/5)[Firebase Realtime DB and Cloud Variables](https://community.thunkable.com/t/json-object-tutorial/1085666/6)[Web API](https://community.thunkable.com/t/json-object-tutorial/1085666/7) The companion project with all examples can be [found here](https://x.thunkable.com/projectPage/601efcc715209c1fd57a3921).

> [@API JSON Tutorial (Video)](https://community.thunkable.com/t/api-json-tutorial-video/1140575):
>
> Using APIs in Thunkable and understanding how to parse JSON to get certain data from the API response is both a popular and a difficult aspect of using Thunkable. It’s not so much difficult because of Thunkable but because every API url format is different, every API documentation is different, every JSON response is different, etc. In this video, I spend a lot of time talking you through some best practices. It’s not a quick tutorial because if you rush through setting up an API in Thunkable, …

Hope that helps!

---

<div class="post-metadata">

### Author: ![sasi26preetha4r](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@sasi26preetha4r](https://community.thunkable.com/u/sasi26preetha4r)
#### Post date: [March 20, 2021, 8:53am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/3 "2021-03-20T08:53:51Z")

</div>

Thank you so much. I did go through the API JSON tutorial video and understood how to get data.

Followed the same method but for some reason I do not get the desired output, thus seek assistance.

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [March 20, 2021, 12:30pm UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/4 "2021-03-20T12:30:17Z")

</div>

@sasi26preetha4r got it.

Can you share a screenshot of the blocks you’re using and a screenshot of the output you’re getting?

---

<div class="post-metadata">

### Author: ![sasi26preetha4r](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@sasi26preetha4r](https://community.thunkable.com/u/sasi26preetha4r)
#### Post date: [March 20, 2021, 1:04pm UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/5 "2021-03-20T13:04:34Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/af850e763baf49fc087a7ceb244df34b299a2e7e.png)

 ![WhatsApp Image 2021-03-20 at 6.32.36 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/4/1445dc31774b1722fb73381985535a06e2163630.jpeg)

Here are the screenshots.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [March 20, 2021, 5:24pm UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/6 "2021-03-20T17:24:45Z")

</div>

The JSON response you posted above isn’t valid so I can’t re-format it. you can use [this website](https://codebeautify.org/jsonviewer) to validate your JSON before posting it. Can you post a screenshot of the JSON response?

---

<div class="post-metadata">

### Author: ![sasi26preetha4r](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@sasi26preetha4r](https://community.thunkable.com/u/sasi26preetha4r)
#### Post date: [March 21, 2021, 5:08am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/7 "2021-03-21T05:08:32Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/7/97b5c7e4d7d7dd471a11c895ca6227624e41be9c.png)

Have shared the screenshot Tatiang.

Also sharing the API website([https://www.geoapify.com/geocoding-api](https://www.geoapify.com/geocoding-api)) screenshot

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/0/1038712caed4658ab2667bd5ce6440c4277f88f0.png) .

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [March 21, 2021, 6:32am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/8 "2021-03-21T06:32:57Z")

</div>

I would expect Label1’s Text to be “Tambaram”. Make sure you test it on a mobile device. Some APIs don’t work in a browser.

---

<div class="post-metadata">

### Author: ![sasi26preetha4r](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@sasi26preetha4r](https://community.thunkable.com/u/sasi26preetha4r)
#### Post date: [March 21, 2021, 7:39am UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/9 "2021-03-21T07:39:17Z")

</div>

Yahooo:) Thank you so much Tatiang.

I found why I got undefined before and how I am getting the city name printed now, b’coz I searched along with the city name thus I got undefined and now when I searched with the place name alone I get the city name displayed.

Your tutuioal video is very informative and helpful , from there is where I learnt how to read datd from Json response.

Thanks again.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:25pm UTC](https://community.thunkable.com/t/solved-geocoding-api-to-locate-the-address/1177005/10 "2024-11-08T13:25:48Z")

</div>


