Simple wrapper for Airly API
- 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
$ npm install airly
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);
}
})();
Check out the
examples
folder 🚀
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
Returns detailed measurements (current, historical and future) for an installation
id
Type: number
Unique number of the installation
Returns information about specified installation
id
Type: number
Unique number of the installation
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.
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.
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
Returns a list of IndexTypes supported by the platform
Returns a list of MeasurementTypes supported by the platform
MIT © Antoni Kepinski