4 Free Weather Providers API To Develop Weather Apps
Thinking of building an app that displays weather information? Here are some APIs that can help you.
Join the DZone community and get the full member experience.Join For Free
Android apps that give weather information are common in the Play store. Moreover, weather apps and widgets are amongst the most downloaded apps.
When it is time to develop a weather app, it is necessary to use a weather provider as the source of weather information. These weather providers expose a set of services or, in other words, an API, that supports RESTful web services.
Most of these services accept XML or JSON data. It is important to know the service features before selecting the right provider for our needs.
Generally speaking, the first point to consider is if the Android app will be free or not. Based on this, it is possible to select the right weather provider because some features may be not free. Moreover, there are weather providers that limit the number of calls to their services if you select a free plan. So consider the weather provider carefully as usually it is not so easy to change the client code once you have developed the app. The client will be tightly dependent on the weather API, so if you change the API you have to re-implement your client.
To make the process of selecting the right weather provider a little easier, I compiled a list of weather providers that I have used and tested.
This is the first provider I ever used and this is my preferred one. Openweathermap gives current weather information and forecasts. It is very simple to use. The Openweathermap weather API uses JSON to exchange data.
The weather API returns current weather, forecast, historical weather information and weather station data. Moreover, it also has UV index data.
How can we get weather information for a selected location? Openweathermap provides different two modes to look for a city. One uses name pattern and another using geo-coordinates.
I developed an Android weather app based on Openweathermap and you can look at my other posts to know more how to develop in Android this app.
All these APIs are free to use, you have to create a dev key so that you can make requests.
Yahoo! Weather is another great weather provider that is also very simple to use even if it gives less information than Openweathermap. Using Yahoo! Weather, the app can get current weather information and forecast. The API are based on JSON or on XML, so the developer can choose which one to use.
It is free service as long as you use your app for not commercial use. Read the Yahoo! Weather policy to know more. If you like to use this provider in your app, you can look at my post describing how to develop an Android app with Yahoo! weather.
Weather Underground API is a great weather provider that offers lots of API endpoints to get detailed information. The Weather Underground API provides current weather and forecast. Moreover, you can retrieve historical data, hurricanes, astronomy data (like moon data) and so on.
It provides also radar images that can be displayed directly on the smartphone
To find the city, it is possible to use name pattern, geo-location.
The service is free as long as you do not make to many requests, so, in other words, if you use it as a developer to test the API it is ok otherwise you have to pay.
Forecast.io is another interesting weather provider that offers current weather information, forecast and hour by hour weather details.
It worths taking a look at because it is very easy to use and provides a set of libraries for different languages.
Finally, some words about showing weather conditions on a map like Google Maps. Personally, I used Openweathermap and it is quite easy to add weather tiles. If you are interested I wrote a post about how to add weather information to Google Maps.
There are many other weather providers but most of them have paid services and I did not have the chance to test them.
Published at DZone with permission of Francesco Azzola, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.