get_historical_weather
Retrieve historical weather data for any location by specifying latitude, longitude, and date range. Choose from hourly or daily variables like temperature, precipitation, and wind speed.
Instructions
Get historical weather data from Open-Meteo Archive API.
Args: latitude: Latitude coordinate (-90 to 90) longitude: Longitude coordinate (-180 to 180) start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format temperature_unit: Temperature unit - celsius, fahrenheit wind_speed_unit: Wind speed unit - kmh, ms, mph, kn precipitation_unit: Precipitation unit - mm, inch timezone: Timezone (e.g., 'America/New_York', 'auto' for automatic) hourly: Comma-separated hourly variables daily: Comma-separated daily variables
Returns: HistoricalWeather: Pydantic model with historical data
Example: historical = await get_historical_weather( 48.8566, 2.3522, "2024-01-01", "2024-01-07", daily="temperature_2m_max,temperature_2m_min" ) avg_high = sum(historical.daily.temperature_2m_max) / len(historical.daily.temperature_2m_max)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| daily | No | ||
| hourly | No | ||
| end_date | Yes | ||
| latitude | Yes | ||
| timezone | No | auto | |
| longitude | Yes | ||
| start_date | Yes | ||
| wind_speed_unit | No | kmh | |
| temperature_unit | No | celsius | |
| precipitation_unit | No | mm |