Saturday, March 26, 2016

OpenWeatherMap to get the Weather info

this API is quite simple and easy to setup.

Just register on this website and get the API key. The usage is limited but enough to do some development tasks.

Once get the app Id, just insert into the API url like this below

http://api.openweathermap.org/data/2.5/weather?zip=560100,in&APPID={APP_ID}&units=metric

The result was something like this below

{"coord":{"lon":77.6,"lat":12.98},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"base":"stations","main":{"temp":25,"pressure":1018,"humidity":47,"temp_min":25,"temp_max":25},"visibility":6000,"wind":{"speed":4.53,"deg":131.003},"clouds":{"all":0},"dt":1459020600,"sys":{"type":1,"id":7823,"message":0.0122,"country":"IN","sunrise":1458953348,"sunset":1458997252},"id":1277333,"name":"Bangalore","cod":200}

references
http://code.tutsplus.com/tutorials/create-a-weather-app-on-android--cms-21587

No comments:

Post a Comment