List the current weather conditions for a particular city or set of coordinates.
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) {
},
});
Your private, openweathermap.org API key.
'xAmBxAmBxAmBkjbyKkjbyKkjbyK'
37.03252
-150.43283
'austin'
The state or country wherein the specified city is located (for the purposes of disambiguation.)
'texas'
An unexpected error occurred.
No such city could be found.
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'
}
]
}