RECENT POST

TOP POST

How to Get Historical Weather Data: Sources, APIs and Datasets

by | Oct 28, 2026

Historical weather data comes from three places: free government archives such as NOAA’s Climate Data Online and GHCN-Daily, national weather services such as the UK Met Office, and weather APIs that return past weather by city, zip code or coordinates. Archives go back furthest and cost nothing; APIs are fastest when you need specific dates in code.

Key Takeaways

  • NOAA’s GHCN-Daily holds records from more than 100,000 stations in 180 countries and territories, with some series starting in the 1830s. It is free and public.
  • In the UK, the Met Office’s MIDAS Open dataset covers UK land stations from 1853 under the Open Government Licence.
  • Weather APIs answer the most common question, “what was the weather at this address on this date?”, in one request, without station matching or file parsing.
  • Weatherstack’s historical endpoint takes a city, zip code or postcode plus a date, returns daily and hourly data back to July 2008, and is included from the Standard plan.
  • Historical records have gaps, station moves and unit changes. Check the station and the method before you build anything that relies on the numbers.

Whether you are checking if it rained on the day of an insurance claim, training a demand-forecasting model, or settling an argument about last summer’s heatwave, historical weather data is easy to find and surprisingly hard to use well. This guide covers every practical source, free and paid, explains which one fits which job, and walks through a working lookup by zip code and date.

The three routes to historical weather data

Three routes to historical weather data: government archives, national weather services, and weather APIs

Three routes, three different trade-offs.

Government archives (NOAA NCEI)National services (Met Office and peers)Weather APIs
CoverageGlobal station network; strongest in the USOne country, in depthGlobal, by any location
GranularityDaily, hourly for some stationsHourly, daily and monthly by stationHourly and daily per location
FormatCSV, fixed-width text, web service (JSON)CSV and bulk downloadsJSON over HTTPS
CostFreeFree open datasets; some products licensedFree tiers to paid plans
EffortHigh: find stations, parse files, handle gapsMedium to highLow: one request per location and date
Best forResearch, climate analysis, long recordsCountry-specific analysisApps, address-level lookups, automation

Free government archives: NOAA and friends

The US National Oceanic and Atmospheric Administration runs the largest open archive of weather observations in the world through its National Centers for Environmental Information (NCEI).

GHCN-Daily

The Global Historical Climatology Network Daily dataset (NOAA NCEI) contains records from more than 100,000 stations in 180 countries and territories: daily maximum and minimum temperature, precipitation, snowfall and snow depth. The oldest series reach back to the 1830s, though most stations cover far less. NCEI updates it daily and rebuilds it weekly from more than 25 source components. You can download one file per station or the whole archive, and a copy is mirrored on the AWS Open Data Registry for cloud processing.

Climate Data Online (CDO)

Climate Data Online is NCEI’s search-and-order front end for GHCN-Daily and other datasets, including hourly surface observations and monthly summaries. You pick a location, date range and dataset; small requests download directly, larger ones are emailed. For code, the CDO Web Services v2 API returns JSON. It needs a free token, sent as a token header, and each token is limited to five requests per second and 10,000 requests a day.

What you can do with it

NOAA data is open. NCEI’s open data policy makes its holdings freely available, and NWS material is public domain unless marked otherwise (NWS disclaimer), so commercial use is allowed. The cost is effort: you match locations to the nearest suitable station, deal with missing days, and parse formats designed for scientists.

For gridded, spatially complete history, many developers use the ERA5 reanalysis produced by ECMWF, which blends observations and a weather model into hourly estimates for every point on Earth from 1940. Open-Meteo serves ERA5 through a free, keyless API for non-commercial use.

UK and international sources

For UK historical weather data, the Met Office is the primary source.

  • MIDAS Open (CEDA catalogue) holds hourly and daily observations from UK land stations from 1853 to the end of the last complete year: temperature, rainfall, sunshine, radiation, wind, cloud and snow. It is released under the Open Government Licence and downloaded through the CEDA archive, which needs a free account.
  • Historic station data (Met Office) gives monthly mean maximum and minimum temperature, air frost days, rainfall and sunshine for a selection of long-running UK stations. It is the quickest way to answer “how wet was Oxford in 1990?” without downloading a dataset.
  • HadUK-Grid provides gridded UK climate data at 1 km resolution, derived from station observations, for analysis across areas rather than points.

Most national weather services publish similar archives: Germany’s DWD through its open data server, Australia’s Bureau of Meteorology through Climate Data Online, Environment and Climate Change Canada through its historical data portal. Licences differ, so check each one before commercial use.

Chart comparing the earliest historical weather records available from NOAA GHCN-Daily, Met Office MIDAS Open, ERA5, OpenWeatherMap, and Weatherstack

How far back each source goes. Early decades cover far fewer stations.

Past weather by zip code or city

Most people searching for historical weather data want one thing: the weather at a specific place on a specific date. With archives, that means finding the nearest station that was operating on that date, downloading its file and extracting a row. With an API, it is one request.

Weatherstack’s historical endpoint takes a location and a date. The location can be a city name, a US zip code, a UK or Canadian postcode, or coordinates. This Python script runs on your machine or server and reads the key from an environment variable:

Python (past_weather.py), requires: pip install requests
"""Look up past weather for a city, US zip code or UK postcode on a given date.
 
Usage:
    export WEATHERSTACK_KEY=your_key_here
    python past_weather.py 10001 2025-09-15
"""
import os
import sys
 
import requests
 
API_KEY = os.environ["WEATHERSTACK_KEY"]  # never hardcode the key
API_URL = "https://api.weatherstack.com/historical"
 
 
def past_weather(location, date, units="m"):
    params = {
        "access_key": API_KEY,
        "query": location,          # "London", "10001", "SW1A 1AA", "40.7,-74.0"
        "historical_date": date,    # YYYY-MM-DD
        "hourly": 1,                # include hour-by-hour data
        "interval": 3,              # every 3 hours
        "units": units,             # m = °C, km/h, mm
    }
    resp = requests.get(API_URL, params=params, timeout=15)
    resp.raise_for_status()
    data = resp.json()
    if "error" in data:
        raise RuntimeError(f"{data['error'].get('code')}: {data['error'].get('info')}")
    return data
 
 
if __name__ == "__main__":
    location, date = sys.argv[1], sys.argv[2]
    data = past_weather(location, date)
    loc, day = data["location"], data["historical"][date]
 
    print(f"{loc['name']}, {loc['region']}, {loc['country']} on {date}")
    print(f"High {day['maxtemp']}°C  Low {day['mintemp']}°C  Avg {day['avgtemp']}°C  Sun {day['sunhour']} h")
    for hour in day["hourly"]:
        clock = f"{int(hour['time']) // 100:02d}:00"
        print(
            f"{clock}  {hour['temperature']:>3}°C  {hour['precip']:>4} mm  "
            f"wind {hour['wind_speed']:>2} km/h {hour['wind_dir']:<3}  {hour['weather_descriptions'][0]}"
        )

Run it with a zip code and a date:

$ python past_weather.py 10001 2025-09-15

New York, New York, United States of America on 2025-09-15

High 28°C   Low 21°C   Avg 24°C   Sun 10.4 h

00:00   22°C   0.0 mm   wind  9 km/h SW   Clear
03:00   21°C   0.0 mm   wind  8 km/h SW   Clear
06:00   21°C   0.0 mm   wind  8 km/h SSW  Partly cloudy
09:00   24°C   0.0 mm   wind 11 km/h S    Sunny
12:00   27°C   0.0 mm   wind 14 km/h S    Sunny
15:00   28°C   0.1 mm   wind 16 km/h SSE  Partly cloudy
18:00   26°C   1.4 mm   wind 18 km/h SE   Patchy rain nearby
21:00   23°C   0.3 mm   wind 12 km/h SE   Light rain

A lookup for zip code 10001 on 15 September 2025 (output from a test run with sample data).

The response groups data under historical, keyed by date, with a daily summary and an hourly array (shortened here to one hour):

JSON response (trimmed)
{
  "request": { "type": "Zipcode", "query": "10001", "language": "en", "unit": "m" },
  "location": {
    "name": "New York",
    "country": "United States of America",
    "region": "New York",
    "lat": "40.749",
    "lon": "-73.997",
    "timezone_id": "America/New_York"
  },
  "historical": {
    "2025-09-15": {
      "date": "2025-09-15",
      "date_epoch": 1757894400,
      "astro": { "sunrise": "06:39 AM", "sunset": "07:05 PM" },
      "mintemp": 21,
      "maxtemp": 28,
      "avgtemp": 24,
      "totalsnow": 0,
      "sunhour": 10.4,
      "uv_index": 6,
      "hourly": [
        {
          "time": "1800",
          "temperature": 26,
          "wind_speed": 18,
          "wind_dir": "SE",
          "weather_descriptions": ["Patchy rain nearby"],
          "precip": 1.4,
          "humidity": 60,
          "cloudcover": 20,
          "feelslike": 26
        }
      ]
    }
  }
}

Useful parameters:

ParameterWhat it doesExample
queryLocation: city, zip, postcode or lat,lon10001, London, 51.5,-0.12
historical_dateOne date, or several separated by semicolons2025-09-15
historical_date_start, historical_date_endA date range for a time series2025-09-01 to 2025-09-30
hourlyInclude hour-by-hour data (1) or daily only (0)1
intervalHours between hourly entries3
unitsm (°C, km/h, mm), f (°F, mph, in), s (K, km/h, mm)m

APIs vs raw datasets

Use raw datasets when you need the longest possible record, full control over station selection and quality flags, or bulk analysis over thousands of stations. Researchers and climate analysts usually belong here.

Use an API when you need answers per address, when the lookup runs inside an application, or when the people consuming the data are not going to parse station files. A claims system checking a date of loss, a dashboard joining sales to weather, or a scheduled job enriching new records all fit this pattern.

Weatherstack’s historical endpoint returns data back to July 2008 (apilayer) and is included from the Standard plan upward, which also allows commercial use (pricing). Other APIs with historical data include OpenWeatherMap’s One Call API, with history back to 1979, and Visual Crossing, whose free plan includes 50+ years.

Use cases with teeth

Insurance claim verification

A homeowner claims storm damage on 14 June. The adjuster’s system calls the historical endpoint for the property’s postcode and that date, and gets wind speeds and precipitation by hour. A claim for hail on a calm, dry day gets flagged for review; a claim on a day with 80 km/h gusts goes straight through.

Retail demand planning

A beverage distributor joins three years of daily sales by store with historical temperature for each store’s zip code. The pattern is clear: cold drinks spike once highs pass a certain temperature, and the effect differs by region. That relationship, fed with forecasts, drives next week’s orders.

Legal disputes

A slip-and-fall case turns on whether the car park was icy at 7 am. The parties request the hourly temperature and precipitation for the site. Lawyers typically want certified records from the national weather service for court; API data is the quick first check that tells them whether ordering certified records is worth it.

Machine learning training data

An energy company trains a load-forecasting model on five years of hourly demand. Adding hourly temperature, humidity and cloud cover for each substation’s location as features is a straightforward batch job against a historical API, run once and stored.

Historical data is also how you check forecasts. Store what was forecast, fetch what happened, and you have your own accuracy numbers, which is the subject of our post on how accurate weather forecasts are.

Data quality pitfalls

  • Station moves. A station that moved from a city rooftop to an airport field produces a step change in its record that has nothing to do with the climate. Check station metadata for relocations.
  • Gaps. Instruments fail and observers retire. GHCN-Daily marks missing values; your code must skip or fill them deliberately, not treat them as zero.
  • Unit and method changes. Older records may be in different units or use different observation times. The Met Office historic station data, for example, flags estimated values and changes of sunshine sensor.
  • Point vs area. A station measures one point. Rainfall in particular can differ sharply a few kilometres away. Gridded products and APIs interpolate, which smooths extremes.
  • Quality control lag. The most recent data is often provisional and revised after quality control. Use the final version for anything that matters.
  • Time zones. Archives often use UTC or local standard time. Align them before joining weather to business events.

If you are deciding between weather providers more broadly, our comparison of the Google Weather API and its alternatives covers what each one offers.

FAQs

Where can I get historical weather data for free?

NOAA’s Climate Data Online and GHCN-Daily datasets are free and cover stations worldwide. In the UK, the Met Office’s MIDAS Open dataset is free under the Open Government Licence. Open-Meteo offers free ERA5-based historical data for non-commercial use.

How do I find past weather by date and zip code?

Use a historical weather API that accepts a zip code and date, such as Weatherstack’s historical endpoint. One request returns the daily summary and hourly conditions for that location and date. With NOAA archives you would first find the nearest station.

How far back does historical weather data go?

It depends on the source. Some NOAA GHCN-Daily station records start in the 1830s, the Met Office’s MIDAS Open from 1853, ERA5 reanalysis from 1940, and Weatherstack’s API from July 2008. Early records cover far fewer locations.

Is NOAA data free for commercial use?

Yes. NOAA makes its data openly available and NWS information is in the public domain unless marked otherwise, so it can be used commercially. You should not imply NOAA endorses your product.

Look up any past date in one request. Get a free Weatherstack API key to start building, and move to the Standard plan when you need historical data.

Access Historical Weather Data

Look up weather data for past dates with Weatherstack. Get a free API key to start building, then explore the Standard plan when you need historical weather data for your application.