OpenWeather.getCurrentConditions()

List the current weather conditions for a particular city or set of coordinates.

Usage

Hover over inputs/exits for more info.

var OpenWeather = require('machinepack-openweather');


// List the current weather conditions for a particular city or set of coordinates.

OpenWeather.getCurrentConditions({

apiKey: 'xAmBxAmBxAmBkjbyKkjbyKkjbyK',

latitude: 37.03252,

longitude: -150.43283,

city: 'austin',

stateOrCountry: 'texas',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// No such city could be found.

noCityFound: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

apiKey required

Your private, openweathermap.org API key.

'xAmBxAmBxAmBkjbyKkjbyKkjbyK'
latitude

37.03252
longitude

-150.43283
city

'austin'
stateOrCountry

The state or country wherein the specified city is located (for the purposes of disambiguation.)

'texas'

Exits

error

An unexpected error occurred.

noCityFound

No such city could be found.

success

OK.

{ id: 4671654,
  name: 'Austin',
  base: 'cmc stations',
  dt: 1424018333,
  coord: { lon: -97.74, lat: 30.27 },
  sys: 
   { message: 0.25,
     country: 'United States of America',
     sunrise: 1424005831,
     sunset: 1424045975 },
  main: 
   { temp: 292.36,
     temp_min: 292.36,
     temp_max: 292.36,
     pressure: 1007.21,
     sea_level: 1032.2,
     grnd_level: 1007.21,
     humidity: 64 },
  wind: { speed: 4.42, deg: 189.5 },
  clouds: { all: 76 },
  weather: 
   [ { id: 803,
       main: 'Clouds',
       description: 'broken clouds',
       icon: '04d' } ] }