Weather APIs for delivery planning: join the forecast to the delivery window
All Them APIs
Independent API research
The forecast for a depot at noon says little about a delivery across town at six. A weather API for delivery planning needs a location-and-time join before it needs an agent-written recommendation.
Start with a review queue for dispatchers: deliveries whose planned windows overlap a configured weather condition. This is not a route optimizer, an emergency warning system or a validated prediction of delays.
Join only the information needed for the decision
Represent each stop with an internal reference, coordinates and a planned UTC interval. Keep customer names, phone numbers and full addresses out of forecast requests and model prompts when coordinates are sufficient. If an address must be resolved, handle that in a separate address-validation workflow.
Define whether you are evaluating the stop, an approximate route segment or an operating area. A forecast grid cell does not measure actual conditions at every road surface along a route.
Choose forecast variables and access deliberately
Open-Meteo's forecast reference documents hourly coordinates-based requests, precipitation probability, precipitation amount and wind variables. Its commercial-access page distinguishes the public evaluation service from the customer endpoint and commercial licence. Confirm production terms rather than assuming a public test URL is the correct business deployment.
Use the weather provider comparison when choosing forecast interfaces and historical capabilities. An observed-weather archive and the forecast available at the time of a dispatch decision answer different backtesting questions.
Normalize the response before writing a rule
| Field | Meaning |
|---|---|
| Location reference | Which stop or operating area the forecast represents |
| Valid time | The future interval described by a forecast value |
| Retrieved time | When your application obtained this response |
| Model/run time, if supplied | The forecast version; never substitute retrieval time |
| Explicit units | Rain amount, wind speed and probability must remain distinct |
| Source and status | Provider, missing values and coverage gaps |
Set a maximum acceptable age for the retrieved response. Freshly reading an old forecast from your cache does not create a new forecast observation. Preserve the original retrieval time alongside cache information.
Flag a review; do not declare a route safe
This local example uses normalized millimeters per hour and kilometers per hour. Thresholds come from an operating policy reviewed by the team, not from this article.
function forecastReview(hour, policy) {
const values = [hour.rain_mm, hour.wind_kmh, policy.rain_mm, policy.wind_kmh];
if (!values.every(value => Number.isFinite(value) && value >= 0)) return "unknown";
return hour.rain_mm >= policy.rain_mm || hour.wind_kmh >= policy.wind_kmh
? "review"
: "within_configured_limits";
}
The final state does not mean that a road is safe or that a delivery will arrive on time. Probability, amount and observed conditions must not be substituted for one another. Escalate stale or incomplete data as unknown, not as good weather.
For a worked fixture, pass one hour below both configured thresholds, one equal to a threshold and one with a null wind value. The expected outcomes are within limits, review and unknown. These are tests of application logic, not measured forecast accuracy.
Batch repeat locations without losing provenance
Cache forecasts using provider, coordinates or approved spatial grouping, variables and forecast interval. Do not use only a postal code as the key when the service covers a larger or irregular area. Limit retries and record which stops lacked coverage.
Join approved delivery windows to the configured weather provider.
Preserve valid time, retrieval time, units and missing-data states.
Apply only the reviewed operating rules and return source-linked flags.
Do not change routes, promise an arrival time or send customer messages.
Require dispatcher review before operational changes.
Before use, test daylight-saving transitions, midnight windows, unit changes and a provider outage. For an evaluation of operational usefulness, define the review outcome and error costs with dispatchers; a lower API request price alone cannot establish that this workflow improves delivery performance.