0.1.0 • Published 10 months ago

kachelmann-api v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

kachelmann-api

Version Downloads/week License

An (unofficial!) wrapper around the kachelmannwetter.com API.

⚠️ Please be aware that you'll need an paid API Key in order to make any requests. Also, depending on your subscription, some endpoints might not work.

📚 Detailed information about the API can be found in the official Documentation.

Installation

npm install kachelmann-api

Usage

Import the module and initialize a new KachelmannAPI instance with your API-Key.

import KachelmannAPI from "kachelmann-api";

const API = new KachelmannAPI("YOUR_API_KEY");

Endpoints:

With your authenticated KachelmannAPI instance, you can make these requests.

As described above, some endpoints might not be implemented in this module yet, check their official Documentation for more information.

.getCurrentWeather()

Used to access the current weather for a given location. Expects argument of type ReqParameters.

const data = await API.getCurrentWeather({
  lat: "50.123",
  lon: "10.123",
  units: "metric",
});

Response: View in official Documentation

.get3DayForecast()

Used to access the current weather for a given location. Expects argument of type ReqParameters.

const data = await API.get3DayForecast({
  lat: "50.123",
  lon: "10.123",
  units: "metric",
});

Response: View in official Documentation

.get14DayTrend()

Used to access the current weather for a given location. Expects argument of type ReqParameters.

const data = await API.get14DayTrend({
  lat: "50.123",
  lon: "10.123",
  units: "metric",
});

Response: View in official Documentation

.getWeatherSymbol()

Used to access the current weather for a given location. Expects argument of type ReqParameters.

const data = await API.getWeatherSymbol("thunderstorm");

Response: View in official Documentation

Types:

ReqParameters

type ReqParameters = {
  lat: string; // latitude
  lon: string; // longitude
  units: string; // metric OR imperial
};

To-Do

  • Implement Standard Parameters and Advanced Parameters endpoints

Contribute

Feel free to open Pull Requests or Issues to fix bugs or propose new features.