Updated in version 1.1.0:
Fixed bugs of getHourlyForecast function
Wrapper of Accu Weather API
- Location API
- Forecast API
- Current Conditions API
- Indices API
- Weather Alarms API
- Alerts API
- Imagery API
- Tropical API
- Translations API
npm install accu-weather-api-wrapper
import AccuWeatherClient from "accu-weather-wrapper";
const client = new AccuWeatherClient({
apikey: "key", //Required. Accu Weather API key.
language: "en-us", //Optional. Language of retrieve data. Default: "en-us"
detail: true, //Optional. Whether return full object when searching. Default: false
offset: 100, //Optional. The limit that determines the first resource to be returned. Default: 100
metric: true; //Optional. Whether or not to return metric values. Default: false
})
//Get city data
client.location.citySearch("Taipei").then(console.log)
//Get 1 day forecast data ("4-315078_1_AL" is location key)
client.forecast.getDailyForecast(1,"4-315078_1_AL").then(console.log)
//Get current conditions data
client.currentConditions.currentCondition("4-315078_1_AL").then(console.log)
const AccuWeatherClient = require("accu-weather-wrapper").default;
const client = new AccuWeatherClient({
apikey: "key", //Required. Accu Weather API key.
language: "en-us", //Optional. Language of retrieve data. Default: "en-us"
detail: true, //Optional. Whether return full object when searching. Default: false
offset: 100, //Optional. The limit that determines the first resource to be returned. Default: 100
metric: true; //Optional. Whether or not to return metric values. Default: false
})
//Get city data
client.location.citySearch("Taipei").then(console.log)
//Get 1 day forecast data ("4-315078_1_AL" is location key)
client.forecast.getDailyForecast(1,"4-315078_1_AL").then(console.log)
//Get current conditions data
client.currentConditions.currentCondition("4-315078_1_AL").then(console.log)
import { LocationAPI } from "accu-weather-wrapper";
const client = new LocationAPI({
apikey: "key", //Required. Accu Weather API key.
language: "en-us", //Optional. Language of retrieve data. Default: "en-us"
detail: true, //Optional. Whether return full object when searching. Default: false
offset: 100, //Optional. The limit that determines the first resource to be returned. Default: 100
});
//Get city data
client.citySearch("Taipei").then(console.log);
const { LocationAPI } = require("accu-weather-wrapper");
const client = new LocationAPI({
apikey: "key", //Required. Accu Weather API key.
language: "en-us", //Optional. Language of retrieve data. Default: "en-us"
detail: true, //Optional. Whether return full object when searching. Default: false
offset: 100, //Optional. The limit that determines the first resource to be returned. Default: 100
});
//Get city data
client.citySearch("Taipei").then(console.log);
https://accuweatherapiwrapperdocs.pages.dev
Accu Weather Company: https://developer.accuweather.com/apis
If you have any question to ask or bugs to report, you can open issue on github: https://github.com/Kayxue/AccuWeatherAPIWrapper
Or join my discord server to get help: (Not finished yet)