Why Forecast JSON Gets Bigger at Hour 72 — and How to Trim the Response Without Losing What You Need

Fetch a 10-day forecast from WeatherAPI and open the raw JSON. The first two days are dense — hourly blocks, condition objects, astro data, air quality arrays if you asked for them. By day 7 or 8, the structure is identical but the response is noticeably heavier than it should be. That’s not your imagination.

There’s no magic threshold at hour 72, but that’s roughly where forecast data crosses from model output with reasonable skill into territory where the GFS hourly blocks are still being returned at full resolution even though the underlying model skill has degraded to the point where hour-by-hour granularity is meaningless. You’re paying transmission cost and parse cost for precision that isn’t actually in the data.

What’s in the Payload That You Probably Don’t Need

A full 10-day forecast response with aqi=yes, alerts=yes, and hourly data includes roughly:

  • 240 hourly blocks (24 × 10 days)
  • Each block carries ~35–40 key-value pairs including redundant unit pairs (temp_c and temp_f, wind_kph and wind_mph, etc.)
  • 10 astro objects, one per day
  • Air quality sub-objects nested in every hourly block if requested

The dual-unit redundancy alone — Celsius and Fahrenheit, km/h and mph, mm and inches — roughly doubles the numeric payload for no reason if your app has already committed to a unit system. You’re not getting more data; you’re getting the same data written twice.

The air quality arrays are the bigger culprit. Each hourly air_quality object carries six pollutant readings (co, no2, o3, so2, pm2_5, pm10) plus two AQI index values. If your app shows air quality as a single badge, you’re parsing six fields to discard five. Across 10 days of hourly data, that’s 240 sets of fields you’re pulling, deserializing, and throwing away on every request.

The Request-Side Fixes First

Before you touch response parsing, cut at the request level.

Use days honestly. If your UI shows a 5-day outlook and a 24-hour detail view, don’t request 10 days by default because “it doesn’t cost more API calls.” It costs bandwidth, parse time, and memory. Request what you’ll actually display, and fetch the rest lazily when the user navigates forward.

Drop aqi=yes unless you’re rendering it. This is the single biggest payload reduction available. aqi=no is the default for a reason — the AQI arrays are expensive to include and most apps that request them use maybe one field.

Use alerts=no outside of alert-specific features. Alerts are variable-length text blobs. For a background refresh that’s just updating an hourly temperature chart, you don’t need them — and they can run surprisingly large in regions with active NWS alert feeds.

These three toggles together can cut a 10-day response substantially before you write a single line of parsing code. Most of that gain comes from dropping AQI.

The Response-Side Problem: Dual Units

WeatherAPI returns both metric and imperial for almost every numeric field. That’s genuinely useful for apps that let the user switch units without re-fetching. But if your app commits to one system at startup and never switches, you’re deserializing dead weight on every response.

The fix depends on your stack. If you’re parsing into typed objects in C# or TypeScript, just don’t map the fields you won’t use — your deserializer will skip them without allocating. If you’re passing raw JSON through to a frontend, do a lightweight field-strip server-side before forwarding:

// Node.js — strip imperial fields before forwarding
function stripImperial(hourBlock) {
  const { temp_f, wind_mph, precip_in, vis_miles, feelslike_f, windchill_f, heatindex_f, dewpoint_f, ...rest } = hourBlock;
  return rest;
}

That’s not clever engineering — it’s just not shipping bytes you don’t need. It matters more in mobile contexts where the connection is poor and parsing happens on a constrained device.

Trimming Past Day 3: Matching Fetch Resolution to Actual Forecast Skill

This part is worth thinking about carefully. GFS — which backs a lot of medium-range forecast output — produces hourly data out to 120 hours, then shifts to 3-hourly beyond that. ECMWF’s IFS has better skill at extended range. But regardless of which model is backing the day-7 forecast you’re serving, hourly granularity past roughly 72 hours is not meaningfully more accurate than 3-hourly or 6-hourly. The model itself stops committing to that resolution; the API just doesn’t tell you that.

Practically: if your app shows a 10-day outlook, the right display resolution for days 4–10 is a daily summary with maybe a morning/afternoon/evening split — not 24 individual hourly bars. Fetching 240 hourly blocks to render 10 daily tiles means you’re over-fetching and then aggregating client-side anyway.

A two-request strategy handles this cleanly:

  1. Fetch days=3 with hourly data for the detail view — high-skill, high-resolution data worth displaying at hourly fidelity.
  2. Fetch days=10 for the outlook strip, reading only day.maxtemp_c, day.mintemp_c, day.daily_chance_of_rain, and day.condition from the daily summary fields.

You can’t ask WeatherAPI to suppress hourly blocks via a parameter — they come along for the ride. So the second request still returns hourly data you have to ignore. The mitigation is to skip AQI and alerts on that second call and strip fields server-side before the payload reaches your client. The two-call approach still wins on total bytes transferred versus one fat 10-day-with-everything request, mostly because you’re keeping AQI and alerts confined to the short-range call.

Caching Shape Matters as Much as TTL

Caching the whole forecast blob for 15 or 30 minutes is a reasonable TTL. What’s less common — and more useful — is caching two separate shapes for the same location: a trimmed short-range object and a trimmed long-range daily object, each with its own TTL keyed to how often that data actually changes.

Short-range hourly data from a high-update-cycle model gets meaningfully stale faster than a day-7 outlook from GFS, which updates every 6 hours and is skill-limited anyway. Treating them with the same TTL means you’re either refreshing the long-range more often than necessary or serving the short-range stale when conditions are actively changing. Split the cache keys, split the TTLs. It’s a small structural change that stops unnecessary API calls without letting a several-hour-old hourly block sit in cache during a fast-moving weather event.

One Caveat Worth Naming

The field-stripping approach works cleanly until you need a field you stripped. If you’re doing server-side stripping in a proxy layer, manage the strip list somewhere explicit — not buried in a transformation function someone will forget exists. The failure mode is silently stripping a field like snow_cm during a normalization refactor, then spending hours debugging why winter precipitation logic isn’t firing weeks later. Keep the strip list commented, versioned, and visible.

If payload size genuinely matters for your use case — mobile-first apps, high-volume multi-location polling, anything billing on egress — spend 20 minutes profiling a real 10-day response with and without AQI before building anything elaborate. The difference is usually larger than people expect, and knowing the actual number tells you whether a stripping strategy is worth the maintenance overhead or whether a tighter days parameter already gets you most of the way there.

Scroll to Top