Deno module for accessing Yr. Also has a CLI-tool
chore(release): Bump version
refactor: Use nominatim module



You can also use your local clone with git send-email.

Latest version JSR sourcehut GitHub mirror Codeberg mirror

builds.sr.ht status


Access Yr's weather API and Nominatim's names API for getting weather details about a specific location.

You can read more about the API's on met.yr.no and Nominatim.

This project has both a CLI and functions to access Yr.no's API.


#Example for current weather

import { getCurrent } from "jsr:@timharek/d-yr";

const currentWeather = getCurrent("Bergen");
// do what you need to do with the weather data.

#Example for forecasted weather

import { getForecast } from "jsr:@timharek/d-yr";

const location = "Bergen";
const hoursAhead = 5;

const currentWeather = getForecast(location, hoursAhead);
// do what you need to do with the weather data.



deno install --allow-net=api.met.no,nominatim.openstreetmap.org \
  -n yr jsr:@timharek/d-yr/cli

You have now installed d-yr as yr.


Run the CLI with:

# Current weather forecast for location
yr current Bergen
# OR forecast for location
yr forecast Bangkok 5