# Weather snapshots (https://nolantw.github.io/cwa/en/guides/weather/)

`cwa.weather.get()` returns the three things most often needed for a township in one call: the forecast, current conditions from a nearby station and the active warnings. For a weather app or notifications, this is usually all you need.

```python
import cwa

weather = cwa.weather.get("臺北市信義區", days=3)

if weather.current:
    print("Now", weather.current.temperature)
if weather.today:
    print("Chance of rain today", weather.today.precipitation.max_probability)
for alert in weather.alerts:
    print(alert.title)
```

`days` works as in [Forecasts](/en/guides/forecast) and defaults to 7.

| Field | Contains | Details |
| --- | --- | --- |
| `location` | The queried township | [Locations](/en/guides/locations) |
| `as_of` | Query time | |
| `current` | Current conditions, see below; `None` when no station qualifies | [Observations and stations](/en/guides/observations) |
| `forecast` | The full forecast | [Forecasts](/en/guides/forecast) |
| `today`, `tomorrow` | The forecasts for today and tomorrow, same as `forecast.today` and `forecast.tomorrow`; `None` when not covered | [Forecasts](/en/guides/forecast#daily-fields) |
| `alerts` | Warnings affecting this township; loop over it with `for` | [Warnings](/en/guides/alerts) |

## Current weather

`current` comes from the nearest station within 10 km that has a reading from the last two hours. That station may be in a neighboring township.

These fields are available directly on `current`:

| Field | Description |
| --- | --- |
| `current.station` | The reporting station, for example `current.station.name` |
| `current.distance_km` | Distance from the station to the township's reference point (km) |
| `current.observed_at` | Observation time |
| `current.temperature` | Air temperature (°C) |

Humidity, pressure, wind, rainfall and the weather condition are in `current.observation`:

```python
if weather.current:
    observation = weather.current.observation
    print(observation.humidity, observation.pressure, observation.wind.speed, observation.precipitation.millimetres)
```

See [Observation fields](/en/guides/observations#observation-fields) for each field's unit and what a missing value means. To change the distance or time limits, use `cwa.observations.nearest()` instead.

## Many townships

Pass a county or a list to get results keyed by township; `get_all()` covers every township in Taiwan. See [Batch queries and export](/en/advanced/batch).