Skip to content
Simple wrapper for Airly API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.gitignore
.npmrc
.travis.yml
LICENSE
README.md
README_PL.md
index.js
package.json
test.js

README.md

Airly ☁️

Simple wrapper for Airly API

Build Status XO code style Install size

Czytaj po polsku 🇵🇱

Highlights

  • Simple API
  • Uses async/await
  • Uses the 2.0 version of Airly API
  • Actively maintained
  • Lightweight
  • Less than 100 lines of code

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 🚀

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)

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

lat

Type: number

Latitude

lng

Type: number

Longitude

License

MIT © Antoni Kepinski

You can’t perform that action at this time.