Get period totals
get_period_totalsAggregate a weather variable over one or more time periods. Returns server-computed totals, maxima, minima, or averages per period. Period start/end times should use the user's local timezone boundaries (not UTC midnight). Response includes the converted value and unit per period. Ideal for questions like "total rainfall today and tomorrow" or "peak wind speed this weekend". Accepts a place name directly. Example: {"location": "Portland, OR", "variable": "precipitation", "aggregation": "sum", "periods": [{"start": "2026-07-08T07:00:00Z", "end": "2026-07-09T07:00:00Z", "label": "Today"}]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | No | Latitude in decimal degrees (-90 to 90). Most tools also accept a `location` place-name string instead of lat/lon. | |
| lon | No | Longitude in decimal degrees (-180 to 180). For continental US use negative values (west of the prime meridian). | |
| units | No | Unit system for all values in the request and response: imperial (°F, mph, inches), metric (°C, km/h, mm), or si (K, m/s, mm). Defaults to imperial. | imperial |
| periods | Yes | Time periods to aggregate over (1-14). | |
| location | No | Free-text place: city ("Denver"), city+state ("Portland, OR"), US ZIP ("50219"), or "lat,lon" ("39.74,-104.99"). Provide either this OR explicit lat+lon, not both. | |
| variable | Yes | Standard variable name (e.g. precipitation, snowfall, temperature_2m, wind_speed_10m, cape). | |
| dataset_id | No | Dataset override. Default: auto-resolved NBM for the location. | |
| aggregation | No | Aggregation function. Default sum. Use sum for precipitation/snowfall, max for temperature/wind, min for low temperatures, avg for humidity/cloud cover. | sum |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | ||
| periods | Yes | ||
| location | Yes | ||
| variable | Yes | ||
| aggregation | Yes |