API for Historic Temperatures?

I am looking at going through my energy consumption over the past year and comparing it to the outdoor temperature.

Does anyone know of an API (or data export) with historical (local) temperature data?
I used to keep my own records but don’t have anything since I moved house.

It looks like Weather Underground doesn’t make this available for free anymore.



Hello Nick,

Although not free, the cost seems to be reasonable. :wink:

OpenWeather offers a one-time download of historical data going back to 1 Jan 1979
for 10 USD (£7.8 as of 12 Jan 24, according to Google currency exchange)

From the page at the link shown below:

We provide hourly historical weather data for any location on the globe via History API.
Availability of hourly historical data depends on a type of your subscription.

More info at:


1 Like

Thank you Bill! UK pricing is listed as £7. Yes, not an insane sum of money for 40 years of data :slight_smile:

I have also found MeteoSource which is $5 per month, which includes 100 calls per day, with 20 years of historical data. So has the added hassle of spreading the requests out.

And I also need to look into if this data is available from ECMWF:


Did you manage to find a way to import the weather data?


Hi John,

Import into EmonCMS?
I was actually thinking about doing it all in a spreadsheet.
Importing it into EmonCMS shouldn’t be hard (but I am a Software Engineer).


If you are looking for data to compare energy use, you might find degree day data as useful. I dont think there’s an API, but you can get local data for free from:


That link took me to a login page.

I realised that while the “Standard” plan for MeteoSource is a whopping £60 per month for 20,000 calls per day, but it also has a 10 day free trial.

So I signed up for the free trial and downloaded 365 days of temperature data for where I live.
There is hourly data for each day, along with a daily summary:

  "daily": {
    "temperature": -0.4,
    "temperature_min": -2.2,
    "temperature_max": 2,
    "feels_like": -2.9,
    "feels_like_min": -4.4,
    "feels_like_max": -1.1,
    "wind_chill": -3.9,
    "wind_chill_min": -5.5,
    "wind_chill_max": -2.4,
    "soil_temperature": 2,
    "soil_temperature_min": 0.6,
    "soil_temperature_max": 3.5,
    "dew_point": -4.7,
    "dew_point_min": -7.8,
    "dew_point_max": -0.8,
    "surface_temperature": 0.9,
    "surface_temperature_min": -0.8,
    "surface_temperature_max": 3.8,
    "wind": {
      "speed": 3.2,
      "gusts": 8.7,
      "dir": "NW",
      "angle": 305
    "cloud_cover": {
      "total": 12,
      "low": 5,
      "middle": 12,
      "high": 20
    "pressure": 1011,
    "precipitation": {
      "total": 0,
      "type": "none"
    "humidity": 74

So I have what I need now :tada:
However not seeing much of a correlation between the outside temperatures and my gas bill :thinking:

1 Like

Interested in the script you used :slight_smile:

I wrote two ruby scripts:

  • fetch-weather-data.rb: this fetches 1 year of data from Meteosource and stores the responses as JSON files
  • extract-daily-temperature.rb: this parses the JSON files, extracts the daily temperature data and prints it as TSV, making it easy to copy/paste into a spreadsheet

Scripts are here:

1 Like

Not sure why that happened…
If you scrolldown this page you’ll find a link to free degree days…

1 Like