In the past I've used the Weather Underground API, which allows for 500 calls per day. See my answer here for some details - LINK.
In their TOS they say you can even use for commercial use (but read the small print!)
WUL licenses to you a limited, worldwide, non-exclusive, non-transferable, revocable license for your personal or commercial use.
My python 2.7 code snippet (shared here). Because there are only 500 calls allowed for free per day, I retrieved one year per day:
import requests
def get_precip(gooddate):
urlstart = 'http://api.wunderground.com/api/INSERT_KEY_HERE/history_'
urlend = '/q/Switzerland/Zurich.json'
url = urlstart + str(gooddate) + urlend
data = requests.get(url).json()
for summary in data['history']['dailysummary']:
print ','.join((gooddate,summary['date']['year'],summary['date']['mon'],summary['date']['mday'],summary['precipm'], summary['maxtempm'], summary['meantempm'],summary['mintempm']))
if __name__ == "__main__":
from datetime import date
from dateutil.rrule import rrule, DAILY
a = date(2013, 1, 1)
b = date(2013, 12, 31)
for dt in rrule(DAILY, dtstart=a, until=b):
get_precip(dt.strftime("%Y%m%d"))