# Banging my head against the wall - API+JSON+Extract data!

**URL:** <https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037>\
**Category:** Questions about Thunkable X\
**Created:** [November 22, 2024, 11:10am UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037 "2024-11-22T11:10:05Z")\
**Posts on this page:** 8\
**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:** [November 22, 2024, 11:10am UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/1 "2024-11-22T11:10:05Z")

</div>

OK I know this type of thing has been reported before and I had read various threads:

> [@How to extract info from this JSON](https://community.thunkable.com/t/how-to-extract-info-from-this-json/499882/21):
>
> 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…

> [@Extracting values from Json (Reverse Geocoding Google Map API )](https://community.thunkable.com/t/extracting-values-from-json-reverse-geocoding-google-map-api/668641/1):
>
> 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…

> [@Get a child element from a JSON list](https://community.thunkable.com/t/get-a-child-element-from-a-json-list/75268):
>
> 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: ([https://myvocab-30705.firebaseio.com/myvocab.json](https://myvocab-30705.firebaseio.com/myvocab.json)) Display the list sorted and filtered by adding ?orderBy=“Box”&equalTo=0 to the website address: Some nodes appear in this second version an…

Plus I have read the docs:

> **[Objects Blocks | Thunkable Docs](https://docs.thunkable.com/blocks/blocks/objects#generate-json-from-object)**

But no matter what I have tried I cannot get the JSON data from the Faceplusplus API  
See docs here : [Face⁺⁺](https://console.faceplusplus.com/documents/5679127)

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

 ![JSON attempt five](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/b/abbdb7cb6e2ea9feea7a5645756ba85bac169e5f.png)  
 ![JSON attempt four](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/2/b277252ff7be2ec430ff721b5baf98cf35086aa4.png)  
 ![JSON attempt one](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/3/437eccab68335dec475aef42af1fabddebe19d2b.png)  
 ![JSON attempt three](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/66f8e88c4917949abd6af94fd79d681b47b5f073.png)  
 ![JSON attempt two](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/1/111c047635bbafb99a9aeb7229a6be290cc86b99.png)

.

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

---

<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:** [November 22, 2024, 2:09pm UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/2 "2024-11-22T14:09:51Z")

</div>

Got this sorted with the help of this thread [API JSON Tutorial (Video) - #15 by tatiang](https://community.thunkable.com/t/api-json-tutorial-video/1140575/15) from @tatiang and used the [Best JSON Viewer and JSON Beautifier Online](https://codebeautify.org/jsonviewer) 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

---

<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:** [November 22, 2024, 2:24pm UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/3 "2024-11-22T14:24:36Z")

</div>

I am struggling with grabbing the emotion names e.g. happiness anger neutral etc any thoughts would be appreciated

---

<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:** [November 22, 2024, 8:16pm UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/4 "2024-11-22T20:16:39Z")

</div>

Getting the property names requires using a different method. It’s **complicated** :

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

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.

---

<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:** [November 22, 2024, 9:41pm UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/5 "2024-11-22T21:41:30Z")

</div>

Thanks @tatiang I will give this a go your other thread/guide was really helpful !

TimCS

---

<div class="post-metadata">

**Author:** ![grebergerikw5u5oo](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@grebergerikw5u5oo](https://community.thunkable.com/u/grebergerikw5u5oo)\
**Post date:** [November 22, 2024, 11:30pm UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/6 "2024-11-22T23:30:51Z")

</div>

I got a problem, i am trying to make plinko balls in my app. Kinda like this  
[https://plinko-web-game.netlify.app/](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?

---

<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:** [November 23, 2024, 12:18am UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/7 "2024-11-23T00:18:03Z")

</div>

Please start a new topic or find one related to what you are asking about.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [February 21, 2025, 12:18am UTC](https://community.thunkable.com/t/banging-my-head-against-the-wall-api-json-extract-data/3362037/8 "2025-02-21T00:18:31Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
