OK I know this type of thing has been reported before and I had read various threads:
Are you using the actual API JSON response this time or are you using the text that you posted above? Because the text above has smart quotes and won’t work properly. If you’re testing this with text in a variable as @muneer did, use this version without smart quotes:
[{"name":"Kampala","local_names":{"ky":"Кампала","uk":"Кампала","en":"Kampala","ko":"캄팔라","fr":"Kampala","cv":"Кампала","ru":"Кампала","tg":"Кампала","bo":"ཀམ་པ་ལ།","he":"קמפלה","fa":"کامپالا","mk":"Кампала","pl":"Kampala","ku":"K…
Hi,
I need assistance in extracting the values display under property “long_name” under “address_components” list; so I can get the enterie address base on a latitude and logitude values; I’m using the location sensor component and a web api from google maps
Thanks,
the json that comes out of the google geocoding api is:
{
“plus_code” : {
“compound_code” : “RHR3+98 Santa Lucia, El Salvador”,
“global_code” : “765GRHR3+98”
},
“results” : [
{
“address_components” : [
{
“long_name” : “C…
Hi Friends! Here I am again!
I have a Firebase database and I generated a JSON file to display as a list. When I display the list without sorting/filtering, it works. But I need to filter data from there, and when I filter, the structure of the JSON changes.
Display the list as it is:
[1]
(https://myvocab-30705.firebaseio.com/myvocab.json )
Display the list sorted and filtered by adding ?orderBy=“Box”&equalTo=0 to the website address:
[2]
Some nodes appear in this second version an…
Plus I have read the docs:
But no matter what I have tried I cannot get the JSON data from the Faceplusplus API
See docs here : Face⁺⁺
I have attached some attempts but do understand that these are only some attempts that I have made and tried to avoid troubling you good folks here
.
Please can someone help me getting the data from the faces->attributes->emotion->
Also note that the API is returning the JSON as I send it to a label object as text and the values and JSON format show
Also I have the JSON data in question:
{"request_id":"1732116146,454562ca-7765-4065-bcd4-f1bfe4ae0b53","time_used":1048,"faces":[{"face_token":"758b943627609891d98a15faed651949","face_rectangle":{"top":209,"left":677,"width":216,"height":216},"attributes":{"emotion":{"anger":0.000,"disgust":0.000,"fear":0.000,"happiness":99.998,"neutral":0.001,"sadness":0.000,"surprise":0.000}}}],"image_id":"RhHX0oPMUSnudJhnA2qgaA==","face_num":1}
Please note that I am only looking for the emotion data so in my API request I call return_attributes
Thank you
Tim
Got this sorted with the help of this thread API JSON Tutorial (Video) - #15 by tatiang from @tatiang and used the Best JSON Viewer and JSON Beautifier Online site to determine the location of the values in this JSON.
For me this worked : faces[1].attributes.emotion.anger
Now I have got to figure out how to loop through all the emotions and get their names and values
2 Likes
I am struggling with grabbing the emotion names e.g. happiness anger neutral etc any thoughts would be appreciated
tatiang
November 22, 2024, 8:16pm
4
Getting the property names requires using a different method. It’s complicated :
Note that the JSON response variable is actual JSON (text) that I copied from your post after formatting it with the </> toolbar button to remove smart quotes that invalidate the JSON. If you are getting a JSON response from an API server, you would just attach the green response
block to the get property of object
block in my screenshot.
Sorry, thought I was going to need an extra variable for the emotions list but I didn’t. It’s still in the screenshot. But you could also set that variable to the make text from list
block to be able to store the list of emotions.
Thanks @tatiang I will give this a go your other thread/guide was really helpful !
TimCS
1 Like
I got a problem, i am trying to make plinko balls in my app. Kinda like this
https://plinko-web-game.netlify.app/ but less complicated and way more simple. I got my pins but the sprite is a square and acts like one too, is there any way to make it work like a circle? And how do you make the scoring like when the ball goes down into the 0.2x or 2x or 1000x for example?
tatiang
November 23, 2024, 12:18am
7
Please start a new topic or find one related to what you are asking about.