# Weather forecasting

## Try it in the Widget Center

Click this [url](https://app.myshell.ai/robot-workshop/widget/1781991520180035584) to try this widget and copy the Pro Config template.

## Usage

Perform weather forecasting either by the given `city_name` or the specific latitude/longitude

**Input Parameters**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>city_name</td><td><code>string</code></td><td>The city name you want to get the weather information of.</td><td></td><td>false</td></tr><tr><td>latitude</td><td><code>number</code></td><td>The latitude of a location, if it is north, use positive numbers; if it is south, use negative numbers. The range is from -90 to +90</td><td>0</td><td>false</td></tr><tr><td>longitude</td><td><code>number</code></td><td>The longitude of a location, if it is east, use positive numbers; if it is west, use negative numbers. The range is from -180 to +180</td><td>0</td><td>false</td></tr><tr><td>units</td><td><code>string</code></td><td>For temperature in Fahrenheit use `imperial`. For temperature in Celsius use `metric`. For temperature in Kelvin use `standard`. We use `imperial` by default</td><td>imperial</td><td>false</td></tr><tr><td>use_specific_loc</td><td><code>boolean</code></td><td>Whether to use latitude&#x26;longitude for weather forecasting.</td><td>False</td><td>false</td></tr></tbody></table>

**Output Parameters**

| Name    | Type     | Description         | File Type |
| ------- | -------- | ------------------- | --------- |
| city    | `object` | City information    |           |
| weather | `object` | Weather information |           |

**Output Example**

{% tabs %}
{% tab title="success" %}
{% code fullWidth="false" %}

```json
{
  "city": {
    "coord": {
      "lat": 39.9075,
      "lon": 116.3972
    },
    "country": "CN",
    "name": "Beijing"
  },
  "weather": {
    "feels_like": [
      60.37,
      57.78,
      53.22,
      57.27,
      67.89,
      76.69,
      78.76,
      72.16,
      66.2,
      60.12,
      57.45,
      62.55,
      74.68,
      83.48,
      87.51,
      80.96,
      79.16,
      71.87,
      66.13,
      68.74,
      76.57,
      83.21,
      81.41,
      76.17,
      70.43,
      66.65,
      62.31,
      64.63,
      72.75,
      79.72,
      79.75,
      68.07,
      62.96,
      60.28,
      59.31,
      58.14,
      59.59,
      60.3,
      59.18,
      54.37
    ],
    "humidity": [
      34,
      38,
      49,
      41,
      23,
      16,
      13,
      21,
      24,
      40,
      51,
      40,
      24,
      15,
      11,
      21,
      24,
      31,
      38,
      33,
      29,
      26,
      31,
      45,
      51,
      55,
      50,
      44,
      35,
      33,
      31,
      36,
      51,
      47,
      44,
      38,
      39,
      40,
      46,
      78
    ],
    "temp": [
      62.8,
      60.26,
      55.65,
      59.68,
      70.11,
      78.4,
      80.76,
      74.07,
      68.52,
      62.31,
      59.41,
      64.51,
      76.23,
      87.03,
      91.9,
      83.5,
      79.16,
      73.38,
      67.86,
      70.45,
      77.74,
      85.91,
      83.12,
      76.69,
      71.2,
      67.6,
      63.88,
      66.24,
      74.01,
      80.51,
      80.8,
      69.71,
      64.42,
      62.15,
      61.39,
      60.58,
      61.88,
      62.47,
      61.2,
      55.45
    ],
    "temp_max": [
      62.8,
      60.26,
      55.65,
      59.68,
      70.11,
      78.4,
      80.76,
      74.07,
      68.52,
      62.31,
      59.41,
      64.51,
      76.23,
      87.03,
      91.9,
      83.5,
      79.16,
      73.38,
      67.86,
      70.45,
      77.74,
      85.91,
      83.12,
      76.69,
      71.2,
      67.6,
      63.88,
      66.24,
      74.01,
      80.51,
      80.8,
      69.71,
      64.42,
      62.15,
      61.39,
      60.58,
      61.88,
      62.47,
      61.2,
      55.45
    ],
    "temp_min": [
      60.58,
      58.42,
      55.65,
      59.68,
      70.11,
      78.4,
      80.76,
      74.07,
      68.52,
      62.31,
      59.41,
      64.51,
      76.23,
      87.03,
      91.9,
      83.5,
      79.16,
      73.38,
      67.86,
      70.45,
      77.74,
      85.91,
      83.12,
      76.69,
      71.2,
      67.6,
      63.88,
      66.24,
      74.01,
      80.51,
      80.8,
      69.71,
      64.42,
      62.15,
      61.39,
      60.58,
      61.88,
      62.47,
      61.2,
      55.45
    ],
    "time": [
      "2024-04-23 15:00:00",
      "2024-04-23 18:00:00",
      "2024-04-23 21:00:00",
      "2024-04-24 00:00:00",
      "2024-04-24 03:00:00",
      "2024-04-24 06:00:00",
      "2024-04-24 09:00:00",
      "2024-04-24 12:00:00",
      "2024-04-24 15:00:00",
      "2024-04-24 18:00:00",
      "2024-04-24 21:00:00",
      "2024-04-25 00:00:00",
      "2024-04-25 03:00:00",
      "2024-04-25 06:00:00",
      "2024-04-25 09:00:00",
      "2024-04-25 12:00:00",
      "2024-04-25 15:00:00",
      "2024-04-25 18:00:00",
      "2024-04-25 21:00:00",
      "2024-04-26 00:00:00",
      "2024-04-26 03:00:00",
      "2024-04-26 06:00:00",
      "2024-04-26 09:00:00",
      "2024-04-26 12:00:00",
      "2024-04-26 15:00:00",
      "2024-04-26 18:00:00",
      "2024-04-26 21:00:00",
      "2024-04-27 00:00:00",
      "2024-04-27 03:00:00",
      "2024-04-27 06:00:00",
      "2024-04-27 09:00:00",
      "2024-04-27 12:00:00",
      "2024-04-27 15:00:00",
      "2024-04-27 18:00:00",
      "2024-04-27 21:00:00",
      "2024-04-28 00:00:00",
      "2024-04-28 03:00:00",
      "2024-04-28 06:00:00",
      "2024-04-28 09:00:00",
      "2024-04-28 12:00:00"
    ],
    "visibility": [
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000,
      10000
    ],
    "weather": [],
    "wind_degree": [
      152,
      183,
      168,
      187,
      202,
      204,
      209,
      177,
      148,
      54,
      42,
      32,
      164,
      197,
      208,
      199,
      195,
      218,
      144,
      101,
      104,
      67,
      344,
      85,
      92,
      97,
      87,
      73,
      88,
      143,
      145,
      99,
      82,
      95,
      86,
      103,
      103,
      86,
      10,
      352
    ],
    "wind_speed": [
      3.69,
      2.8,
      2.73,
      4.41,
      8.75,
      11.5,
      12.55,
      8.08,
      6.04,
      4.16,
      4.85,
      4.41,
      3.36,
      5.7,
      9.95,
      8.3,
      12.21,
      5.39,
      1.81,
      1.1,
      3.44,
      0.63,
      12.86,
      3.67,
      5.48,
      5.84,
      5.88,
      6.26,
      5.64,
      6.91,
      11.86,
      10.96,
      5.99,
      6.26,
      4.45,
      6.67,
      7,
      3.04,
      8.34,
      7.74
    ]
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
