# \[Solved\] Web-API Returning unknown error

**URL:** <https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237>\
**Category:** Questions about Thunkable X\
**Tags:** webapi\
**Created:** [February 12, 2021, 3:56pm UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237 "2021-02-12T15:56:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![virajkhanna4ade](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@virajkhanna4ade](https://community.thunkable.com/u/virajkhanna4ade)\
**Post date:** [February 12, 2021, 3:56pm UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/1 "2021-02-12T15:56:16Z")

</div>

Hi everyone, I am getting this error on using a web-API component in my app.  
@domhnallohanlon Could you help?  
Could someone help me?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/1/910474c0d303ed06cd5d3d3fa3209744b64ee0c0.png)  
I am using Thunkable Live to test my app.

---

<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:** [February 12, 2021, 4:01pm UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/2 "2021-02-12T16:01:44Z")

</div>

You’ll need to post a screenshot of the blocks you’re using to get data from the API. Make sure the full url is included (remove your API key first).

---

<div class="post-metadata">

**Author:** ![virajkhanna4ade](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@virajkhanna4ade](https://community.thunkable.com/u/virajkhanna4ade)\
**Post date:** [February 13, 2021, 2:44am UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/3 "2021-02-13T02:44:12Z")

</div>

My Blocks (Removed the API Key)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cd854f1423c29b019be691faea00897c683ead0f.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/0/b0b0e9c575abc215accab27e1eb2097942aed988.png)

I followed this tutorial: [How to use the Thunkable Web API: Weather App - Part 1 - YouTube](https://www.youtube.com/watch?v=V-OO0wEYcrs)

---

<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:** [February 13, 2021, 3:35am UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/4 "2021-02-13T03:35:08Z")

</div>

Your blocks look correct to me. If I use your url and substitute “oakland” for the location variable and enter that all in a browser with my API key, I get a valid JSON response:

```auto
{"coord":{"lon":-83.3999,"lat":42.6667},"weather":[{"id":600,"main":"Snow","description":"light snow","icon":"13n"}],"base":"stations","main":{"temp":-8.45,"feels_like":-13.33,"temp_min":-9,"temp_max":-7.78,"pressure":1027,"humidity":86},"visibility":10000,"wind":{"speed":2.57,"deg":40},"clouds":{"all":75},"dt":1613186721,"sys":{"type":1,"id":5424,"country":"US","sunrise":1613133269,"sunset":1613170882},"timezone":-18000,"id":5004223,"name":"Oakland","cod":200}

```

Copying and pasting that into a [JSON formatter](https://jsonformatter-online.com/), I then get:

![Screen Shot 2021-02-12 at 7.32.58 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/a/2a836257e32435527f41377d1089b4ee88d18fc8.png)

Which shows me that the correct properties are “main” and then “temp”.

Because it’s not working for you, my guess would be that there’s a problem with your API key or some other reason the server is not returning the response you’re expecting.

Are you able to paste the full url into a browser window and get valid JSON as a response? That should be your first step before doing anything in Thunkable. For example, if you were to browse to [https://api.openweathermap.org/data/2.5/weather?q=oakland&units=metric&APPID=](https://api.openweathermap.org/data/2.5/weather?q=oakland&units=metric&APPID=)**[enter your API key here]**, do you see a JSON response?

If you set a label to the green _error_ block, what is the value of that block when you preview the app? I always check for that and also check to make sure that the value of the green _status_ block is “200”.

---

<div class="post-metadata">

**Author:** ![virajkhanna4ade](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@virajkhanna4ade](https://community.thunkable.com/u/virajkhanna4ade)\
**Post date:** [February 13, 2021, 3:43am UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/5 "2021-02-13T03:43:41Z")

</div>

I am able to get the response in my browser (STATUS: 200)

> [@tatiang](#):
>
> do you see a JSON response?

Yes

> [@tatiang](#):
>
> If you set a label to the green _error_ block, what is the value of that block when you preview the app? I always check for that and also check to make sure that the value of the green _status_ block is “200”.

My label shows  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/8/68d7715c86fea80810bc840c3c02012b3ecf006f.png)

---

<div class="post-metadata">

**Author:** ![virajkhanna4ade](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@virajkhanna4ade](https://community.thunkable.com/u/virajkhanna4ade)\
**Post date:** [February 13, 2021, 4:17am UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/6 "2021-02-13T04:17:30Z")

</div>

It works now! Thanks for the help!

---

<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:** [February 13, 2021, 5:50am UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/7 "2021-02-13T05:50:13Z")

</div>

Glad to hear it! Did you have to change something?

---

<div class="post-metadata">

**Author:** ![virajkhanna4ade](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@virajkhanna4ade](https://community.thunkable.com/u/virajkhanna4ade)\
**Post date:** [February 13, 2021, 5:50am UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/8 "2021-02-13T05:50:50Z")

</div>

Nope. It started working on its own

---

<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:29pm UTC](https://community.thunkable.com/t/solved-web-api-returning-unknown-error/1094237/9 "2024-11-08T13:29:25Z")

</div>


