Simple Open-Meteo interface using OpenStreetMap (Nominatim) for city lookup.
This library handles caching for you, such that you are compliant with the Nominatim terms of use.
npx openmeteoutil <city> --current # current weather (default)
npx openmeteoutil <city> --forecast # 7-day forecast
npx openmeteoutil --clear # clear all cached dataLocations fetched: ~/.cache/openmeteoutil/cities.json
Weather reports fetched: ~/.cache/openmeteoutil/current.json
Weather forecasts fetched: ~/.cache/openmeteoutil/forecast.json
Default refresh times: current: 10 minutes, forecast: 4 hours.
To run the demo from a clone: npm start -- <city>.
import { OpenmeteoClient, NominatimClient } from "openmeteoutil";
const nominatim = new NominatimClient("myapp.locationfetcher");
const openmeteo = new OpenmeteoClient("myapp.forecastfetcher");
const coords = await nominatim.getCoords({ city: "Oslo" });
const now = await openmeteo.getWeather(coords);
const week = await openmeteo.getForecast(coords);
await nominatim.clearCache(); // clear cached locations
await openmeteo.clearCurrentCache(); // clear cached weather reports
await openmeteo.clearForecastCache(); // clear cached forecastsClasses: NominatimClient, OpenmeteoClient
Types: Coords, Location, Weather, Forecast, ForecastDay
Unofficial community package. Not affiliated with or endorsed by Open-Meteo.
Weather data by Open-Meteo.com. If you display this data in an app or UI, keep this attribution visible. The free Open-Meteo API is for non-commercial use. See the Open-Meteo terms before commercial use.
City lookup uses Nominatim. Map data © OpenStreetMap contributors.
Note
AI:R - LLM's do not write code for this repo, however they are used as a part of the review process.
Copyright (C) 2026 Sofus Højberg Lind
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
SPDX-License-Identifier: LGPL-3.0-or-later