# Need help with JSON list and API (Bug?)

**URL:** <https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041>\
**Category:** Questions about Thunkable X\
**Created:** [May 20, 2020, 9:56pm UTC](https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041 "2020-05-20T21:56:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![22morales5827tqbl2t](https://avatars.discourse-cdn.com/v4/letter/2/258eb7/32.png) [@22morales5827tqbl2t](https://community.thunkable.com/u/22morales5827tqbl2t)\
**Post date:** [May 20, 2020, 9:56pm UTC](https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041/1 "2020-05-20T21:56:21Z")

</div>

I’m building this app based on the API of Jisho, it is a dictionary for Japanese symbols. The code is very simple. I have the link **[https://jisho.org/api/v1/search/words?keyword=](https://jisho.org/api/v1/search/words?keyword=)** then after the equal sign, I add a word and it will give me all of the results that include that word, in JSON format. For example. if I type “now” who’s japanese symbol is, “今”, it will give me results of the word “now” (今), but also all other words that use the symbol “now,” like the word “today.” (今日). What I want to do is go into the data, then from the list “japanese” I want to get the “word” object. What I am trying right now is what I just mentioned. Everything should work fine. I have included labels that are changed when I click the button, to see if the “word” variable and the api link are joined correctly, and if it works correctly, it will also change the text in the label in the japanese symbol of the word Inputted. (So if I inputted “now,” it will change the label to 今). When I run the app on the web viewer, the link and the variable “word” are correctly joined, however, I get no response on the second label, and in less than a second, the app crashes. I then tried it on my Android phone running Android 10, (the latest update) and in there the link and the variable are not joined, and for the second label I get response “undefined.” I tried it on an iOS device running iOS 13.4.1, (the latest), and I get the same situation as the web viewer, where the link and the variable are properly joined, but I get no response on the second label and the app crashes. Any idea what I should do? I think my blocks are correct, and I have tried inputting the japanese characters as a label, so Thunkable should support them. Either way they are just unicode. Here are the pictures of my code:

 ![Screen Shot 2020-05-20 at 2.30.10 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/f/ff249927fdf395201e5aa4a1bed7efe5cf5022f5.png) ![Screen Shot 2020-05-20 at 2.30.22 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/b/bb752d9c559fd3ae81fe3e99eca2ef12d3c1c01d.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 23, 2020, 9:07am UTC](https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041/3 "2020-05-23T09:07:12Z")

</div>

If I understand your question correctly, you are having problems getting JSON nodes. To solve this problem, you need to correctly create the path to the desired node. How do I do this?

I recommend that everyone use the online service [https://jsonpath.com/](https://jsonpath.com/), which can be used to quickly find the right path.

Try this line:

$. data.[0].japanese.[1]. reading

[] is a list.

After that, you need to implement this path in blocks:

1. get the data node
2. get the first item in the list
3. get a Japanese node
4. get the second item in the list
5. get the reading node

Any other paths are created in the same way

---

<div class="post-metadata">

**Author:** ![Deluxe](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/deluxe/32/30016_2.png) [@Deluxe](https://community.thunkable.com/u/Deluxe)\
**Post date:** [May 23, 2020, 9:21am UTC](https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041/4 "2020-05-23T09:21:36Z")

</div>

Hey @22morales5827tqbl2t

I created a sample app for you: [https://x.thunkable.com/copy/a290693b266dfa12282eaea7b1a46980](https://x.thunkable.com/copy/a290693b266dfa12282eaea7b1a46980)

It is key to understand that:

- you are dealing with two arrays, the first one is under “ **data** ” and the second one is under “ **japanese** ”.
- the first element in JSON objects is 0 while in lists is 1, hence my subtraction of 1 from the lists items count.

There is no error checking which explains the two “undefined” results when searching for “morning”.

Oh… and my example returns all entries, not just the first one so go ahead and remix my project as needed 😃

I hope this helps 🙂

Konstantinos

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 23, 2020, 10:49am UTC](https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041/5 "2020-05-23T10:49:12Z")

</div>

This is cool! Nice job! I was having a hard time with this api. for the last two days, I was getting a failure to fetch.

my blocks dont look different, so now it’s time to try again…

---

<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, 11:29am UTC](https://community.thunkable.com/t/need-help-with-json-list-and-api-bug/581041/6 "2024-11-08T11:29:03Z")

</div>


