# Weather forecast

**URL:** <https://community.thunkable.com/t/weather-forecast/1646239>\
**Category:** Questions about Thunkable X\
**Created:** [December 4, 2021, 12:16pm UTC](https://community.thunkable.com/t/weather-forecast/1646239 "2021-12-04T12:16:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimaurosalvo19717s1y](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@dimaurosalvo19717s1y](https://community.thunkable.com/u/dimaurosalvo19717s1y)\
**Post date:** [December 4, 2021, 12:16pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/1 "2021-12-04T12:16:27Z")

</div>

Hello  
I watched the videos [https://www.youtube.com/watch?v=V-OO0wEYcrs](https://www.youtube.com/watch?v=V-OO0wEYcrs)  
the APIKEy to take the temperature from the site [https://home.openweathermap.org/api\_keys](https://home.openweathermap.org/api_keys)  
I would like to know if it is possible to take rain or sun or cloud data

---

<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:** [December 4, 2021, 5:32pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/2 "2021-12-04T17:32:07Z")

</div>

I’ve used their weather icons… is that what you mean?

---

<div class="post-metadata">

**Author:** ![dimaurosalvo19717s1y](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@dimaurosalvo19717s1y](https://community.thunkable.com/u/dimaurosalvo19717s1y)\
**Post date:** [December 4, 2021, 6:13pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/3 "2021-12-04T18:13:49Z")

</div>

I intend to take the forecasts, even the icons, and if possible have the forecasts for a given day

---

<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:** [December 4, 2021, 7:32pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/4 "2021-12-04T19:32:44Z")

</div>

I haven’t worked with forecasts. I’ve only gotten current conditions.

But this topic is all about getting the weather icon:

> [@How can to Set the Image Icon According to the City from Open Weather Map API](https://community.thunkable.com/t/how-can-to-set-the-image-icon-according-to-the-city-from-open-weather-map-api/1403386):
>
> Hi, Please help me with setting the icon from open weather map api. I am unable to get the code.

---

<div class="post-metadata">

**Author:** ![dimaurosalvo19717s1y](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@dimaurosalvo19717s1y](https://community.thunkable.com/u/dimaurosalvo19717s1y)\
**Post date:** [December 4, 2021, 9:52pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/5 "2021-12-04T21:52:02Z")

</div>

[http://api.openweathermap.org/data/2.5/weather?q=Londra&units=metric&APPID=6921a88aa644707f21e8a964942214ae](http://api.openweathermap.org/data/2.5/weather?q=Londra&units=metric&APPID=6921a88aa644707f21e8a964942214ae)

I would like to retrieve the data in bold

{“coord”:{“lon”:-0.0918,“lat”:51.5128},“weather”:[{“id”:500,“main”:“Rain”, **“description”:“light rain”** , **“icon”:“10n”** }],“base”:“stations”,“main”:{“temp”:5.27,“feels\_like”:4.47,“temp\_min”:3.95,“temp\_max”:6.25,“pressure”:998,“humidity”:79},“visibility”:10000,“wind”:{“speed”:1.34,“deg”:274,“gust”:5.36},“rain”:{“1h”:0.18},“clouds”:{“all”:40},“dt”:1638654025,“sys”:{“type”:2,“id”:2019646,“country”:“GB”,“sunrise”:1638604085,“sunset”:1638633211},“timezone”:0,“id”:2643741,“name”:“City of London”,“cod”:200}

if I recover the temperature with these blocks, because I cannot recover the other data as well

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

---

<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:** [December 4, 2021, 10:00pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/6 "2021-12-04T22:00:57Z")

</div>

I’m reposting your JSON text with smart quotes removed since the forum software seems to mess that up:

```auto
{"coord":{"lon":-0.0918,"lat":51.5128},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"base":"stations","main":{"temp":5.27,"feels_like":4.47,"temp_min":3.95,"temp_max":6.25,"pressure":998,"humidity":79},"visibility":10000,"wind":{"speed":1.34,"deg":274,"gust":5.36},"rain":{"1h":0.18},"clouds":{"all":40},"dt":1638654025,"sys":{"type":2,"id":2019646,"country":"GB","sunrise":1638604085,"sunset":1638633211},"timezone":0,"id":2643741,"name":"City of London","cod":200}

```

One way to avoid that is to add three tick marks (```) before and after the JSON text. Or select your text and click the Preformatted text button in the post toolbar:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/a/7a1e6beb5f4dde6d0344b8e1477a99ec6f71deb1.png)

When I put that reformatted text into [Best JSON Viewer and JSON Beautifier Online](https://codebeautify.org/jsonviewer), I get this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/2/32176a42c2adc00540cd35c0f60d1df4097c7810.png)

You can see that when I clicked on “description” on that site, it provides the path to that property at the top. So it’s (object)–\>weather–\>[first list item]–\>description.

Try this property in the `get property of object` block: “weather[1].description” or “weather[1].icon”. You can use multiple `get property of object` blocks as in your screenshot but you don’t have to. My method is a shortcut where you add all properties and list indexes in a single text string.

---

<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:** [December 4, 2021, 10:15pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/7 "2021-12-04T22:15:47Z")

</div>

Here’s a demo project (see the screen with your username in the title):

[https://x.thunkable.com/copy/bc9585eeb54499f5352488634b3b8a7c](https://x.thunkable.com/copy/bc9585eeb54499f5352488634b3b8a7c)

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

**Note:** I removed your APP ID from the Web\_API1’s URL block. It’s up to you but you may want to remove it from your post above since anyone can then use your APP ID/key.

---

<div class="post-metadata">

**Author:** ![dimaurosalvo19717s1y](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@dimaurosalvo19717s1y](https://community.thunkable.com/u/dimaurosalvo19717s1y)\
**Post date:** [December 4, 2021, 11:26pm UTC](https://community.thunkable.com/t/weather-forecast/1646239/8 "2021-12-04T23:26:37Z")

</div>

Thank you so much

---

<div class="post-metadata">

**Author:** ![dimaurosalvo19717s1y](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@dimaurosalvo19717s1y](https://community.thunkable.com/u/dimaurosalvo19717s1y)\
**Post date:** [December 6, 2021, 7:33am UTC](https://community.thunkable.com/t/weather-forecast/1646239/9 "2021-12-06T07:33:01Z")

</div>

Hello  
I tried to insert the following link for the forecast 3 days from today, but it gives me an API error, are there any restrictions for use?

[https://openweathermap.org/forecast16#limit](https://openweathermap.org/forecast16#limit)

Example link from the site by inserting my ApiKey

[[http://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=3&appid=](http://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=3&appid=)[{API key}](https://home.openweathermap.org/api_keys)]([http://api.openweathermap.org/data/2.5/forecast/daily?q=\*\*London\*\*&cnt=\*\*3\*\*&appid=](http://api.openweathermap.org/data/2.5/forecast/daily?q= **London** &cnt= **3** &appid=)**[{API key}]**([Members](https://home.openweathermap.org/api_keys)))

Result

> {“cod”:401, “message”: “Invalid API key. Please see [Frequently Asked Questions - OpenWeatherMap](http://openweathermap.org/faq#error401) for more info.”}

can you clarify the subject?

---

<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:** [December 6, 2021, 8:04am UTC](https://community.thunkable.com/t/weather-forecast/1646239/10 "2021-12-06T08:04:04Z")

</div>

Have you paid for a subscription? The free version of OpenWeatherMap does not allow you to get daily forecast data for 16 days which I think is what you’re trying. Instead, use the free 5 day forecast:

[https://openweathermap.org/forecast5](https://openweathermap.org/forecast5)

So an example that works for me is:

[https://api.openweathermap.org/data/2.5/forecast?q=London&cnt=3&appid={API%20key}](https://api.openweathermap.org/data/2.5/forecast?q=London&cnt=3&appid=%7BAPI%20key%7D)

---

<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:** [March 6, 2022, 8:04am UTC](https://community.thunkable.com/t/weather-forecast/1646239/11 "2022-03-06T08:04:12Z")

</div>

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