Get the whole-day forecast at a place, for one day or several days in a row.
Use this for "how is the weather tomorrow" or "how is the weather at the weekend", and
for the total rain of a day. Each day covers a Swiss calendar day, 00:00 to 24:00 local
time. The minimum and maximum are the lowest and highest hourly mean temperature of
that day, and the weather words describe the daytime.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
start_date (str): The first day, e.g. "2026-09-23". Today or up to 8 days ahead.
days (int): How many days in a row, from 1 to 9. Default 1.
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, one row per day and the model run. In 8 of 10 possible outcomes,
the day's rain lies between its 10th and 90th percentile. A value is None when
MeteoSwiss does not publish it for the place.
Examples:
forecast_daily("Zürich", "2026-09-23")
forecast_daily("Zürich", "2026-09-26", 2) # a weekend
输入参数daysnearlocation必填start_date必填
Get when and how much it may rain at a place, and the weather in words, in 3-hour blocks
over a period.
Use this for "will it rain at 15:00" or "how is the weather this afternoon". Each block
covers the 3 hours between its from and to times
and gives the chance of rain, the median rainfall, how much the wettest hour may bring
(its 90th percentile) and the weather in words. The median is often 0 when showers are
possible, so read the chance and the "up to" amount as well. A period up to the end of
the forecast ends with its last full 3-hour block. Medians do not add up, so for the
total rain of a whole day use forecast_daily.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
start (str): Start of the period, a full hour, e.g. "2026-09-23T12:00". Today or up to 8 days ahead.
end (str): End of the period, a full hour after start, e.g. "2026-09-23T18:00".
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, one row per 3-hour block and the model run.
Examples:
forecast_rain("Zürich", "2026-09-23T15:00", "2026-09-23T18:00") # 15:00
forecast_rain("Zürich", "2026-09-23T12:00", "2026-09-23T18:00") # the afternoon
输入参数end必填nearstart必填location必填
Get the temperature hour by hour at a place, with its likely range.
Use this for "how warm is it at 15:00" or "how warm is it this afternoon". Without end
it returns the one hour starting at start. Each row gives the mean temperature of one
hour, between its from and to times.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
start (str): Start of the period, a full hour, e.g. "2026-09-23T15:00". Today or up to 8 days ahead.
end (str): Optional. End of the period, a full hour after start, e.g. "2026-09-23T18:00".
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, one row per hour and the model run. In 8 of 10 possible outcomes,
the temperature lies between its 10th and 90th percentile.
Examples:
forecast_temperature("Zürich", "2026-09-23T15:00") # one hour
forecast_temperature("Zürich", "2026-09-23T12:00", "2026-09-23T18:00") # the afternoon
输入参数endnearstart必填location必填
Get the sunshine hours at a place over a period.
Use this for "how sunny is it at 15:00" or "how sunny is it this afternoon". Without end
it returns the one hour starting at start.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
start (str): Start of the period, a full hour, e.g. "2026-09-23T06:00". Today or up to 8 days ahead.
end (str): Optional. End of the period, a full hour after start, e.g. "2026-09-23T18:00".
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, the sunshine in hours, the period and the model run.
Examples:
forecast_sunshine("Zürich", "2026-09-23T15:00") # one hour
forecast_sunshine("Zürich", "2026-09-23T12:00", "2026-09-23T18:00") # the afternoon
输入参数endnearstart必填location必填
Get the wind at a place at a specific time: mean speed, strongest gust and direction.
Use this for "how windy is it at 14:00". The speed is the mean over the hour up to that
time, and the gust the strongest one-second gust in that hour. In 9 of 10 possible
outcomes the gust stays below its 90th percentile, so the percentile is a cautious high
estimate, not the highest gust possible. The direction is where the wind blows from, in
degrees clockwise from north (0 is a north wind, 180 a south wind) and as a compass
point.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
when (str): A full hour, e.g. "2026-09-23T14:00". Today or up to 8 days ahead.
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, the wind, the time it is valid for and the model run.
Examples:
forecast_wind("Zürich", "2026-09-23T14:00")
输入参数nearwhen必填location必填
Get how cloudy it is at a place at a specific time.
Use this for "how cloudy is it at 14:00". MeteoSwiss publishes low, medium and high
cloud separately, and they overlap, so the total is an estimate that assumes the layers
are independent. All three layers are returned as well, so low cloud such as fog can be
told apart from high cloud.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
when (str): A full hour, e.g. "2026-09-23T14:00". Today or up to 8 days ahead.
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, the total cloud cover and its low, medium and high layers in
percent, the time it is valid for and the model run.
Examples:
forecast_cloud_cover("Zürich", "2026-09-23T14:00")
输入参数nearwhen必填location必填
Get the freezing level, the height of the 0 °C line, at a place at a specific time.
Use this for "how high is the freezing level at 14:00".
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
when (str): A full hour, e.g. "2026-09-23T14:00". Today or up to 8 days ahead.
Returns:
dict: data_from when the forecast point is far away or at a significantly different
height, the place, the freezing level in metres above sea level, the time it is
valid for and the model run.
Examples:
forecast_freezing_level("Zürich", "2026-09-23T14:00")
输入参数nearwhen必填location必填
Get the latest measurements of a MeteoSwiss station near a place.
Use this for "how warm is it now" or "is it raining now". The values are those of the
station named in data_from. MeteoSwiss publishes new values about every 10 minutes.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
Returns:
dict: data_from, the place, the time of the measurements and the measured values. A
value is None when the station has not published it.
Examples:
measurements_current("Zürich")
输入参数nearlocation必填
Get where in Switzerland it is warmest, coldest, windiest, wettest or sunniest now.
Use this for "where is it warmest now" or "where is it sunny now". The values are those
of about 160 MeteoSwiss stations, so give the altitude with each station. For the
sunniest, the stations are grouped by their sun in the last 10 minutes with MeteoSwiss's
sunshine terms: mostly sunny (8 to 10 minutes), rather sunny (5 to 7), partly sunny (2 to
4), only a little sunshine (1) and hardly any sunshine (0). The cantons come in order of
their stations' average sun, sunniest first. A station is rainy when it had rain in the
last 10 minutes.
Args:
extreme (str): One of "warmest", "coldest", "windiest", "wettest" or "sunniest".
Returns:
dict: The time of the measurements and the first 5 stations. For the sunniest instead
the number of stations in each sunshine group, in Switzerland and in each canton,
the sunniest canton first. For the wettest also the number of rainy stations out of
those that measure rain, in Switzerland and in each canton.
Examples:
measurements_extremes("warmest")
输入参数extreme必填
Get when the Sun rises and sets at a place on a day, and when civil twilight begins and ends.
Use this for "when does the sun rise tomorrow" or "until when is it light tonight". Civil
twilight is the light before sunrise and after sunset; outside it, artificial light is
normally needed outdoors. The times are for a level horizon, so in a valley the Sun
appears later behind the mountains.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
date (str): The day, e.g. "2026-09-23".
Returns:
dict: The place, the date, the begin of civil twilight, sunrise, sunset and the end of
civil twilight.
Examples:
astronomy_sun("Zürich", "2026-09-23")
输入参数date必填nearlocation必填
Get when the Moon rises and sets at a place on a day, its phase and how much of it is lit.
Use this for "when does the moon rise tonight" or "how full is the moon tonight". The
times are for a level horizon, so in a valley the Moon appears later behind the
mountains. The day has a moon_phase_time when New Moon, First Quarter, Full Moon or Last
Quarter happens on it. The lit percent is the one at 12:00.
Args:
location (str): Name of a place in Switzerland, e.g. "Zürich".
date (str): The day, e.g. "2026-09-23".
Returns:
dict: The place, the date, the moonrise and moonset, None when the Moon does not rise
or set that day, the phase with its emoji and time, and the lit percent.
Examples:
astronomy_moon("Zürich", "2026-09-23")
输入参数date必填nearlocation必填
Get the current weekday and Swiss local time.
Call this first when the question is relative, such as "tomorrow" or "tonight", because
the forecast tools take a real date rather than an offset. The time is written the way
the tools read it, ISO 8601 without an offset, so it can be sent back to them as it is.
Returns:
str: For example "Today is Wednesday, 2026-09-23T13:02 (Swiss time)".
无需输入参数。