# \[SOLVED\]Trouble receiving data from web api

**URL:** <https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381>\
**Category:** Web API's\
**Tags:** solved\
**Created:** [June 12, 2022, 12:30pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381 "2022-06-12T12:30:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanishq](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tanishq/32/124339_2.png) [@tanishq](https://community.thunkable.com/u/tanishq)\
**Post date:** [June 12, 2022, 12:30pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381/1 "2022-06-12T12:30:51Z")

</div>

Hello everyone,

I am having trouble receiving data from an api called [weatherbit](https://weatherbit.io)  
it requires an api key which i have given, I want to just display the weather from the response.  
It also requires:- (which are given)

- Latitude & Longitude (which are given through `map component`)

This what I have tried so far: -

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/4/5463620f16317830f987d6e33b0c1b8cab127b99.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 12, 2022, 2:19pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381/2 "2022-06-12T14:19:21Z")

</div>

You need to fist check the green **error** block to see that the API has been executed successfully before attempting to read the response block.

---

<div class="post-metadata">

**Author:** ![tanishq](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tanishq/32/124339_2.png) [@tanishq](https://community.thunkable.com/u/tanishq)\
**Post date:** [June 12, 2022, 4:22pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381/3 "2022-06-12T16:22:01Z")

</div>

it gives `null`

---

<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:** [June 12, 2022, 4:56pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381/4 "2022-06-12T16:56:54Z")

</div>

When using an API with Thunkable, the first step should be to make sure you can get a valid JSON response **in a browser** without using Thunkable. What happens if you paste the whole url into a browser? Does that work? If so, post that response here as text and format it using the “Preformatted text” button in the toolbar ( \</\> ).

Also, I don’t think there is a “temp” property at the top level of the JSON. So once we have your JSON response, we can help you figure out how to access that property. You may find my tutorial helpful: [API JSON Tutorial (Video)](https://community.thunkable.com/t/api-json-tutorial-video/1140575).

**Edit:** there are many “temp” properties but the first one is here:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/c/8c6fafd7c8ec784619a34f9917636abc50b69e33.png)

You can see on [Best JSON Viewer and JSON Beautifier Online](https://codebeautify.org/jsonviewer) that the path to that property shown at the top is “data[1].temp” whereas you’re trying to access it as just “temp”.

---

<div class="post-metadata">

**Author:** ![tanishq](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tanishq/32/124339_2.png) [@tanishq](https://community.thunkable.com/u/tanishq)\
**Post date:** [June 13, 2022, 12:33pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381/5 "2022-06-13T12:33:48Z")

</div>

> [@tatiang](#):
>
> You may find my tutorial helpful: [API JSON Tutorial (Video)](https://community.thunkable.com/t/api-json-tutorial-video/1140575).

I got my mistake by your tutorial, Thanks @tatiang @muneer for replying! 😀

---

<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, 1:13pm UTC](https://community.thunkable.com/t/solved-trouble-receiving-data-from-web-api/1921381/6 "2024-11-08T13:13:11Z")

</div>


