Giter VIP home page Giter VIP logo

airly's Introduction

Airly โ˜๏ธ

Simple wrapper for Airly API

Build Status XO code style Install size

Czytaj po polsku ๐Ÿ‡ต๐Ÿ‡ฑ

Highlights

  • Simple, asynchronous API
  • Works in Node.js & the browser
  • Uses the 2.0 version of Airly API
  • Full API coverage
  • Actively maintained
  • Lightweight
  • Written in TypeScript

Install

$ npm install airly

Usage

const Airly = require('airly');

const airly = new Airly('API_KEY');

(async () => {
	try {
		const data = await airly.installationInfo(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.installationMeasurements(id)

Returns detailed measurements (current, historical and future) for an installation

id

Type: number

Unique number of the installation

airly.installationInfo(id)

Returns information about specified installation

id

Type: number

Unique number of the installation

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

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

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.

maxResults

Type: number

Default: -1

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

airly.nearestMeasurements(lat, lng, maxDistanceKM)

Returns detailed measurements (current, historical and future) from the installation which is closest to a given point

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.pointMeasurements(lat, lng)

Returns detailed measurements (current, historical and future) for a map point, which can be interpolated from nearby installations

lat

Type: number

Latitude

lng

Type: number

Longitude

airly.metaIndexes()

Returns a list of IndexTypes supported by the platform

airly.metaMeasurements()

Returns a list of MeasurementTypes supported by the platform

License

MIT ยฉ Antoni Kepinski

airly's People

Contributors

xxczaki avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

airly's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.