Weather-Aware Operations
Turn a location into current conditions and a short forecast.
$0.003-$0.005
estimated cost / run
4
API steps
-
measured success rate
Preview
paid run not yet recorded
What this bundle does
Weather is one of the most common context calls an agent makes, but a place name is not a weather query. The agent first needs coordinates, then current conditions, then a forecast, and sometimes a distance estimate for the route.
This bundle combines APIStead Labs' geocoding, weather and distance routes. It keeps each step separate so the agent can skip the forecast when only current conditions matter, or stop when a location is ambiguous.
Workflow
- 1
Resolve a place name or address to coordinates.
Geocoding & Reverse Geocoding APIGET/geocode?address={address}$0.001 - 2
Fetch current conditions for the coordinates.
Global Weather APIGET/weather/current?lat={lat}&lon={lon}$0.001 - 3
Fetch a short daily forecast.
Global Weather APIGET/weather/forecast?lat={lat}&lon={lon}&days={days}$0.002 - 4
Add straight-line distance context for routing.
Coordinates & Distance APIGET/distance?from={lat},{lon}&to={lat},{lon}$0.001
Agent prompt
Paste this into an agent that can call HTTP tools and pay x402 challenges.
You are a weather-aware operations agent. When the user asks about conditions, a forecast or weather risk for a place:
1. Call the Geocoding API with the place name or address. If more than one result is returned, ask the user to choose or use the most specific match.
2. Call the Current Weather route with the returned latitude and longitude. Record temperature, conditions, wind and observation time.
3. If the user asks about the next few days, call the Forecast route with days=3. Keep the daily high, low and condition.
4. If the user asks about a route or two locations, call the Coordinates Distance route for the two coordinate pairs.
5. Return a concise brief with: location, current, forecast, distance_km (when relevant), source and retrieved_at.
6. Do not present a forecast as a guarantee. State the forecast horizon and the source.
7. If a route returns 402, read the quoted price before paying. Never pay more than the challenge amount.Example output
Illustrative output. Sample values come from the preview routes, not a live run.
{
"location": {
"query": "Berlin",
"latitude": 52.52,
"longitude": 13.405,
"country": "DE"
},
"current": {
"temperature_c": 9,
"condition": "cloudy",
"wind_kph": 14,
"observed_at": "2026-11-10T01:00:00Z"
},
"forecast": [
{
"date": "2026-11-10",
"high_c": 11,
"low_c": 6,
"condition": "cloudy"
},
{
"date": "2026-11-11",
"high_c": 10,
"low_c": 5,
"condition": "rain"
},
{
"date": "2026-11-12",
"high_c": 12,
"low_c": 7,
"condition": "clear"
}
],
"distance_km": null,
"source": "open-meteo",
"retrieved_at": "2026-11-10T01:15:00Z"
}Use cases
- Brief a field team before a site visit
- Add weather context to a delivery ETA
- Check conditions for an outdoor event
- Combine two locations with distance and forecast