WeatherApex

API Reference

v1

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.

Base URLhttps://api.weatherapex.com/api/v1

Overview

The 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.

Conventions

  • • All requests are GET; parameters go in the query string.
  • • Responses are JSON, UTF-8. Successful calls return { "success": true, "data": { ... } }.
  • • Errors return a non-2xx status and { "error": "...", "detail": "..." }.
  • • Dates are YYYY-MM-DD. Times are local to the city, in 24-hour form.
  • • Temperatures are Celsius, wind is km/h, rainfall is millimetres.

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.

Start here

Quickstart

  1. 1Create a free account and generate an API key below.
  2. 2Send the key in the X-API-Key header on every request.
  3. 3Call an endpoint and read response.data.
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.

Authentication

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.

Get access

Get an API key

Generate a key right here. Choose only the features you need — you can create another key later for anything else.

Sign in to generate an API key

You need a free WeatherApex account to manage API keys.

Rate limits & plans

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.

PlanQuotaRateSuited to
Free100 total (lifetime)10 / minuteTesting and small projects
Starter5,000 / day30 / minuteProduction side-projects
Pro50,000 / day100 / minuteCommercial applications
Business500,000 / day300 / minuteHigh-volume platforms

Response headers

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.

Endpoint

Trip Planner

GEThttps://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.

Query parameters

ParameterTypeRequiredDescription
citystringRequiredCity name, e.g. "barcelona". Country and region names are rejected — see Errors.
startstring (YYYY-MM-DD)RequiredFirst day of the trip. Must not be in the past.
endstring (YYYY-MM-DD)RequiredLast day. Must be on or after start. Maximum 20 days total.

Example request

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"

Example response

{
  "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" }
    ]
  }
}

Response fields

FieldTypeMeaning
city, countrystringResolved city and its country.
overall_scorenumber 0-10Average day score across the trip. Higher is better.
best_day, worst_daystring (date)Highest and lowest scoring day.
data_sourcestring"forecast" for dates within the forecast window, otherwise "historical" (a seasonal estimate from 20 years of records).
days[]arrayOne object per day — see below.
days[].scorenumber 0-10That day's score.
days[].weather_codeintegerWMO weather code. 0 clear, 61 rain, 71 snow, 95 thunderstorm.
days[].temp_max, temp_minnumber (°C)Daily high and low.
days[].rain_probabilityinteger (%)Maximum chance of rain that day.
days[].wind_kmhnumberMaximum wind speed.
days[].recommended_activitystringe.g. beach_water, hiking_outdoor, indoor_museum.
days[].day_partsobjectmorning / afternoon / evening breakdown of temp, rain and wind.
packing_suggestions[]arrayItems worth packing, with the reason they were suggested.
Endpoint

Event Risk Score

GEThttps://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.

low · 0–3moderate · 3–6high · 6–10

Query parameters

ParameterTypeRequiredDescription
citystringRequiredCity name, e.g. "london".
datestring (YYYY-MM-DD)RequiredEvent date. Must be within the next 16 days.
typestringOptionalOne of wedding, sports, concert, general. Each weights rain, wind, heat and humidity differently. Default: general.
timeinteger (0-23)OptionalHour 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.

Example request

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"

Example response

{
  "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
      }
    ]
  }
}

Response fields

FieldTypeMeaning
risk_scorenumber 0-10Weather risk. Lower is better.
risk_levelstringlow (0-3), moderate (3-6), high (6-10).
weather_codeintegerWMO weather code for that hour.
rain_probabilityinteger (%)Chance of rain.
wind_kmh, temperature_c, humidity_pctnumberConditions at the requested hour.
recommendationstringPlain-language advice for the event.
alternate_dates[]arrayUp to 5 nearby dates, sorted best first.
best_windowobjectOnly when "time" is omitted — the calmest window of the day.
hourly_breakdown[]arrayOnly when "time" is omitted — 06:00 to 22:00, hour by hour.

Errors

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.

StatusMeaningWhat to do
400Missing or invalid parameterA required parameter is absent, the date format is wrong, or the range exceeds 20 days.
400Place is a country or regionYou sent something like "pakistan". Weather differs between cities, so send a city. The response includes a suggestions array of cities we have.
401Missing or invalid API keyThe X-API-Key header is absent, wrong, or the key was revoked.
403Feature not enabled / account inactiveYour key does not include this feature. Generate a new key with it enabled.
404City not foundWe could not resolve that place name at all.
429Rate limit or quota exceededSee Rate limits. The body carries a code field: rate_limited or free_limit_reached.
503Upstream data unavailableThe weather provider did not respond. Safe to retry with backoff.

Country sent instead of a city

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" }
  ]
}

Best practices

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/.