# Probelm to fetch data

**URL:** <https://community.thunkable.com/t/probelm-to-fetch-data/1215145>\
**Category:** Questions about Thunkable X\
**Tags:** webapi\
**Created:** [April 9, 2021, 2:54pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145 "2021-04-09T14:54:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucasheide62w98zc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/lucasheide62w98zc/32/102772_2.png) [@lucasheide62w98zc](https://community.thunkable.com/u/lucasheide62w98zc)\
**Post date:** [April 9, 2021, 2:54pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/1 "2021-04-09T14:54:38Z")

</div>

Hello I have problems getting data from an api.

Api:  
{  
“coord”: {  
“lon”:  
“lat”:  
},  
“weather”: [  
{  
“id”: 800,  
“main”: “Clear”,  
“description”: “clear sky”,  
“icon”: “01d”  
}  
],  
“base”: “stations”,  
“main”: {  
“temp”: 304.17,  
“feels\_like”: 305.8,  
“temp\_min”: 304.17,  
“temp\_max”: 304.17,  
“pressure”: 1012,  
“humidity”: 50,  
“sea\_level”: 1012,  
“grnd\_level”: 996  
},  
“visibility”: 10000,  
“wind”: {  
“speed”: 6.49,  
“deg”: 15,  
“gust”: 9.5  
},  
“clouds”: {  
“all”: 1  
},  
“dt”: 1617972995,  
“sys”: {  
“country”: “PY”,  
“sunrise”: 1617963034,  
“sunset”: 1618005136  
},  
“timezone”: -14400,  
“id”: 3867291,  
“name”:  
“cod”: 200  
}

I do not get any data from this point of the api:

weather": [  
{  
“id”: 800,  
“main”: “Clear”,  
“description”: “clear sky”,  
“icon”: “01d”  
}  
],

is it because of these brackets? []

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [April 9, 2021, 3:04pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/2 "2021-04-09T15:04:09Z")

</div>

What you pasted in has some normal quotes and some reversed quotes. Did the API return that way, or did it get mangled by copy/paste/forum/something?

indicates an array of values. You can typically use a list block to get one member of the list.

---

<div class="post-metadata">

**Author:** ![lucasheide62w98zc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/lucasheide62w98zc/32/102772_2.png) [@lucasheide62w98zc](https://community.thunkable.com/u/lucasheide62w98zc)\
**Post date:** [April 9, 2021, 3:24pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/3 "2021-04-09T15:24:22Z")

</div>

It is also in the api.  
The api is from openweathermap

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [April 9, 2021, 3:30pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/4 "2021-04-09T15:30:30Z")

</div>

That’s from [openweathermap.org/current](http://openweathermap.org/current)? If so, you’ve somehow changed your quotes format. Here’s your API result (just the sample one from the webpage), better formatted:

```
    {
  "coord": {
    "lon": -122.08,
    "lat": 37.39
  },
  "weather": [
    {
      "id": 800,
      "main": "Clear",
      "description": "clear sky",
      "icon": "01d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 282.55,
    "feels_like": 281.86,
    "temp_min": 280.37,
    "temp_max": 284.26,
    "pressure": 1023,
    "humidity": 100
  },
  "visibility": 16093,
  "wind": {
    "speed": 1.5,
    "deg": 350
  },
  "clouds": {
    "all": 1
  },
  "dt": 1560350645,
  "sys": {
    "type": 1,
    "id": 5122,
    "message": 0.0139,
    "country": "US",
    "sunrise": 1560343627,
    "sunset": 1560396563
  },
  "timezone": -25200,
  "id": 420006353,
  "name": "Mountain View",
  "cod": 200
}

```

The square brackets means you’re getting an array of objects for “weather”, although the example only has one object in it.

You might find the last post on this thread useful - that was a similar embedded array situation: [How do you get a nested json object from an array - #9 by ochapple](https://community.thunkable.com/t/how-do-you-get-a-nested-json-object-from-an-array/564870/9)

---

<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:** [April 9, 2021, 3:33pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/5 "2021-04-09T15:33:25Z")

</div>

Hi, please see my tutorial about APIs and JSON. It will help you to get the data you need.

> [@API JSON Tutorial (Video)](https://community.thunkable.com/t/api-json-tutorial-video/1140575):
>
> Using APIs in Thunkable and understanding how to parse JSON to get certain data from the API response is both a popular and a difficult aspect of using Thunkable. It’s not so much difficult because of Thunkable but because every API url format is different, every API documentation is different, every JSON response is different, etc. In this video, I spend a lot of time talking you through some best practices. It’s not a quick tutorial because if you rush through setting up an API in Thunkable, …

---

<div class="post-metadata">

**Author:** ![lucasheide62w98zc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/lucasheide62w98zc/32/102772_2.png) [@lucasheide62w98zc](https://community.thunkable.com/u/lucasheide62w98zc)\
**Post date:** [April 9, 2021, 3:35pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/6 "2021-04-09T15:35:00Z")

</div>

Thanks @tatiang and @catsarisky

---

<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:25pm UTC](https://community.thunkable.com/t/probelm-to-fetch-data/1215145/7 "2024-11-08T13:25:26Z")

</div>


