Turn a forecast into a decision. Score every day of a trip, or find the safest hour for an outdoor event — over plain HTTP, JSON in and JSON out.
https://api.weatherapex.com/api/v1The WeatherApex API answers a question raw forecast data cannot: is this a good day for what I am planning? We take hourly and daily forecasts from national weather models, weight them against the activity you care about, and return a score you can act on.
Trip Planner
Score each day of a date range for one city, with per-day activity suggestions.
Event Risk
Risk score for an outdoor event, the calmest window of the day, and better nearby dates.
GET; parameters go in the query string.{ "success": true, "data": { ... } }.{ "error": "...", "detail": "..." }.YYYY-MM-DD. Times are local to the city, in 24-hour form.Version your calls. Always use the /v1 path shown above. Endpoints without it power this website, may change without notice, and are not covered by these docs.
curl "https://api.weatherapex.com/api/v1/trips/plan/?city=barcelona&start=2026-08-03&end=2026-08-06" \ -H "X-API-Key: wv_live_YOUR_KEY_HERE"
Keep the key on your server. Anyone who can read your front-end bundle can read a key you put in it.
Every v1 request needs an API key in the X-API-Key header. Keys look like wv_live_… and are shown once, at creation — we store only a hash, so we cannot recover a lost key. Generate a new one instead.
X-API-Key: wv_live_YOUR_KEY_HERE
Scoped to features
A key only reaches the features you selected. Calling an endpoint outside its scope returns 403.
Up to 5 active keys
Use separate keys per environment so you can revoke one without touching the rest.
Generate a key right here. Choose only the features you need — you can create another key later for anything else.
You need a free WeatherApex account to manage API keys.
Two limits apply to every key: a request rate, and a call quota. The free plan's quota is a lifetime total, not a daily one — 100 calls to build and test an integration.
| Plan | Quota | Rate | Suited to |
|---|---|---|---|
| Free | 100 total (lifetime) | 10 / minute | Testing and small projects |
| Starter | 5,000 / day | 30 / minute | Production side-projects |
| Pro | 50,000 / day | 100 / minute | Commercial applications |
| Business | 500,000 / day | 300 / minute | High-volume platforms |
Every authenticated response tells you where you stand:
X-RateLimit-Limit: 5000 # your plan's quota X-RateLimit-Remaining: 4873 # calls left X-RateLimit-Plan: starter # plan on this key
Exceeding either limit returns 429. Back off and retry rather than looping — repeated 429s do not reset the window.
https://api.weatherapex.com/api/v1/trips/plan/Scores every day between two dates for one city, so you can tell a traveller which days are worth going out and what to do on each. Beyond the forecast window the API falls back to a seasonal estimate built from 20 years of records — data_source tells you which you received.
| Parameter | Type | Required | Description |
|---|---|---|---|
city | string | Required | City name, e.g. "barcelona". Country and region names are rejected — see Errors. |
start | string (YYYY-MM-DD) | Required | First day of the trip. Must not be in the past. |
end | string (YYYY-MM-DD) | Required | Last day. Must be on or after start. Maximum 20 days total. |
curl "https://api.weatherapex.com/api/v1/trips/plan/?city=barcelona&start=2026-08-03&end=2026-08-06" \ -H "X-API-Key: wv_live_YOUR_KEY_HERE"
{
"success": true,
"data": {
"city": "Barcelona",
"country": "Spain",
"start_date": "2026-08-03",
"end_date": "2026-08-06",
"data_source": "forecast",
"overall_score": 7.8,
"best_day": "2026-08-05",
"worst_day": "2026-08-06",
"days": [
{
"date": "2026-08-03",
"score": 8.5,
"weather_code": 0,
"temp_max": 28.4,
"temp_min": 19.1,
"rain_probability": 5,
"wind_kmh": 12.0,
"recommended_activity": "beach_water",
"day_parts": {
"morning": { "temp": 21.3, "rain_probability": 2, "wind_kmh": 8.1 },
"afternoon": { "temp": 28.4, "rain_probability": 5, "wind_kmh": 12.0 },
"evening": { "temp": 24.0, "rain_probability": 3, "wind_kmh": 9.4 }
}
}
],
"packing_suggestions": [
{ "item": "SPF 50 Sunscreen", "reason": "Strong sun on 3 of 4 days" }
]
}
}| Field | Type | Meaning |
|---|---|---|
city, country | string | Resolved city and its country. |
overall_score | number 0-10 | Average day score across the trip. Higher is better. |
best_day, worst_day | string (date) | Highest and lowest scoring day. |
data_source | string | "forecast" for dates within the forecast window, otherwise "historical" (a seasonal estimate from 20 years of records). |
days[] | array | One object per day — see below. |
days[].score | number 0-10 | That day's score. |
days[].weather_code | integer | WMO weather code. 0 clear, 61 rain, 71 snow, 95 thunderstorm. |
days[].temp_max, temp_min | number (°C) | Daily high and low. |
days[].rain_probability | integer (%) | Maximum chance of rain that day. |
days[].wind_kmh | number | Maximum wind speed. |
days[].recommended_activity | string | e.g. beach_water, hiking_outdoor, indoor_museum. |
days[].day_parts | object | morning / afternoon / evening breakdown of temp, rain and wind. |
packing_suggestions[] | array | Items worth packing, with the reason they were suggested. |
https://api.weatherapex.com/api/v1/events/risk/Rates how risky the weather is for an outdoor event. A wedding and a marathon are not troubled by the same conditions, sotypechanges how rain, wind, heat and humidity are weighted.
| Parameter | Type | Required | Description |
|---|---|---|---|
city | string | Required | City name, e.g. "london". |
date | string (YYYY-MM-DD) | Required | Event date. Must be within the next 16 days. |
type | string | Optional | One of wedding, sports, concert, general. Each weights rain, wind, heat and humidity differently. Default: general. |
time | integer (0-23) | Optional | Hour of the event in local time. Omit it and the API returns the best time window of that day plus an hour-by-hour breakdown. |
Omit time for planning. Without it you also get best_window (the calmest stretch of that day) and hourly_breakdown from 06:00 to 22:00 — enough to render a timeline and let the user pick an hour.
curl "https://api.weatherapex.com/api/v1/events/risk/?city=london&date=2026-08-15&type=wedding&time=18" \ -H "X-API-Key: wv_live_YOUR_KEY_HERE"
{
"success": true,
"data": {
"city": "London",
"country": "United Kingdom",
"event_type": "wedding",
"event_date": "2026-08-15",
"event_time": "18:00",
"risk_score": 3.2,
"risk_level": "low",
"weather_code": 2,
"rain_probability": 15,
"wind_kmh": 12.0,
"temperature_c": 21.5,
"humidity_pct": 62,
"recommendation": "Conditions look good — an outdoor ceremony should be fine.",
"alternate_dates": [
{
"date": "2026-08-16",
"risk_score": 2.1,
"rain_probability": 8,
"wind_kmh": 9.0,
"temperature_c": 22.8,
"weather_code": 0
}
]
}
}| Field | Type | Meaning |
|---|---|---|
risk_score | number 0-10 | Weather risk. Lower is better. |
risk_level | string | low (0-3), moderate (3-6), high (6-10). |
weather_code | integer | WMO weather code for that hour. |
rain_probability | integer (%) | Chance of rain. |
wind_kmh, temperature_c, humidity_pct | number | Conditions at the requested hour. |
recommendation | string | Plain-language advice for the event. |
alternate_dates[] | array | Up to 5 nearby dates, sorted best first. |
best_window | object | Only when "time" is omitted — the calmest window of the day. |
hourly_breakdown[] | array | Only when "time" is omitted — 06:00 to 22:00, hour by hour. |
Errors carry a human-readable error and, where it helps, a detail you can show a user. Branch on the status code and oncode where present — never on message text, which may be reworded.
| Status | Meaning | What to do |
|---|---|---|
400 | Missing or invalid parameter | A required parameter is absent, the date format is wrong, or the range exceeds 20 days. |
400 | Place is a country or region | You sent something like "pakistan". Weather differs between cities, so send a city. The response includes a suggestions array of cities we have. |
401 | Missing or invalid API key | The X-API-Key header is absent, wrong, or the key was revoked. |
403 | Feature not enabled / account inactive | Your key does not include this feature. Generate a new key with it enabled. |
404 | City not found | We could not resolve that place name at all. |
429 | Rate limit or quota exceeded | See Rate limits. The body carries a code field: rate_limited or free_limit_reached. |
503 | Upstream data unavailable | The weather provider did not respond. Safe to retry with backoff. |
Weather is not uniform across a country, so a single score for one would be misleading. We refuse it and hand you cities to offer the user instead:
{
"error": "Please enter a city, not a country",
"detail": "Pakistan is a country, not a city — and weather is different in
every city within it, so a single score would be misleading.",
"kind": "country",
"place": "Pakistan",
"suggestions": [
{ "name": "Karachi", "slug": "karachi", "country": "Pakistan" },
{ "name": "Lahore", "slug": "lahore", "country": "Pakistan" },
{ "name": "Islamabad", "slug": "islamabad", "country": "Pakistan" }
]
}Cache on your side, and match the model clock
Forecasts are regenerated when a weather model finishes a run — roughly hourly for the USA, Canada, the UK and France, every 3 hours across the rest of Europe and Japan, and every 6 hours elsewhere. Calling more often than that returns the same numbers and spends your quota for nothing.
Keep keys server-side
Call the API from your backend and pass the result to your front end. A key shipped in browser JavaScript is a key anyone can copy. Use a separate key per environment so revoking one is cheap.
Handle 503 with backoff, not a retry loop
A 503 means the upstream weather service did not answer. Retry once after a few seconds, then give up and show the user the last value you had. Tight retry loops turn a brief outage into a quota problem.
Read weather_code, not just the numbers
Temperature alone does not tell a user what the day looks like. weather_code is the WMO code for the actual condition — map it to your own icons so rain shows rain and snow shows snow.
Send city names, resolve ambiguity yourself
We resolve names to real populated places and reject countries and regions. When you get a suggestions array, show it — it turns a dead end into one tap for your user.
Also available: an OpenAPI schema at https://api.weatherapex.com/api/schema/ and interactive docs at https://api.weatherapex.com/api/docs/.