sourcehut GitHub mirror Codeberg mirror 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 and Nominatim.

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


Example for current weather

import { getCurrentWeather } from "";

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

Example for forecasted weather

import { getForecastedWeather } from "";

const location = "Bergen";
const hoursAhead = 5;
const jsonOutput = true; // The returned response as JSON

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



deno install, \
  -n yr

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