node-breezometer
node-breezometer is a module for making HTTP requests to the breezometer.com webservices API.
Installation
npm install node-breezometer --save
Quick Examples
const breezometer = ; const client = ; // get the current AQI by geocode // w/callbackclient; // w/async awaitdata = await client; // get the historical air quality for a dateTime // w/callbackclient; // w/async awaitdata = await client; // get the historical air quality for a timespan // w/callbackclient; // w/async awaitdata = await client; // get the historical air quality for the last 8 hours // w/callbackclient; // w/async awaitdata = await client; // get a forecast for the next 8 hours // w/callbackclient; // w/async awaitdata = await client; // get a forecast for a date range // w/callbackclient; // w/async awaitdata = await client; // get a forecast ending at a datetime // w/callbackclient; // w/async awaitdata = await client;
Air Quality Features
- Current Air Quality
- Historical Air Quality
- Forecasts
- Exponential backoff for retrying failed requests
getAirQuality
Get the current air quality for a location.
example
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 lang: 'en' features:'breezometer_aqi' 'local_aqi''pollutants_aqi_information'; // get the air quality by geocodeclient;
options
Parameter | Description | Type | Required |
---|---|---|---|
lat | WGS84 standard latitude | Number | Yes |
lon | WGS84 standard latitude | Number | Yes |
lang | language used for the request | String | No |
features | Filter the response fields | String[] | No |
metatdata | Include metadata in response | Boolean | No |
getHistoricalAirQuaility
Gets air quality data for a location at a single date and time or a date range.
example single date and time
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 dateTime: Date - 864000000; // get the historical air quality for a dateTimeclient;
example date range
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 lang: 'en' fields:'breezometer_aqi' 'country_aqi''pollutants' startDate: Date - 1728000000 endDate: Date - 864000000 interval: 1; // get the historical air quality for a date rangeclient;
options
Parameter | Description | Type | Required |
---|---|---|---|
lat | WGS84 standard latitude | Number | Yes |
lon | WGS84 standard latitude | Number | Yes |
lang | language used for the request | String | No |
features | Filter the response fields | String[] | No |
dateTime | ISO8601 date and time you want historical air quality for | Date | No |
startDate | ISO8601 start date for a range of historical air quality results | Date | No |
endDate | ISO8601 end date for a range of historical air quality results | Date | No |
hours | Number of historical hourly forecasts to receive | Number | No |
metadata | Include metadata in response | Boolean | No |
getForecast
Gets future forecast(s) for a location.
example hours
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 lang: 'en' features:'breezometer_aqi' 'local_aqi''pollutants_aqi_information' hours: 8; // get an hourly forecast for a location for the next 8 hoursclient;
example date range
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 startDate: endDate: Date + 864000000; // get an hourly forecast for the next 24 hoursclient;
options
Parameter | Description | Type | Required |
---|---|---|---|
lat | WGS84 standard latitude | Number | Yes |
lon | WGS84 standard latitude | Number | Yes |
lang | language used for the request | String | No |
features | Filter the response fields | String[] | No |
startDate | A specific start date range to get predictions for.,Can not be used with hours | Date | No |
endDate | IA specific end date range to get predictions for.,Can not be used with hours | Date | No |
hours | Number of hourly forecasts to receive from now | Number | No |
dateTime | ISO8601 date and time you want forecasted air quality until | Date | No |
metadata | Include metadata in response | Boolean | No |
Pollen Features
- Forecasts
getDailyPollenForecast
Gets future daily pollen forecast(s) for a location.
example
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 days: 3 features:'types_information' 'plants_information'; // get a daily forecast for a location for the next 3 daysclient;
Options
Parameter | Description | Type | Required |
---|---|---|---|
lat | WGS84 standard latitude | Number | Yes |
lon | WGS84 standard latitude | Number | Yes |
days | Number of days of forecast to receive | Number | Yes |
lang | Language used for the request | String | No |
features | Filter the response fields | String[] | No |
metadata | Include metadata in response | Boolean | No |
Fire Features
- Current Fire Conditions
getCurrentFireConditions (Beta)
Gets the current fire conditions for a location. Breezometer's Fire API is still in Beta.
example
const breezometer = ; const client = ; // build my optionsvar options = lat: 43067475 lon:-89392808 units: 'imperial' radius: 50; // get the current fire conditions by geocodeclient;
options
Parameter | Description | Type | Required |
---|---|---|---|
lat | WGS84 standard latitude | Number | Yes |
lon | WGS84 standard latitude | Number | Yes |
lang | language used for the request | String | No |
radius | radius around lat/lon to receive data | Number | No |
units | units of radius and response | String | No |
metatdata | Include metadata in response | Boolean | No |
Contributing
The more PRs the merrier. :-)
Breezometer Association
node-breezometer npm package is not supported by Breezometer.