Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clearweatherapi

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clearweatherapi

Clear Weather Api fetch calls and types for smooth and easy app builds

  • 0.1.0
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ClearWeather API

Clear Weather API transforms OpenWeather Map OneCall data into human-readable code so you can get to building apps faster.

I built this library to make it easier to use the ClearWeather API.

Learn more about the Clear Weather API.

Features

  • Data Transformation (Premium)
  • Caching (Premium)
  • Cool Weather Icons
  • Limit errors with types for all weather data
  • This package will make it smooth and easy to develop

You do need to be a premium user to access transformed data and caching. However if you would like to do the transformations yourself feel free to use this package and take advantage of the intelisense you will get for all the weather data. Just sign up at Clear Weather API to get your free userId to access the API

Getting Started

You need an OpenWeather Map API key to use this library, and you can get one by signing up at Open Weather Map.

You can get more information about the One Call API at Open Weather Map.

Installation

npm

npm install clearweatherapi

yarn

yarn add clearweatherapi

Usage


Instantiate Weather class and pass options to it.

    const options = {
       openWeatherApiKey: 'YOUR_OPENWEATHER_API_KEY',
       userId: 'YOUR-CLEATHERWEATHERAPI-USERID', // Sign up at www.clearweatherapi.com to get your free userId.
       cacheTime: 4800, // Time in seconds (Premium Feature) - Up to 12 hours at a time
       formated: false, // Formated (Premium Feauture) - default is false
       lang: 'en', // Many languages to choose from - This will translate the content in the description property.
       units: 'imperial', // Imperial, metric or standard - default is standard
       version: '3.0' // OpenWeather onecall api version 2.5 or 3.0 // default is 3.0
       coords: {
         latitude: "",
         longitude: "",
       },
    }


const weather = new Weather(options);
Current weather
const current = await weather.fetchCurrentWeather();
Daily weather
const daily = await weather.fetchDailyWeather();
Hourly weather
const hourly = await weather.fetchHourlyWeather();
Weather alerts
const alerts = await weather.fetchAlerts();
Icons

Icons are available for premium users and can be found in each weather data object.

If you are not a premium user you can get more information on how to fetch the icons here.

Keywords

FAQs

Package last updated on 03 Sep 2022

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