New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

accuweather-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accuweather-api

### Introduction

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Accuweather API

Introduction

This package provides a TypeScript-based API for interacting with Accuweather, allowing developers to fetch various weather-related data.

Installation

To install the package, use the following command:

npm install accuweather-api

Usage

First, import the Accuweather class from the package:

import { Accuweather } from 'accuweather-api';

Then, initialize the class with your API keys:

const accuweather = new Accuweather('YOUR_API_KEY', 'YOUR_SECOND_API_KEY', 'YOUR_PREFERRED_LANGUAGE');

Available Methods

Here are the available methods for fetching weather data:

fetchAdminAreas

Fetch administrative areas based on a country code.

accuweather.fetchAdminAreas('US').then(data => console.log(data));
fetchDailyForecast

Fetch daily forecast data for a specific location.

accuweather.fetchDailyForecast('YOUR_LOCATION_KEY', 5).then(data => console.log(data));
fetchHourlyForecast

Fetch hourly forecast data for a specific location.

accuweather.fetchHourlyForecast('YOUR_LOCATION_KEY', 24).then(data => console.log(data));
fetchCurrentConditions

Fetch the current weather conditions for a specific location.

accuweather.fetchCurrentConditions('YOUR_LOCATION_KEY').then(data => console.log(data));
fetchHistoricalCurrentConditions

Fetch historical current conditions for a specific location.

accuweather.fetchHistoricalCurrentConditions('YOUR_LOCATION_KEY', 6).then(data => console.log(data));
fetchOneDayIndexForAllIndices

Fetch daily index data for all indices for a specific location.

accuweather.fetchOneDayIndexForAllIndices('YOUR_LOCATION_KEY').then(data => console.log(data));
fetchOneDayIndexForSpecificIndex

Fetch daily index data for a specific index.

accuweather.fetchOneDayIndexForSpecificIndex('YOUR_LOCATION_KEY', 'YOUR_INDEX_ID').then(data => console.log(data));
fetchOneDayIndexForSpecificGroup

Fetch daily index data for a specific group.

accuweather.fetchOneDayIndexForSpecificGroup('YOUR_LOCATION_KEY', 'YOUR_GROUP_ID').then(data => console.log(data));

Types

The package provides several TypeScript types for representing different weather-related data. Some of the main types include AdminAreaType, WeatherUnitType, SunMoon, Temperature, Wind, Precipitation, DailyForecast, and CurrentConditions.


Keywords

FAQs

Package last updated on 28 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc