- OpenWeatherMap/api
The OpenWeatherMap/api module acts as an abstraction layer for accessing the various OpenWeatherMap APIs.
- CityIDReqParams :
Object
an object of parameters used to identify a location using a citys ID
- CityNameReqParams :
Object
an object of parameters used to identify a location using a citys name
- LatLonReqParams :
Object
an object of parameters used to identify a location using a citys name
- ZipReqParams :
Object
an object of parameters used to identify a location using a citys name
- Coordinate :
Object
a coordinate object containing a longitute and latitude for positioning
- PartialDate :
Object
an object containign partial date time data
- PollutionParams :
Object
an object of parameters used in the pollution apis
The OpenWeatherMap/api module acts as an abstraction layer for accessing the various OpenWeatherMap APIs.
See: https://openweathermap.org/api
- OpenWeatherMap/api
- .OpenWeatherMap
- .AirPollution ⇐
OpenWeatherMap
- new AirPollution()
- ~carbonMonoxide(params) ⇒
Promise
- ~ozone(params) ⇒
Promise
- ~sulfurDioxide(params) ⇒
Promise
- ~nitrogenDioxide(params) ⇒
Promise
- .UVIndex ⇐
OpenWeatherMap
- new UVIndex()
- ~UVIndex(params) ⇒
Promise
- .Weather ⇐
OpenWeatherMap
- new Weather(options)
- ~now(params) ⇒
Promise
- ~forecast(params) ⇒
Promise
- ~dailyForecast(params) ⇒
Promise
Kind: static class of OpenWeatherMap/api
contains the core functionality between all of the APIs such as request functions and key storage. This class is intended to be extended or have mixins applied to add the functionality of the different APIs
Param | Type | Default | Description |
---|---|---|---|
options | Object |
||
options.apiKey | String |
the APPID supplied by openweathermap.org | |
[options.language] | String |
an optional 2 letter language code e.g. 'en' | |
[options.host] | String |
api.openweathermap.org |
an optional hostname for the api to connect to. |
[options.port] | String | Number |
80 |
an optional port to use for the api |
OpenWeatherMap/api.AirPollution ⇐ OpenWeatherMap
Kind: static class of OpenWeatherMap/api
Extends: OpenWeatherMap
See: https://openweathermap.org/
- .AirPollution ⇐
OpenWeatherMap
- new AirPollution()
- ~carbonMonoxide(params) ⇒
Promise
- ~ozone(params) ⇒
Promise
- ~sulfurDioxide(params) ⇒
Promise
- ~nitrogenDioxide(params) ⇒
Promise
A collection of air pollution APIs provided by openweathermap.org. Additional constructor options can be found in the [GET] OpenWeatherMap class
gets the carbon monoxide polution levels at a location and datetime [GET]
Kind: inner method of AirPollution
Returns: Promise
- the http request promise which will resolve with the carbon monoxide data
or reject with an error
Access: public
See: https://openweathermap.org/api/pollution/co
Param | Type |
---|---|
params | PollutionParams |
gets the current ozone thickness at a location and datetime [GET]
Kind: inner method of AirPollution
Returns: Promise
- the http request promise which will resolve with the carbon monoxide data
or reject with an error
Access: public
See: https://openweathermap.org/api/pollution/o3
Param | Type |
---|---|
params | PollutionParams |
gets the current sulfur dioxide polution at a location and datetime [GET]
Kind: inner method of AirPollution
Returns: Promise
- the http request promise which will resolve with the sulfur dioxide data
or reject with an error
Access: public
See: https://openweathermap.org/api/pollution/so2
Param | Type |
---|---|
params | PollutionParams |
gets the current nitrogen dioxide polution at a location and datetime [GET]
Kind: inner method of AirPollution
Returns: Promise
- the http request promise which will resolve with the nitrogen dioxide
data or reject with an error
Access: public
See: https://openweathermap.org/api/pollution/no2
Param | Type |
---|---|
params | PollutionParams |
OpenWeatherMap/api.UVIndex ⇐ OpenWeatherMap
Kind: static class of OpenWeatherMap/api
Extends: OpenWeatherMap
See: https://openweathermap.org/
- .UVIndex ⇐
OpenWeatherMap
- new UVIndex()
- ~UVIndex(params) ⇒
Promise
A collection of UV Index APIs provided by openweathermap.org. Additional constructor options can be found in the [GET] OpenWeatherMap class
gets the current UV Index at a location at the current time [GET]
Kind: inner method of UVIndex
Returns: Promise
- the http request promise which will resolve with the current weather or
reject with an error
Access: public
See: https://openweathermap.org/current
Param | Type |
---|---|
params | CityIDReqParams | CityNameReqParams | LatLonReqParams | ZipReqParams |
OpenWeatherMap/api.Weather ⇐ OpenWeatherMap
Kind: static class of OpenWeatherMap/api
Extends: OpenWeatherMap
See: https://openweathermap.org/
- .Weather ⇐
OpenWeatherMap
- new Weather(options)
- ~now(params) ⇒
Promise
- ~forecast(params) ⇒
Promise
- ~dailyForecast(params) ⇒
Promise
A collection of Weather APIs provided by openweathermap.org. Additional constructor options can be found in the OpenWeatherMap class
Param | Type | Description |
---|---|---|
options | Object |
|
[options.units] | String |
default uses kelvin, can also specify 'metric' for centegrade and 'imprerial' for Fahrenheit. |
gets the current weather at a location at the current time [GET]
Kind: inner method of Weather
Returns: Promise
- the http request promise which will resolve with the current weather
or reject with an error
Access: public
See: https://openweathermap.org/current
Param | Type |
---|---|
params | CityIDReqParams | CityNameReqParams | LatLonReqParams | ZipReqParams |
gets a forecast for the next 5 days in 3 hour intervals [GET]
Kind: inner method of Weather
Returns: Promise
- the http request promise which will resolve with the 5 day forecast
weather or reject with an error
Access: public
See: https://openweathermap.org/forecast5
Param | Type |
---|---|
params | CityIDReqParams | CityNameReqParams | LatLonReqParams | ZipReqParams |
gets a daily forecast for up to 16 days in the future (paid accounts only) [GET]
Kind: inner method of Weather
Returns: Promise
- the http request promise which will resolve with the 16 day forecast
weather or reject with an error
Access: public
See: https://openweathermap.org/forecast16
Param | Type |
---|---|
params | CityIDReqParams | CityNameReqParams | LatLonReqParams | ZipReqParams |
an object of parameters used to identify a location using a citys ID
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
id | String | Number |
the city ID to be used in the query |
days | String | Number |
optional number of days to return in the forecast (used in dailyForecast alias for cnt) |
hours | String | Number |
optional number of hours to return in the forecast (used in forecast alias for cnt) |
an object of parameters used to identify a location using a citys name
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
city | String |
the city name to use in the query e.g. 'london' (best used with country also set) |
country | String |
optional 2 letter country code to use in the query e.g. 'en' |
days | String | Number |
optional number of days to return in the forecast (used in dailyForecast alias for cnt) |
hours | String | Number |
optional number of hours to return in the forecast (used in forecast alias for cnt) |
an object of parameters used to identify a location using a citys name
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
coordinates | Coordinate |
a coordinate object used for searching based on latlon (use on its own) |
days | String | Number |
optional number of days to return in the forecast (used in dailyForecast alias for cnt) |
hours | String | Number |
optional number of hours to return in the forecast (used in forecast alias for cnt) |
an object of parameters used to identify a location using a citys name
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
zip | String | Number |
the zip code to use within the query (US by default unless country is specified) |
postcode | String | Number |
an alias to zip (use either zip or postcode) |
country | String |
optional 2 letter country code to use in the query e.g. 'en' |
days | String | Number |
optional number of days to return in the forecast (used in dailyForecast alias for cnt) |
hours | String | Number |
optional number of hours to return in the forecast (used in forecast alias for cnt) |
a coordinate object containing a longitute and latitude for positioning
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
latitude | String | Number |
the latitude of the position |
longitude | String | Number |
the longitude of the position |
an object containign partial date time data
Kind: global typedef
Properties
Name | Type |
---|---|
hour | String | Number |
month | String | Number |
day | String | Number |
hour | String | Number |
minute | String | Number |
second | String | Number |
an object of parameters used in the pollution apis
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
coordinates | Coordinate |
the position to check for poillutants |
datetime | Moment | Date | PartialDate | String |
accepts a Moment object, a native Date object, a custom PartialDate object which allows for date ranges to be defined (as per the documentation), or a manualy formatted ISO TZ time string (would recomend the other options though) |