# JSON File from Google Places

**URL:** <https://community.thunkable.com/t/json-file-from-google-places/3392627>\
**Category:** Questions about Thunkable X\
**Created:** [December 5, 2024, 4:29pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627 "2024-12-05T16:29:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 5, 2024, 4:29pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/1 "2024-12-05T16:29:13Z")

</div>

Hi

Has anyone expericened formatting issue with the JSON sent from Google Places? Currently I am pulling in data using the nearbysearch option and tryng to feed the results into a listview.

As a test I also tried to do this by looking for one value going into a label object. I use the [https://jsonformatter.org/](https://jsonformatter.org/) site to look at the formatting of the data and it seems to find formatting errors it can correct these but that means I think that the data I am getting into my app must also have an invalid format.

Any thoughts on this please as I am unable to get any of the values from this JSON data  
[data.txt](https://community.thunkable.com/uploads/short-url/10QhhZf0mLY4HWKxZZl9AqK1hiO.txt) (44.5 KB)

attached is the JSON file and the blocks

 ![blocks 1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/d/1d2f7dc84fa6395513c116ac0c2083c129ec86d6.png)  
 ![blocks 2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/7/e7ae2304f1e78a4ee420a816e5203ca9259e0f05.png)

Thank you

TimCS

---

<div class="post-metadata">

**Author:** ![steve\_synopsis](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@steve\_synopsis](https://community.thunkable.com/u/steve_synopsis)\
**Post date:** [December 5, 2024, 6:48pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/2 "2024-12-05T18:48:49Z")

</div>

Hi,

Can you share some more info? What does the data from Google Places look like? What blocks are you using?

Steve

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 5, 2024, 9:27pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/3 "2024-12-05T21:27:25Z")

</div>

@steve_synopsis Please see my inital post added full json file plus blocks

---

<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:** [December 6, 2024, 12:05am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/4 "2024-12-06T00:05:42Z")

</div>

I would need to see the full JSON response as text. The file you attached has invalid JSON. I ran it through a couple ChatGPT prompts to try to repair it which sometimes work but in this case did not.

I recommend you copy the response from the Text Input component when you preview the project and then paste it into a post here. Be sure to format the text using the \</\> button in the forums toolbar to remove smart quotes.

Can you also share the full API url you’re sending it? Remove your private API key first.

I think I’ve worked with the Google Places API but I’ve never gotten invalid JSON from it.

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 6, 2024, 12:42am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/5 "2024-12-06T00:42:39Z")

</div>

Hi @tatiang that text i attached is from the textinput that is the only way i can get a copy of it

---

<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:** [December 6, 2024, 2:47am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/6 "2024-12-06T02:47:24Z")

</div>

Please copy and paste it into a forum post.

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 6, 2024, 8:54am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/7 "2024-12-06T08:54:32Z")

</div>

Hi @tatiang I tried to post it here but it was to long that is why I added it as a file.

As for the URL it starts with [https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=](https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=) + Textinput.txt with replace \< space \> with %20 + &location=+ varlat + “,”+ varlong + &radius=500&key=

I have also added the &type=aumsement\_centre as well as a test.

This is the basis of the URL call

Thanks

Tim

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 6, 2024, 1:50pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/8 "2024-12-06T13:50:56Z")

</div>

Curl Created (works):

```auto
{
   "html_attributions" : [],
   "results" :
   [
      {
         "business_status" : "OPERATIONAL",
         "geometry" :
         {
            "location" :
            {
               "lat" : 52.3973117,
               "lng" : 0.2486357
            },
            "viewport" :
            {
               "northeast" :
               {
                  "lat" : 52.39878827989272,
                  "lng" : 0.2498862798927222
               },
               "southwest" :
               {
                  "lat" : 52.39608862010728,
                  "lng" : 0.2471866201072778
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png",
         "icon_background_color" : "#7B9EB0",
         "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet",
         "name" : "Play Area",
         "opening_hours" :
         {
            "open_now" : true
         },
         "photos" :
         [
            {
               "height" : 1080,
               "html_attributions" :
               [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/101699236731014143122\"\u003ePaulPeeling\u003c/a\u003e"
               ],
               "photo_reference" : "AdDdOWorfDoo8e3Of4E3uvojNJUH6jyG6pAB0bEbRO-z5sqt6LqAUD1r0B1xyXCpgp8gRHj4xJa6FXqKb8T-TEiXmYklGUc70ASYQIHzOUQZRiyjk3jubfIeVoXHKv2Go4pWSM9Xa2rHrYd8QvdnRAY3kM6T-EI8oT_DNZtuYt3Qyg7Zg4IX",
               "width" : 1920
            }
         ],
         "place_id" : "ChIJ34vOnvcT2EcRZSsWoUJiv8s",
         "plus_code" :
         {
            "compound_code" : "96WX+WF Ely",
            "global_code" : "9F4296WX+WF"
         },
         "rating" : 4.7,
         "reference" : "ChIJ34vOnvcT2EcRZSsWoUJiv8s",
         "scope" : "GOOGLE",
         "types" :
         [
            "point_of_interest",
            "establishment"
         ],
         "user_ratings_total" : 3,
         "vicinity" : "St John's Rd, Ely"
      },
      {
         "business_status" : "OPERATIONAL",
         "geometry" :
         {
            "location" :
            {
               "lat" : 52.4011761,
               "lng" : 0.2658394
            },
            "viewport" :
            {
               "northeast" :
               {
                  "lat" : 52.40250842989273,
                  "lng" : 0.2672332798927222
               },
               "southwest" :
               {
                  "lat" : 52.39980877010728,
                  "lng" : 0.2645336201072777
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/cafe-71.png",
         "icon_background_color" : "#FF9E67",
         "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/cafe_pinlet",
         "name" : "The Yard - by Silver Oak",
         "opening_hours" :
         {
            "open_now" : true
         },
         "photos" :
         [
            {
               "height" : 3468,
               "html_attributions" :
               [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/115960785494722888837\"\u003eNigel Warner\u003c/a\u003e"
               ],
               "photo_reference" : "AdDdOWrJI4lT8ueqZ9SCXmqUehubicCa-9iO7vPuRGXsN4Wy1arjOxsk2_mkIv7Ln9nOYJoZmJp4rNBg-Cer31o3m-dnXEIY6DHksU8BSYqi2-M19ln07F7rBLyCmO5_hVgJxvcCUKVhlldbS9Eq0zJNUijfM4-iqXIvs9u8sDvn4yOm0Jku",
               "width" : 4624
            }
         ],
         "place_id" : "ChIJ6wGTOzsT2EcRsfRIJMRj2P4",
         "plus_code" :
         {
            "compound_code" : "C728+F8 Ely",
            "global_code" : "9F42C728+F8"
         },
         "price_level" : 2,
         "rating" : 4.6,
         "reference" : "ChIJ6wGTOzsT2EcRsfRIJMRj2P4",
         "scope" : "GOOGLE",
         "types" :
         [
            "cafe",
            "bar",
            "restaurant",
            "food",
            "point_of_interest",
            "establishment"
         ],
         "user_ratings_total" : 327,
         "vicinity" : "35A Newnham St, Ely"
      }
   ],
   "status" : "OK"
}

Thunkable created (fails why does it do this?)

{ "html_attributions" : [], "results" : [{ "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.39752499999999, "lng" : 0.2706318 }, "viewport" : { "northeast" : { "lat" : 52.39892002989272, "lng" : 0.2720447798927221 }, "southwest" : { "lat" : 52.39622037010727, "lng" : 0.2693451201072776 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png", "icon_background_color" : "#7B9EB0", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet", "name" : "Willow Park Play Area", "photos" : [ { "height" : 3264, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/114029316471613441616\"\u003eMaryna Kuzmenko\u003c/a\u003e"], "photo_reference" : "AdDdOWq3ePFVyJ-zckHY6isCVnQm4nR353IgWPOanL7H0Keox3OowX5fwoP-YgZMkHYDRGkTucGY90L4rKbrYqxX2TtEQK-HR5TL8wychoVbVkQwcyPsv_O5qGhEHmwjTsX14cYPL8RBuL6lJPH0MJ6jjG12-miw4lUXiXdBRFq8693KpIuk", "width" : 2448 } ], "place_id" : "ChIJwbXrZIIT2EcRc3iC49CI0iA", "plus_code" : { "compound_code" : "97XC+27 Ely", "global_code" : "9F4297XC+27" }, "rating" : 4.8, "reference" : "ChIJwbXrZIIT2EcRc3iC49CI0iA", "scope" : "GOOGLE", "types" : ["point_of_interest", "establishment"], "user_ratings_total" : 8, "vicinity" : "22 Willow Walk, Ely" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4011761, "lng" : 0.2658394 }, "viewport" : { "northeast" : { "lat" : 52.40250842989273, "lng" : 0.2672332798927222 }, "southwest" : { "lat" : 52.39980877010728, "lng" : 0.2645336201072777 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/cafe-71.png", "icon_background_color" : "#FF9E67", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/cafe_pinlet", "name" : "The Yard - by Silver Oak", "opening_hours" : { "open_now" : true }, "photos" : [{ "height" : 3468, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/115960785494722888837\"\u003eNigel Warner\u003c/a\u003e"], "photo_reference" : "AdDdOWpdCOiQLtdA1TQRwjObmmMhaYK8ma7cA_UnQV8L6KEFwgrTSVgZyzNbpSjLkh0a-CQvGnkjnSLWAAiIOxWKn4X0baorCOOGyUJQrmSqSTdpKqzyZR1wYnZzMd8CXJsxjPIjb7ZS41bQ3Fga54Qn6S-ffyFOMEcAWPefOI9HkGUZeZ5y", "width" : 4624 } ], "place_id" : "ChIJ6wGTOzsT2EcRsfRIJMRj2P4", "plus_code" : { "compound_code" : "C728+F8 Ely", "global_code" : "9F42C728+F8" }, "price_level" : 2, "rating" : 4.6, "reference" : "ChIJ6wGTOzsT2EcRsfRIJMRj2P4", "scope" : "GOOGLE", "types" : ["cafe", "bar", "restaurant", "food", "point_of_interest", "establishment"], "user_ratings_total" : 327, "vicinity" : "35A Newnham St, Ely" } ], "status" : "OK"}

```

---

<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:** [December 6, 2024, 2:56pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/9 "2024-12-06T14:56:40Z")

</div>

I formatted it for you using the \</\> button. That’s an important step.

The fact that you’re getting invalid JSON from the Google Places API is really strange to me. I’m not sure what you can do about that. Without valid JSON, you can’t parse it in Thunkable. Have you tried removing the spaces from the text input’s text rather than replacing them with “%20”? In other words, what happens when you try a search with no spaces?

**Edit:** ChatGPT was able to repair it (below) which will at least let you view it on something like [Best JSON Viewer and JSON Beautifier Online](https://codebeautify.org/jsonviewer).

`{"html_attributions":[],"results":[{"business_status":"OPERATIONAL","geometry":{"location":{"lat":52.3973117,"lng":0.2486357},"viewport":{"northeast":{"lat":52.39878827989272,"lng":0.2498862798927222},"southwest":{"lat":52.39608862010728,"lng":0.2471866201072778}}},"icon":"https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png","icon_background_color":"#7B9EB0","icon_mask_base_uri":"https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet","name":"Play Area","opening_hours":{"open_now":true},"photos":[{"height":1080,"html_attributions":["<a href=\"https://maps.google.com/maps/contrib/101699236731014143122\">PaulPeeling</a>"],"photo_reference":"AdDdOWorfDoo8e3Of4E3uvojNJUH6jyG6pAB0bEbRO-z5sqt6LqAUD1r0B1xyXCpgp8gRHj4xJa6FXqKb8T-TEiXmYklGUc70ASYQIHzOUQZRiyjk3jubfIeVoXHKv2Go4pWSM9Xa2rHrYd8QvdnRAY3kM6T-EI8oT_DNZtuYt3Qyg7Zg4IX","width":1920}],"place_id":"ChIJ34vOnvcT2EcRZSsWoUJiv8s","plus_code":{"compound_code":"96WX+WF Ely","global_code":"9F4296WX+WF"},"rating":4.7,"reference":"ChIJ34vOnvcT2EcRZSsWoUJiv8s","scope":"GOOGLE","types":["point_of_interest","establishment"],"user_ratings_total":3,"vicinity":"St John's Rd, Ely"},{"business_status":"OPERATIONAL","geometry":{"location":{"lat":52.4011761,"lng":0.2658394},"viewport":{"northeast":{"lat":52.40250842989273,"lng":0.2672332798927222},"southwest":{"lat":52.39980877010728,"lng":0.2645336201072777}}},"icon":"https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/cafe-71.png","icon_background_color":"#FF9E67","icon_mask_base_uri":"https://maps.gstatic.com/mapfiles/place_api/icons/v2/cafe_pinlet","name":"The Yard - by Silver Oak","opening_hours":{"open_now":true},"photos":[{"height":3468,"html_attributions":["<a href=\"https://maps.google.com/maps/contrib/115960785494722888837\">Nigel Warner</a>"],"photo_reference":"AdDdOWrJI4lT8ueqZ9SCXmqUehubicCa-9iO7vPuRGXsN4Wy1arjOxsk2_mkIv7Ln9nOYJoZmJp4rNBg-Cer31o3m-dnXEIY6DHksU8BSYqi2-M19ln07F7rBLyCmO5_hVgJxvcCUKVhlldbS9Eq0zJNUijfM4-iqXIvs9u8sDvn4yOm0Jku","width":4624}],"place_id":"ChIJ6wGTOzsT2EcRsfRIJMRj2P4","plus_code":{"compound_code":"C728+F8 Ely","global_code":"9F42C728+F8"},"price_level":2,"rating":4.6,"reference":"ChIJ6wGTOzsT2EcRsfRIJMRj2P4","scope":"GOOGLE","types":["cafe","bar","restaurant","food","point_of_interest","establishment"],"user_ratings_total":327,"vicinity":"35A Newnham St, Ely"}],"status":"OK"}`

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 6, 2024, 10:46pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/10 "2024-12-06T22:46:19Z")

</div>

But the point is the JSON file fro Google places is valid when running the Curl command but not through Thunkable - it is almost as though Thunkable is underable to interrupt the receiveing data correctly.

No I have not tried it without the space which I can but that would defeat the object of allowing to search for something with a space.

Correcting it is not the issue - the issue is that because it comes through to Thunkable and is invalid - Thunkable is unable to read any of the values wihen I refer to them.

It vital to get this to work as I need to parse the data I need into a database but I cannot.

---

<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:** [December 6, 2024, 11:52pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/11 "2024-12-06T23:52:00Z")

</div>

> [@tim.casson.smithpc](#):
>
> Correcting it is not the issue - the issue is that because it comes through to Thunkable and is invalid - Thunkable is unable to read any of the values wihen I refer to them.

I understand that. I wasn’t suggesting that you correct every JSON response you get. I was just mentioning that I was able to get valid JSON out of what you provided so I would be able to parse but yes, you’ll need a valid JSON response every time you make the API call.

It’s interesting that the Curl command produces valid JSON. I haven’t experienced an API that sends valid JSON one way and not another but I suppose it’s possible. I would check the urls you’re using with Curl and Thunkable to make sure they are exactly the same. Are you able to get valid JSON using an API call url in a browser tab?

---

<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:** [December 6, 2024, 11:58pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/12 "2024-12-06T23:58:22Z")

</div>

Here’s a valid response I got from the API using a url in a browser with my own key:

[https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=Six%20Flags&type=amusement\_park&location=38.1041,-122.2566&radius=10000&key=[API\_key]](https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=Six%20Flags&type=amusement_park&location=38.1041,-122.2566&radius=10000&key=%5BAPI_key%5D)

```auto
{
   "html_attributions" : [],
   "results" : 
   [
      {
         "business_status" : "OPERATIONAL",
         "geometry" : 
         {
            "location" : 
            {
               "lat" : 38.1376988,
               "lng" : -122.2334814
            },
            "viewport" : 
            {
               "northeast" : 
               {
                  "lat" : 38.13880227989273,
                  "lng" : -122.2282647
               },
               "southwest" : 
               {
                  "lat" : 38.13610262010728,
                  "lng" : -122.2352203
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png",
         "icon_background_color" : "#7B9EB0",
         "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet",
         "name" : "Six Flags Discovery Kingdom",
         "opening_hours" : 
         {
            "open_now" : false
         },
         "photos" : 
         [
            {
               "height" : 4000,
               "html_attributions" : 
               [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/107484551187979378148\"\u003eStephanie Chambers\u003c/a\u003e"
               ],
               "photo_reference" : "AdDdOWqVk3vHArs_-h4VA0zbsqKFdbOqQsBmf-zRMHXXE0AbUnMbPWbowvDUIcGIBR6_AYsXsNRN6TF5GBeHwp4uQmMIylcZ6uFTOR7hspxwLMMYdj7go7RLjoPXuLue-KkZSiavJ7r6z6fET8PUznCBMYXkDMRmEvYh9PHpBISQEJyCN7bu",
               "width" : 3000
            }
         ],
         "place_id" : "ChIJZXKKhc4MhYAR5O3pJUMuiUk",
         "plus_code" : 
         {
            "compound_code" : "4QQ8+3J Vallejo, California",
            "global_code" : "84CV4QQ8+3J"
         },
         "rating" : 4.1,
         "reference" : "ChIJZXKKhc4MhYAR5O3pJUMuiUk",
         "scope" : "GOOGLE",
         "types" : 
         [
            "tourist_attraction",
            "amusement_park",
            "point_of_interest",
            "establishment"
         ],
         "user_ratings_total" : 20536,
         "vicinity" : "1001 Fairgrounds Dr, Vallejo"
      },
      {
         "business_status" : "OPERATIONAL",
         "geometry" : 
         {
            "location" : 
            {
               "lat" : 38.1376341,
               "lng" : -122.2316775
            },
            "viewport" : 
            {
               "northeast" : 
               {
                  "lat" : 38.13904762989272,
                  "lng" : -122.2298142701072
               },
               "southwest" : 
               {
                  "lat" : 38.13634797010728,
                  "lng" : -122.2325139298927
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png",
         "icon_background_color" : "#7B9EB0",
         "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet",
         "name" : "DC Universe",
         "opening_hours" : 
         {
            "open_now" : true
         },
         "photos" : 
         [
            {
               "height" : 4032,
               "html_attributions" : 
               [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/108829279514501622663\"\u003eA Google User\u003c/a\u003e"
               ],
               "photo_reference" : "AdDdOWotyqg3ga5H8A5s354j3-JVy9Ls16s0qYxcjYOqh_tlia0PYnUQ1WXk_gKz62aJfyTusY8MVGPCi9RcfVsDEWF4LmYDDsKiJGZb02Bu3mi5h6_IL546Er3mHrUlBnLG8q38y8eta2LWNdDWZerQE2qjo6IVTkxJAmrtgqQjMXH6MRCf",
               "width" : 3024
            }
         ],
         "place_id" : "ChIJTT25ZJYNhYARSnrrMp3WLwk",
         "plus_code" : 
         {
            "compound_code" : "4QQ9+38 Vallejo, California",
            "global_code" : "84CV4QQ9+38"
         },
         "rating" : 4.8,
         "reference" : "ChIJTT25ZJYNhYARSnrrMp3WLwk",
         "scope" : "GOOGLE",
         "types" : 
         [
            "amusement_park",
            "point_of_interest",
            "establishment"
         ],
         "user_ratings_total" : 6,
         "vicinity" : "1001 Fairgrounds Dr, Vallejo"
      }
   ],
   "status" : "OK"
}

```

---

<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:** [December 7, 2024, 12:14am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/13 "2024-12-07T00:14:23Z")

</div>

These blocks worked to return valid JSON with the same url (as used in the browser)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/2/e20ac5664a017c958e3fdcf74678b913deb0d803.png)

**Edit:** Oh wait! I just noticed that you’re generating JSON from the response:

 ![8ac230ea1cf761608f70aebb0188150d0e817246](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/0/e06a4a1822a61200b44dae0734acb5a5ca021dc0.png)

That’s probably what’s causing the whole problem. The green `response` block returns a text string that is formatted as json (assuming you used a parameter to that effect, which you did). You’re asking Thunkable to take an object – which it is not – and convert it to JSON. That’s probably messing up the format of the json response from the Google Places API.

When parsing an API response, you want to `generate an object from the JSON` so you can get properties from that object.

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 7, 2024, 6:33am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/14 "2024-12-07T06:33:10Z")

</div>

Yes but the text input box is where I’m getting the json from that i paste here as a test i also added the generate object from json to it as well and this also didn’t work

---

<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:** [December 7, 2024, 6:36am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/15 "2024-12-07T06:36:27Z")

</div>

Hmm, good point. Whatever is happening I believe is due to some combination of blocks you’re using. Maybe the url construction itself.

I suggest that you create a url that works in a browser tab in Chrome, etc. and post it here without the API key. Maybe the one you already posted works… I don’t know. But once you are able to get valid JSON, we can build the url correctly in Thunkable from there. It’s just hard to troubleshoot Thunkable API blocks without knowing that the url works elsewhere. I know you said Curl works but let’s try a browser and make sure that also works.

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 7, 2024, 11:37am UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/16 "2024-12-07T11:37:18Z")

</div>

Ok but the url does work through curl and brings back a valid json file would this not prove the same?

---

<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:** [December 7, 2024, 5:55pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/17 "2024-12-07T17:55:06Z")

</div>

I don’t know you so forgive me for assuming this but it seems like you are resistant to try some of the things I have suggested. I’m going through a mental checklist in my mind for how I resolve problems with API calls and JSON parsing. So the answer to your question is yes… a successful Curl command should be enough but because you haven’t tested it in a browser to see that it works and I have and get valid JSON, I’m left thinking there’s something you’re doing different in your Curl command or Thunkable blocks that is causing a problem I’ve never seen when using the Google Places API. It’s harder to troubleshoot Thunkable blocks and very easy to see if a browser url works. So once we establish that, we can try the next troubleshooting step. But without that simple step, we may miss something crucial.

If you try a url in a browser and post the full url minus the API key, we might discover something. You can use a generic lat/long pair like for a major city. Or just let me know that the url I posted worked to return valid JSON using your own API key. It should. But again, test it in a browser, not with Curl.

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 7, 2024, 11:45pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/18 "2024-12-07T23:45:47Z")

</div>

@tatiang Here is the URL I used in Chrome:

[https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=soft%20play&location=52.3982257,0.2604013&key=[myapikey]&radius=500](https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=soft%20play&location=52.3982257,0.2604013&key=%5Bmyapikey%5D&radius=500)

and here is the JSON output

```auto
{
   "html_attributions" : [],
   "results" : 
   [
      {
         "business_status" : "OPERATIONAL",
         "geometry" : 
         {
            "location" : 
            {
               "lat" : 52.39752499999999,
               "lng" : 0.2706318
            },
            "viewport" : 
            {
               "northeast" : 
               {
                  "lat" : 52.39892002989272,
                  "lng" : 0.2720447798927221
               },
               "southwest" : 
               {
                  "lat" : 52.39622037010727,
                  "lng" : 0.2693451201072776
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png",
         "icon_background_color" : "#7B9EB0",
         "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet",
         "name" : "Willow Park Play Area",
         "photos" : 
         [
            {
               "height" : 3264,
               "html_attributions" : 
               [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/114029316471613441616\"\u003eMaryna Kuzmenko\u003c/a\u003e"
               ],
               "photo_reference" : "AdDdOWr-ANOlGIjZ16lPydFJOYiV-4Ep_i6PjlKWZByGiH6HU2XuDJff7uVXr97RzE9Mow5OU6CsZxizri_ZuZdyN_jtCH-mBQlsDH2ghY86DKtU4s5TtwY3o6E_PsQMxjeKnOqPYaQbt9p6iyqwRZls2bXYm05axIk8HzWNQ_fcMHIJJq9u",
               "width" : 2448
            }
         ],
         "place_id" : "ChIJwbXrZIIT2EcRc3iC49CI0iA",
         "plus_code" : 
         {
            "compound_code" : "97XC+27 Ely",
            "global_code" : "9F4297XC+27"
         },
         "rating" : 4.8,
         "reference" : "ChIJwbXrZIIT2EcRc3iC49CI0iA",
         "scope" : "GOOGLE",
         "types" : 
         [
            "point_of_interest",
            "establishment"
         ],
         "user_ratings_total" : 8,
         "vicinity" : "22 Willow Walk, Ely"
      },
      {
         "business_status" : "OPERATIONAL",
         "geometry" : 
         {
            "location" : 
            {
               "lat" : 52.4011761,
               "lng" : 0.2658394
            },
            "viewport" : 
            {
               "northeast" : 
               {
                  "lat" : 52.40250842989273,
                  "lng" : 0.2672332798927222
               },
               "southwest" : 
               {
                  "lat" : 52.39980877010728,
                  "lng" : 0.2645336201072777
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/cafe-71.png",
         "icon_background_color" : "#FF9E67",
         "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/cafe_pinlet",
         "name" : "The Yard - by Silver Oak",
         "opening_hours" : 
         {
            "open_now" : false
         },
         "photos" : 
         [
            {
               "height" : 3468,
               "html_attributions" : 
               [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/115960785494722888837\"\u003eNigel Warner\u003c/a\u003e"
               ],
               "photo_reference" : "AdDdOWrafUiyZttzAdP95nEkRfZvhBLvGV_-eefLLC4ZKw1nYI0KA97npTbLO5_j_dEYK5gWMxMYiaB_pQfA_Oa1D0jwBWgdv5TW9V9vbHYsVnqCpzkDPgygl21f7K6aB2B18XjjhFz-PGfdoMqcROkUoku3z1gTxXPMebcqzLRjfwwAkAYX",
               "width" : 4624
            }
         ],
         "place_id" : "ChIJ6wGTOzsT2EcRsfRIJMRj2P4",
         "plus_code" : 
         {
            "compound_code" : "C728+F8 Ely",
            "global_code" : "9F42C728+F8"
         },
         "price_level" : 2,
         "rating" : 4.6,
         "reference" : "ChIJ6wGTOzsT2EcRsfRIJMRj2P4",
         "scope" : "GOOGLE",
         "types" : 
         [
            "cafe",
            "bar",
            "restaurant",
            "food",
            "point_of_interest",
            "establishment"
         ],
         "user_ratings_total" : 329,
         "vicinity" : "35A Newnham St, Ely"
      }
   ],
   "status" : "OK"
}

```

---

<div class="post-metadata">

**Author:** ![tim.casson.smithpc](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tim.casson.smithpc](https://community.thunkable.com/u/tim.casson.smithpc)\
**Post date:** [December 8, 2024, 3:17pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/19 "2024-12-08T15:17:05Z")

</div>

So in going to run this same url string in Thunkable to see what happens with the json format next

If this works then like you said it could be something to do with how I’m building this through the blocks which will be strange as i also output this string to screen and see no issues.

If this fails then something is a foot with Thunkable

By the way I’m using the Thunkable live app to run these tests

---

<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:** [December 8, 2024, 4:54pm UTC](https://community.thunkable.com/t/json-file-from-google-places/3392627/20 "2024-12-08T16:54:07Z")

</div>

If you want, you can post a link to your project or send it to me via private message. I have a couple other thoughts about what to try and can probably fix it faster than I can explain it here.

[Next page](https://community.thunkable.com/t/json-file-from-google-places/3392627.md?page=2)
