get_weather
Query Australian weather for any date range, automatically fetching historical data or forecasts. Returns daily aggregates or hourly observations.
Instructions
Query weather over a date range. Routes to historical archive or forecast endpoint automatically based on the date range.
Routing logic: - end_date in the past (>= 5 days ago) → historical archive (1940+) - start_date in the future → forecast (today + 16 days max) - range straddles today → forecast with past_days set
Examples: # Historical: how was Sydney summer 2020? resp = await get_weather( "sydney", start_date="2020-01-01", end_date="2020-01-31", granularity="daily", ) # → 31 DailyAggregate rows with temp_max, temp_min, precip per day
# 7-day forecast for Melbourne, hourly detail
resp = await get_weather(
"melbourne",
start_date="2026-05-12",
end_date="2026-05-19",
granularity="hourly",
)
# → 168 hourly WeatherObservation rows
# Just today (omit both dates)
resp = await get_weather("brisbane")
# → today's daily aggregateWhen to use: - Time-series queries (forecast over the next week, or historical comparison) - Multi-day weather analysis - Climate research and historical look-backs (decade-scale via archive)
Returns:
WeatherResponse with either daily or hourly populated depending
on granularity. Period bounds populated from actual returned data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | Any Australian location. Same accepted shapes as latest(): curated ID, place name (any case), state code/name, or raw 'lat,lng' coordinates. | |
| start_date | No | Inclusive start date in 'YYYY-MM-DD' format. Open-Meteo's historical archive covers 1940-01-01 onwards (5-day lag). Forecast covers today through today + 16 days. | |
| end_date | No | Inclusive end date in 'YYYY-MM-DD' format. Same range rules as start_date. | |
| granularity | No | Time resolution of the returned series. 'daily' (default) returns one row per day with max/min/sum aggregates. 'hourly' returns one row per hour with point observations — useful for intraday detail but expect ~24× more records. | daily |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location_id | Yes | ||
| location_name | Yes | ||
| state | Yes | ||
| latitude | Yes | ||
| longitude | Yes | ||
| timezone | Yes | ||
| location_resolution | Yes | ||
| location_input | Yes | ||
| query | No | ||
| period | No | ||
| current | No | ||
| hourly | No | ||
| daily | No | ||
| source | No | Open-Meteo (aggregates Bureau of Meteorology data under licence) | |
| attribution | No | Weather data by Open-Meteo.com (https://open-meteo.com), licensed under CC BY 4.0. Underlying data includes the Australian Bureau of Meteorology (https://www.bom.gov.au) under Open-Meteo's licensing arrangement. | |
| source_url | Yes | ||
| retrieved_at | Yes | ||
| server_version | Yes | ||
| stale | No | ||
| stale_reason | No |