The Setup That Confused Us First
Two API calls, same endpoint, same location, thirty seconds apart. Temperature comes back identical both times. So does humidity. But feelslike_c shifts by 1.2°C. No wind change either. Users notice — especially if you’re displaying feels-like prominently, or if your business logic gates a decision on crossing a threshold.
This isn’t a bug in the conventional sense. It’s a consequence of how feels-like is composed: not a single calculation but three different formulas with a regime-switching rule between them, and the input that tips the switch can change independently of the headline temperature field.
What feelslike_c Is Actually Made Of
Apparent temperature isn’t a measured quantity. It’s computed from temperature, humidity, and wind — but the formula changes depending on which thermal stress mode is active:
- Wind chill applies when temp is at or below roughly 10°C and wind exceeds a low threshold. This is the NWS/Environment Canada formula derived from the Siple–Passel regression, revised in 2001, using temperature in Celsius and wind speed at 10m.
- Heat index applies when temp is at or above roughly 27°C and relative humidity is high enough for moisture load to matter. The Rothfusz regression, published by NWS, dominates here.
- Steadman apparent temperature fills the middle range. It incorporates vapour pressure derived from dew point and wind, so it stays humidity-sensitive even in moderate conditions.
The regime boundaries aren’t sharp. Near the crossover points — 10°C with moderate humidity, or 26–28°C with borderline humidity — a small change in one input can flip which formula runs. That flip produces a discontinuous jump in output even when the temperature headline is completely stable. That’s the mechanism behind the 1.2°C shift with no visible inputs changing.
The Input That Moves Without You Noticing
Dew point is the quiet one. Humidity percentage and dew point are related but not interchangeable, and dew point can shift meaningfully between observation intervals when an air mass is in transition. The API response shows humidity as an integer — so a move from 71% to 74% looks like nothing. But the underlying dew point backing those calculations might have moved a full degree, which is enough to change the vapour pressure term in the Steadman formula and therefore feelslike_c, without any visible change in the fields you’re watching.
Wind is the other culprit. wind_kph in the current conditions response is instantaneous, not averaged. A station on a 5-minute gust cycle can return different wind readings on consecutive calls even under steady broader conditions. Wind chill is particularly sensitive at low speeds — the relationship isn’t linear, so the difference between 6 kph and 11 kph produces a larger feels-like swing than the difference between 25 kph and 30 kph.
When This Actually Breaks Things
Display jitter is annoying but survivable. The real problems are:
- Alert thresholds: If you fire a push notification when feels-like crosses 40°C, bouncing between 39.8 and 40.1 on consecutive polls triggers duplicate alerts unless you’ve built hysteresis into the check.
- Logging and analytics: Storing raw feels-like on every request and computing variance or trends over time produces noise that looks like data quality problems — because from your pipeline’s perspective, it is.
- Cross-location comparisons: If you’re stitching current conditions for one location against forecast hours for another and displaying both feels-like values side by side, one is derived from live station data and the other is a computed forecast approximation. They aren’t calculated the same way and shouldn’t be directly compared.
A Defensive Wrapper Worth Building
The fix isn’t to suppress the variation — it’s to decide deliberately how much variation to surface and when. Here’s the pattern we use:
Step 1: Recompute feelslike_c yourself from raw inputs
Don’t use the value directly from the response for anything decision-critical. Pull temp_c, wind_kph, and dewpoint_c (or humidity if dew point isn’t exposed), and run your own regime-switching calculation with boundary conditions you control. This eliminates the “which formula did the server pick?” uncertainty entirely.
Pseudo-logic for regime selection:
- If
temp_c <= 10andwind_kph >= 4.8: apply wind chill formula - If
temp_c >= 27andhumidity >= 40: apply heat index formula - Otherwise: apply Steadman apparent temperature using vapour pressure from dew point
Your boundary conditions are now explicit, testable, and version-controlled — not a function of whatever the API’s internal regime rules happen to be on a given day.
Step 2: Apply a dead-band before updating stored state
Only update your displayed or stored feels-like value if the new computed value differs from the last stored value by more than a threshold you’ve chosen deliberately. For most consumer display use cases, 0.5°C is a reasonable starting point. For alert logic, that threshold should be higher — 1–2°C — and paired with a require-N-consecutive-crossings rule before triggering anything.
Step 3: Track the regime separately
Store which formula is active alongside the feels-like value. If the regime flips between requests (wind chill to Steadman), that’s genuinely meaningful — the character of the thermal stress has changed, not just its magnitude. Surface that deliberately, or use the regime flip as a signal to suppress the specific numeric comparison rather than display a jump that will confuse users.
The Caching Angle
If you’re already caching current-conditions responses — and you should be if you’re serving many users querying the same location — make sure your cache TTL isn’t shorter than the observation update interval. METAR-sourced stations typically report on 20–60 minute cycles, though some report more frequently. Polling faster than the underlying data updates doesn’t get you fresher readings; it amplifies noise from the same underlying observation being re-fetched through slightly different processing paths. WeatherAPI’s current conditions are bounded by when the upstream station actually reports — there’s no interpolation between reports the way forecast fields work.
A 10-minute TTL for current conditions is usually fine. Sixty seconds usually isn’t buying you fresher data.
One Real Caveat
If you recompute feels-like client-side from rounded API fields, you’re introducing your own small error. humidity as an integer and temp_c rounded to one decimal aren’t the same precision as internal station readings. For most display applications this doesn’t matter. If a tenth of a degree in feels-like is genuinely load-bearing — physiological stress modelling, occupational health thresholds — use the raw dewpoint_c field rather than humidity as your moisture input, and query a forecast endpoint that exposes it rather than the rounded current-conditions summary.
The recompute-dead-band-track-regime pattern handles the common failure modes. It won’t eliminate all variance, because some of that variance is real. The goal is to stop surfacing noise as if it were signal, not to paper over genuine changes in thermal stress conditions.
If you’re hitting this right now: check whether the regime is flipping between requests first. Discrete 1–2°C steps are almost always a wind-chill/heat-index crossover — that’s where to look before anything else. Gradual drift within a stable regime is usually dew point or rounding, and a dead-band fixes it.
