Copyright 2022 - Custom text here

Weather APIs

Weather APIs

An overview and comparison

Aiming to develop an app displaying weather data or forecasts raises the question where to get the data from. There is a number of public API available of which some are even free of charge. This article focuses on web services that are free of charge at least for a limited amount of requests which are sufficient for development purposes. 

Compared were (so far) ...


Yahoo WeatherWetterdaten in Düsseldorf-Bild

acMetwit Weather 


My personal motivation for this inquiry was that I set up an iOS/Swift class for which the student's task of developing a weather app seemed perfect for the purpose of learning who to deal with he cocoa touch framework. Such an app includes some basic UI, user input (on a settings screen), user defaults, dealing with asynchronous http requests, working with a map and the location services. Another motivational factor was the Kleckrica 44 app, which is now available for Android and is free of charge. One of the features of this app is to add the current local weather to the image taken. Therefore I was in need for a free or very cheap web service providing current weather information.


Open Weather

The API provides its results in XMSL or JSON (or even HTML). Input may be the current geo coordinates or the name of a city or region. The data is updated between every 10 minutes or two hours for the free API. Data itself is made available under CC BY-SA 2.0 which allows for commercial use.

OpenWeatherMap offers its service with four different pricing models or SLAs respectively. The free version is limited to 1200 calls per minute and the data is updated every two hours. More recent data and higher calling volumes will be charge. But even then the monthly charges are way better predictable than the cost per 1000 requests type of model that Yahoo charges. 

They offer the recent weather,  forecasts for 5 days per 3 hours, 16 days per day plus historical weather data and data per weather station. Additionally the offer weather maps. In total, compared to the other offerings in this article, some quite complete offering. 

The weather data can be fetched by geo coordinates, name of city or its post code. Cities and regions can be identified by city-codes similar to other services described below. The data can be fetched for a list of cities within one request, but this type of request is not free of charge.  

The client may choose the output format between XML and JSON (default). The API is multi lingual. Literals such as the weather condition etc can then be directly taken from the web service without being localised within the client. However, custom localisation is still possible as the condition is provided as a condition code as well. Optional units are Fahrenheit, Celsius and Kelvin (default). 

Additionally the API is documented quite well on their web pages (in English). 

Ausserdem ist die API auf der Webseite ausgesprochen gut dokumentiert. (Englisch) 

Example: This is the request and the result for the weather data on Achill Island on the day I wrote this documentation.

         "description":"Sky is Clear",

Further Information

Weather Conditions and Icons: 

Pricing information: 


Yahoo Weather

For Yahoo Weather there are plenty of tutorials available. The API ist provided as RSS, XML or JSON as requested by the user. 

The issue with yahoo is that there is no way of getting from the geo coordinates directly to the weather data. First you will have to identify the regional code or city code WOEID and then you can fetch the weather for this WOEID. 

Yahoo used to provide a WOEID request for free. This service however has been discontinued and replaced by Yahoo Boss, which is not free anymore. However, non-commercial requests may use this service for up to 2000 requests per day, which is more than sufficient for the use with training classes but may quickly be insufficient for published apps.  

Just to avoid any misunderstandings: The Yahoo's weather API as such is still free of charge, but cannot really be used without WOEID. If your use-case allows for a limited amount of specific WOEID, such as for all locations of a company or for all major cities or for some limited region, then you could determine the related WOEIDS at once within the limits of free usage and re-used these WOEIDs within your app.
If you can use the place name (probably keyed in by the user) as input, then the service is free too. 


Detour using yahoo search

To avoid the cost BOSS API a mobile app may use the geo coding service that is included in the iOS or Android SDK to determine the place name(s) related to the user's current location. Those services are free anyway, as they are build-in in the mobile OS. (Limitations may apply to google/Android in the event that the app is commercial. Please refer to Google's documentation if in doubt) 

For getting the place name of the current location you may follow this example for iOS in Objective-C and Cocoa Touch: 

CLGeocoder *geocoder = [[CLGeocoder alloc] init]; 
[geocoder reverseGeocodeLocation:location
completionHandler:^(NSArray *placemarks, NSError *error) {
if (error){
NSLog(@"Geocode failed with error: %@", error);
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"cityname - %@",placemark.locality);

Once you got the place name (e.g. Dortmund) this request 

will result in something like this: 

"d":"pt:iso=DE&woeid=645458&lon=7.45829&lat=51.5166&s=North Rhine-Westphalia&c=Germany&country_woeid=23424829&n=Dortmund, North Rhine-Westphalia, Germany"

Now that you got the WOEID for Dortmund 645458 you can request the weather itself.

The URI will response with a result as follows.  

Therein 23424829 is the woied for Dortmund (see the response above) and c indicates that the result is to be delivered in Celsius. If the &u= parameter is omitted then the default will be Fahrenheit. 

"title":"Yahoo! Weather - Dortmund, DE",
"description":"Yahoo! Weather for Dortmund, DE",
"lastBuildDate":"Thu, 24 Sep 2015 6:49 pm CEST",
"sunrise":"7:18 am",
"sunset":"7:23 pm"
"title":"Yahoo! Weather",
"title":"Conditions for Dortmund, DE at 6:49 pm CEST",
"pubDate":"Thu, 24 Sep 2015 6:49 pm CEST",
"date":"Thu, 24 Sep 2015 6:49 pm CEST",
"text":"Mostly Cloudy"
"description":"\n<img src=\"\"/><br />\n<b>Current Conditions:</b><br />\nMostly Cloudy, 61 F<BR />\n<BR /><b>Forecast:</b><BR />\nThu - Cloudy. High: 62 Low: 51<br />\nFri - Partly Cloudy. High: 62 Low: 44<br />\nSat - Partly Cloudy. High: 61 Low: 43<br />\nSun - Sunny. High: 61 Low: 43<br />\nMon - Sunny. High: 62 Low: 43<br />\n<br />\n<a href=\"*\">Full Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"\" >The Weather Channel</a>)<br/>\n",
"date":"24 Sep 2015",
"date":"28 Sep 2015",
(This response contains usually five forecast elements in the related JSON-Array. Just not to blow up this article, I removed four of the forecast elements from the response.)

Further Information Links (Limits for Endpoints; Additional Limitations to the Table apply) (Docs incl. weather condition codes) 

Metwit Weather

When researching for alternatives to Yahoo, Metwit came to my attention. Apparently it does not seem to be available anymore. 

Metwit Links (apparently out of service or out of order)  

Wunderground (

This service is free only within limitations that may be sufficient for development phases or educational purposes. The limitations are useless for any kind of productive operations.

Further Information

UPDATE: 11th April 2016 - This service does not seem to be available. Neither the request works for my project's API key nor is the portal available. 

At the search for the weather is separated into two steps, similar to Yahoo. First we will have to request the city code of the location by location (city) name. Apparently there is no chance to search for city codes by geo coordinates. Although it may be error prone but in general you could determine the city code in a two step approach as described above with Yahoo. Like using Yahoo your work- and data flow will include a sequence of three asynchronous requests.

Using the API is free of charge. You are entitled to credit by two of the following three actions.  
1. Display "Powered by" within your app
2. Link to 
3. Show the Logo. 

Get your API Key

Once your registered yourself you create a project within their portal and find the API key for the project. 

Get the place name

If you don't get the place name from your app's context or user input, then you may follow the first instructions above (see Yahoo) to determine the place name next to geo coordinates. 

City-Code ermitteln

When the place name is available you can create the URL that leads to the place and city-code. The url schema (see docs) is made of place name, project name and an MD-5 hash code that is made of the api key and the search criteria (place name). This is an example for Mettmann.

The nature of this schema is that you can actually execute the request below (feel free) without me exposing my api key, neither in this article nor by sending the URI over the web. (Even for https, the URI itself is never encrypted.)

folgende Antwort

<?xml version="1.0" encoding="UTF-8"?>
<!--In order to use the free weather data from you HAVE TO display at least two out of three of the following possibilities: text, link, logo-->
<text>Powered by</text>
<logo>Download at</logo>
<item value="1">
<quarter />

If you receive more than one result, then you should compare the place names or post codes with the list of places that you got in response to the reverse geo-coding. And then use the one that refers to the place with the highest granularity. Eg. prefer the city over the country. 

Wetter abfragen

Now that we have the city code we can finally fetch the weather data. The following example request

will result in something like:

<?xml version="1.0" encoding="UTF-8"?>
        <!--In order to use the free weather data from you HAVE TO display at least two out of three of the following possibilities: text, link, logo-->
        <text>Powered by</text>
        <logo>Download at</logo>
        <date value="2015-10-06">
            <time value="06:00">
                <w_txt>leichter Regen</w_txt>
            <time value="11:00">
                <w_txt>leichter Regen</w_txt>
            <time value="17:00">
                <w_txt>leichter Regen</w_txt>
            <time value="23:00">
            <w_txt>leichter Regen</w_txt>

This XML contains a forecast for which each day is cut into four slices. Besides the weather code ("w") 61 it contains a literal ("w_txt") "leichter Regen" (light rain) the highest and lowest predicted temperature for the slice of the day ("tx", "tn") in °C, the wind direction ("wd") and the wind speed ("ws") in km/h as well as the local time as unix timestamp ("d") and others.  

Further Links 

Logos (including icons)

The service is free up to 250 requests per day. 

Weather data is limited to Germany. 

Response in XML only. 

There is a glitch in the portal. On the very day when you register, the limits associated with your API key are immediately used up. You may start issuing request on the very next day. 

Input key is the postcode (or PLZ respectively) of the place for which you request the weather data. Therefore you need to get the postcode from the user, the data context or determine it for your current location. Luckily the reverse geo-coding of the mobile OS Android and iOS is quite reliable when it comes to determining a postcode. 


The request (with MyKey being replaced by your API key) leads to a request like: 

<?xml version="1.0" encoding="UTF-8"?>
<!--- Hier wurden weitere Vorhersagetage ausgeblendet -->
<warnungvor />
<warnstufe />

(The real response contains nine forecasts. Eight of which have been omitted by the author just to protect the article from being blown up by wallpapers of XML.)

Further Links

Fonts and Icon-Collections

Now that you fetched the weather data and extracted it from the JSON or XML data stream, you will have to display it somehow to the user. For that purpose I found a number of resources for fonts and icons. 

Metwit (out of service) tbd
Lukas Bischoff Lukas Bischoff offers his Font on free of charge to non-commercial projects. (out of service) (docs in German)
Eric Flowers  222 Icons around weather as Font GitHub
Daniel Vierich Collection of 60 simple weather icons, which are made available like open source.
Mike Afford Fonts and icon collections that are not free but affordable.  Mike Afford Media
Meteocons Free collection of graphics in various formats.



f t g m