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

airly

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airly

Simple wrapper for Airly API, works in Node.js & the browser.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
decreased by-17.02%
Maintainers
1
Weekly downloads
 
Created
Source

Airly :cloud:

Simple wrapper for Airly API

Build Status XO code style Install size

Czytaj po polsku :poland:

Highlights

  • Simple API
  • Works in Node.js & the browser
  • Uses the 2.0 version of Airly API
  • Actively maintained
  • Lightweight
  • Single source file (containing ~120 lines of code)
  • Written in TypeScript

Install

$ npm install airly

Usage

const Airly = require('airly');

const airly = new Airly('API_KEY');

(async () => {
	try {
		const data = await airly.idInfo(240);
		console.log(data);
	} catch (error) {
		console.log(error);
	}
})();

API

Check out the examples folder :rocket:

new Airly(key, language)

Constructor for other operations

key

Type: string

Your Airly API key. You can obtain one here.

language

Type: string

Default: en

Get air quality descriptions in specified language. Currently supported languages are English ('en' - default) and Polish ('pl').

For more information check out Airly's documentation

airly.idData(id)

Returns pollution data from the specified installation

id

Type: number

Unique number of the installation

airly.idInfo(id)

Returns information about the specified installation

id

Type: number

Unique number of the installation

airly.nearestInstallations(lat, lng, maxDistanceKM, maxResults)

Returns information about 3 nearest installations (including their ID's)

lat

Type: number

Latitude

lng

Type: number

maxDistanceKM

Type: number

Default: 3

All the returned installations must be located within this limit from the given point (in km); negative value means no limit.

maxResults

Type: number

Default: -1

Maximum number of installations to return; negative value means no limit.

airly.nearestIdMeasurements(lat, lng, maxDistanceKM)

Returns measurements for an installation closest to a given location.

lat

Type: number

Latitude

lng

Type: number

Longitude

maxDistanceKM

Type: number

Default: 3

All the returned installations must be located within this limit from the given point (in km); negative value means no limit.

airly.nearestAverageMeasurements(lat, lng)

Returns measurements for any geographical location. Measurement values are interpolated by averaging measurements from nearby sensors (up to 1,5km away from the given point)

lat

Type: number

Latitude

lng

Type: number

Longitude

License

MIT © Antoni Kepinski

Keywords

FAQs

Package last updated on 19 Oct 2019

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