# \[Solved\] Google Places API (JSON) and List Viewer

**URL:** https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028
**Category:** Questions about Thunkable X
**Tags:** solved, lists, webapi, json
**Created:** [May 26, 2019, 6:04pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028 "2019-05-26T18:04:44Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [May 26, 2019, 6:04pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/1 "2019-05-26T18:04:44Z")

</div>

Hi,

I have trouble getting data from the Google Places API onto a list in my app.  
The list stays empty.

It works with a different web API ([api.obenbrewerybd.org](http://api.obenbrewerybd.org)) and I get data in the list, so there must be a problem with the data I get back from Google.

The Google Places API URL works, as I get results when opening it directly in the browser (see screenshot).  
I want to get the results from “name” in the list in the app.

Can anyone help me here please, as I am stuck.

Thanks!

 ![screenshot-places-api](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/239912f41f894c71fff07bbc23539f03de51deee.png) ![screenshot-thunkable](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5b7a68ac33b5d823016ad96de535d95a7640f724.png)

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [May 26, 2019, 7:00pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/2 "2019-05-26T19:00:19Z")

</div>

Hi,

To access the JSON node, you must specify the **full path from the root node** , as with file names. If you specify myFile.txt, the computer will not find it, because it is not clear in which folder this myFile.txt is located.

---

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [May 26, 2019, 8:48pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/3 "2019-05-26T20:48:18Z")

</div>

Hi,  
thanks for your help!

I don’t really understand what I have to do now.  
Is this something I can do with Thunkable?

---

<div class="post-metadata">

### Author: ![joannietw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/joannietw/32/30139_2.png) [@joannietw](https://community.thunkable.com/u/joannietw)
#### Post date: [May 27, 2019, 3:53am UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/4 "2019-05-27T03:53:36Z")

</div>

@Joey, the problem is caused from your blocks - get property “name” of object “j”. This is wrong because you give the incorrect path to access the “name” property.

I look the JSON file you attach, you can try to do like this to access “name”:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/9/899e66ef249d1cc4d5b07484a7ec9ea4ac8add63.png)

---

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [May 27, 2019, 3:29pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/5 "2019-05-27T15:29:58Z")

</div>

@joannietw thanks, I tried that but it still does not work and the list stays empty.

Do you have any other idea? I think we’re almost there.

Your help is really appreciated!

 ![06](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/4/d45d12303fe2123ef19b71ad26df84ce5df32253.png)

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [May 27, 2019, 6:20pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/6 "2019-05-27T18:20:43Z")

</div>

You are trying to move a 200 kg barbell at a time. It is very difficult. Try to move the bar in parts. To do this, remove the “for each item” loop and try to get the value of the “name” field. If this happens, then after that you can try to use the cycle.

But you can do it easier - give us this JSON file so that someone can solve this problem for you.

---

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [May 27, 2019, 8:14pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/7 "2019-05-27T20:14:53Z")

</div>

Here is an example JSON response from the Google Places API:  
[https://developers.google.com/places/web-service/search#nearby-search-and-text-search-responses](https://developers.google.com/places/web-service/search#nearby-search-and-text-search-responses)

Here I would like to get for example the name in line 13:  
“name” : “Rhythmboat Cruises”

Thanks!

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [May 28, 2019, 6:42am UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/8 "2019-05-28T06:42:05Z")

</div>

Check it

[https://x.thunkable.com/projects/5cecd709b8be7e77b3b6a3bf/project/properties/designer/](https://x.thunkable.com/projects/5cecd709b8be7e77b3b6a3bf/project/properties/designer/)

---

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [May 30, 2019, 10:17am UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/9 "2019-05-30T10:17:42Z")

</div>

Thanks.  
I checked this project and I have no idea what to do now?  
I played around with it, but never got it to work with my API URL.  
I have not much experience with APIs. Can you please tell me what I have to do to make this work?

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [May 30, 2019, 11:29am UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/10 "2019-05-30T11:29:35Z")

</div>

Does my project work for you? After clicking on the button you got the value of the desired field? If the example works, then you need to figure out why it is these blocks that are used in it and make the blocks for your decision.

---

<div class="post-metadata">

### Author: ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)
#### Post date: [May 31, 2019, 5:16pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/11 "2019-05-31T17:16:17Z")

</div>

Hi Joey,

actech’s app does a perfect job in retrieving the ‘name’ property of your JSON response.  
If you’re new to APIs, try checking out this tutorial I just wrote that talks the reader through using a Location API to get the name of the country where a given latitude/longitude point is located.  
Because they’re both based around Location APIs, you might find the information in it useful for understanding your API. 🙂

> [@Reverse Geocoding App - Get Location from Latitude/Longitude](http://community.thunkable.com/t/reverse-geocoding-app-get-location-from-latitude-longitude/82343):
>
> This tutorial will show you how to retrieve a location given a Latitude and Longitude. We will use the Location Sensor to get the Latitude and Longitude for this app. This app will return the country you are currently in. This app uses the OpenCageData API. You can get an API key for it [here](https://opencagedata.com/api). Design [Design] The Design for this app is extremely simple: A Button and a Label. You’ll need to add a Web API component and a Location Sensor to this app. Blocks The only variable we need for thi…

---

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [June 3, 2019, 9:39pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/12 "2019-06-03T21:39:26Z")

</div>

@actech Yes it works, thanks.  
@jane Thanks for this link. This looks like what I need to get a better understanding of how APIs work and to make my project work. 🙂

---

<div class="post-metadata">

### Author: ![Aam\_Press](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/aam_press/32/34735_2.png) [@Aam\_Press](https://community.thunkable.com/u/Aam_Press)
#### Post date: [June 4, 2019, 5:48am UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/13 "2019-06-04T05:48:34Z")

</div>

Nice topic… I will use it

---

<div class="post-metadata">

### Author: ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://community.thunkable.com/u/Joey)
#### Post date: [June 4, 2019, 8:46am UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/14 "2019-06-04T08:46:09Z")

</div>

@jane now it works for me! 😅  
I followed your tutorial step by step and now I finally understand how the blocks work here. Thanks again!

---

<div class="post-metadata">

### Author: ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)
#### Post date: [June 4, 2019, 1:44pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/15 "2019-06-04T13:44:18Z")

</div>

I’m so glad to hear it! 😄

---

<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, 12:13pm UTC](https://community.thunkable.com/t/solved-google-places-api-json-and-list-viewer/77028/16 "2024-11-08T12:13:36Z")

</div>


