Free Data as the Backbone, Paid Overlay Behind a Switch — and Why It Is Off

Open-Meteo covers the whole forecast for free. The paid OpenWeather overlay only touched a few instant values — today it is switched off and the app runs on.

Free Data as the Backbone, Paid Overlay Behind a Switch — and Why It Is Off

A Free Backbone: Open-Meteo

When developing weather applications, you will sooner or later hit the financial and performance limits of data sources. Providers of highly accurate meteorological data charge a premium for their APIs. As your user base grows, bills for thousands of requests can quickly destroy the project’s economics. A hybrid approach solves this. The right combination of Open-Meteo and OpenWeather balances the number of calls you pay for against accuracy where it matters most to the user.

In this design, Open-Meteo serves as the free backbone of the entire system. This API has good availability, does not require complex API key management in its basic tier, and offers solid global datasets based on open physical models such as GFS or ECMWF. The complete forecast skeleton is fetched from Open-Meteo, including the current conditions, a detailed hourly forecast, and a seven-day daily outlook. For the vast majority of the displayed information, this source is entirely sufficient and provides a stable foundation for the end user, covering the bulk of their needs.

Paid Overlay for Live Values Only — and Why It Is Off Today

Although global open models are highly accurate for trends and longer-term outlooks, they can lag slightly behind real-time conditions on the ground. This is where the paid OpenWeather API comes in. It has a dense network of local weather stations and radar, allowing it to provide highly accurate, real-time values for the current minute.

While the overlay ran, we did not fetch the complete weekly forecast from the paid API — OpenWeather served strictly as a thin overlay, and we queried it exclusively for the current conditions at a given location. It is switched off on every route today, so what follows describes how it was built, not what runs.

In practice, this means the system first builds the complete data structure from the free Open-Meteo API. It then takes a few selected real-time values from OpenWeather (such as the precise current temperature, feels-like temperature, and current weather condition code) and overwrites the corresponding fields in the original object. The rest of the forecast, including the data-heavy hourly and daily arrays, remains untouched. The result is an accurate current reading without pulling the entire weekly forecast from the paid API.

Best-Effort: Failures Are Silently Omitted

One of the fundamental rules of robust backend architecture is to assume that any external service can fail at any time. A paid API might hit its rate limits, the network might drop, or the provider might experience temporary latency spikes. However, the user should not notice such failures at all.

Therefore, all supplementary data layers — whether the paid OpenWeather overlay, the Air Quality Index (AQI), or official weather alerts — are designed on a best-effort basis. If a call to these supplementary services fails, the application must not return an error state or display a blank screen to the user.

The backend silently catches these errors, logs them for internal monitoring, and assembles the response without them. In this scenario, the client receives a complete forecast generated from the backbone Open-Meteo API. The user experience is preserved, and a failure in a supplementary source never reaches the user.

Paid Calls Only in the Refresh Path

To prevent unexpected costs, it is crucial to strictly separate the data read path from the update path. In more complex systems built on a stack like NestJS, MongoDB, and Redis, there is a risk that a careless developer might call an expensive external API directly from a controller handling standard user read requests. During a sudden traffic spike, such a design could instantly deplete your budget.

Only the refresh path — and a cold miss inside it — may therefore trigger a paid call. A normal read either hits the cache or waits on the single fill for that location; it never issues a paid request of its own.

Updates happen in a controlled way in the background, or via a specific refresh mechanism protected by strict rate limiting. This ensures that the expensive API is called only when absolutely necessary, with a maximum of one upstream API call per location within a defined time window. Consequently, the standard read controller can never accidentally generate unnecessary costs.

The Mapper as the Sole Point of Normalization

Different weather data providers use different response formats. While Open-Meteo returns data in flat arrays where indices represent time series, OpenWeather relies on deeply nested JSON objects. If these formats were mixed throughout the application, the codebase would quickly become unmaintainable.

The solution is strict data normalization at the system’s entry point. A dedicated mapping layer serves this purpose. This mapper is the only place in the entire application that knows the specifics of each external API. It receives raw data from both sources, validates and transforms it, and merges it into a single shared Data Transfer Object (DTO).

Here is a simplified version of that mapper in TypeScript:

interface WeatherDTO {
  temperature: number;
  windSpeed: number;
  weatherCode: number;
  hourlyForecast: { time: string; temp: number }[];
}

interface OpenMeteoRaw {
  current: { temperature_2m: number; wind_speed_10m: number; weather_code: number };
  hourly: { time: string[]; temperature_2m: number[] };
}

interface OpenWeatherRaw {
  main: { temp: number };
  wind: { speed: number };
  weather: { id: number }[];
}

export class WeatherMapper {
  public static mapToDto(
    openMeteoRaw: OpenMeteoRaw,
    openWeatherRaw?: OpenWeatherRaw,
  ): WeatherDTO {
    // Base skeleton from free Open-Meteo
    const dto: WeatherDTO = {
      temperature: openMeteoRaw.current.temperature_2m,
      windSpeed: openMeteoRaw.current.wind_speed_10m,
      weatherCode: openMeteoRaw.current.weather_code,
      hourlyForecast: openMeteoRaw.hourly.time.map((time: string, index: number) => ({
        time,
        temp: openMeteoRaw.hourly.temperature_2m[index]
      }))
    };

    // If a paid overlay is available, overwrite selected values
    if (openWeatherRaw && openWeatherRaw.main) {
      dto.temperature = openWeatherRaw.main.temp;
      dto.windSpeed = openWeatherRaw.wind.speed;
      dto.weatherCode = this.mapOpenWeatherCode(openWeatherRaw.weather[0].id);
    }

    return dto;
  }

  private static mapOpenWeatherCode(code: number): number {
    // Internal conversion logic of weather codes to a unified standard
    return code;
  }
}

The rest of the application, including the frontend and database models, works exclusively with this unified DTO. If you swap OpenWeather for another paid provider later, the change touches that provider’s client, the mapper, and the key configuration — the rest of the app, which only knows the DTO, stays untouched. The architecture stays easy to extend.

This approach to data integration and normalization runs in the platform detailed in the entire Weather InTouch project. Combining a reliable free foundation with a paid overlay confines paid calls to a single path and keeps the app working when the supplementary source fails. The overlay itself is switched off today: it overwrote values the free model already returns, at an order-of-magnitude higher cost per call, so it stays in the code behind its flag until it earns its keep.

Related articles

Contact Info

Feel free to reach out for project inquiries, consulting, or longer-term collaboration. I'm open to discussing practical product work and frontend engineering opportunities.

Get in Touch

© 2026 Martin Hubalek. All rights reserved.

Martin Hubálek Business ID (IČO): 08827303 Registered office: Dolní Štěpanice 29, 514 01 Benecko, Czech Republic Registered in the Czech Trade Licensing Register Not registered for VAT