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) 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.
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.
@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”:
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.
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?
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.
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.
@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.