ClimateClimate & Weather

How to Access Historical Climate Data for Any Location

Access historical climate data from NASA POWER, ERA5, and NOAA via API. Temperature, precipitation, solar, and wind data for agriculture, construction, energy, and research.

Ryan Bethencourt
April 19, 2026
9 min read

Why Historical Climate Data Matters

Historical climate data underpins decisions in agriculture, construction, energy, insurance, urban planning, and scientific research. A solar energy developer needs decades of solar irradiance data to estimate panel output. A construction firm needs temperature and precipitation records to schedule pours and assess freeze-thaw risk. An agricultural researcher needs growing-degree-day calculations to model crop yields. In each case, the question is the same: what has the climate been like at this specific location, and what patterns should I plan around?

The challenge is not that this data does not exist — it does, in abundance. The challenge is accessing it. Climate data is scattered across dozens of agencies, stored in incompatible formats (NetCDF, GRIB, CSV, HDF5), served through different APIs with different authentication schemes, and documented with varying levels of clarity. A researcher who wants temperature and precipitation data for a single location might need to query three different services, download gigabytes of gridded files, and write custom parsing code.

Note
SciRouter's climate data endpoints aim to solve this fragmentation by providing a single API that queries multiple data sources and returns clean, standardized JSON. One API key, one request format, data from NASA POWER, ERA5, and NOAA in a unified response.

Major Data Sources

NASA POWER

NASA's Prediction of Worldwide Energy Resources (POWER) project provides solar and meteorological data for any location on Earth. Originally designed for renewable energy assessment, it has become one of the most accessible climate data sources for developers. POWER data comes from satellite observations and the MERRA-2 reanalysis, available from 1981 to near-present at 0.5-degree resolution (roughly 55 km).

Key variables include: temperature (min, max, mean, dew point), precipitation, solar irradiance (global horizontal, direct normal, diffuse), wind speed and direction, relative humidity, and surface pressure. The API requires no authentication and returns data in JSON format.

Fetch temperature data from NASA POWER
import requests

# NASA POWER API - no authentication required
url = "https://power.larc.nasa.gov/api/temporal/daily/point"
params = {
    "parameters": "T2M,T2M_MAX,T2M_MIN,PRECTOTCORR",
    "community": "RE",
    "longitude": -74.006,
    "latitude": 40.7128,
    "start": "20200101",
    "end": "20201231",
    "format": "JSON"
}

response = requests.get(url, params=params)
data = response.json()

# Extract daily temperatures
temps = data["properties"]["parameter"]["T2M"]
print(f"Days retrieved: {len(temps)}")
print(f"Mean temperature: {sum(temps.values()) / len(temps):.1f} C")

ERA5 (ECMWF Reanalysis)

ERA5 is the fifth-generation global atmospheric reanalysis from the European Centre for Medium-Range Weather Forecasts. It is the most comprehensive climate dataset available, covering 1940 to the present with hourly temporal resolution and 0.25-degree spatial resolution (roughly 31 km) across 37 pressure levels. ERA5 assimilates billions of observations from satellites, weather stations, radiosondes, aircraft, and ships into a physics-based model to produce a globally consistent atmospheric record.

Accessing ERA5 requires registration with the Copernicus Climate Data Store (CDS) and use of the CDS API. The data is stored in GRIB format and can be large — a single year of global hourly surface data is several terabytes. For most applications, you will want to request specific variables, regions, and time periods rather than downloading the full dataset.

Query ERA5 via the CDS API
import cdsapi

# Requires CDS API key in ~/.cdsapirc
client = cdsapi.Client()

client.retrieve(
    "reanalysis-era5-single-levels",
    {
        "product_type": "reanalysis",
        "variable": [
            "2m_temperature",
            "total_precipitation",
            "10m_u_component_of_wind",
            "10m_v_component_of_wind",
        ],
        "year": "2023",
        "month": ["06", "07", "08"],
        "day": [f"{d:02d}" for d in range(1, 32)],
        "time": ["00:00", "06:00", "12:00", "18:00"],
        "area": [41, -75, 40, -73],  # N, W, S, E bounding box
        "format": "netcdf",
    },
    "nyc_summer_2023.nc"
)

# Now parse with xarray
import xarray as xr
ds = xr.open_dataset("nyc_summer_2023.nc")
print(ds)

NOAA Global Historical Climatology Network (GHCN)

NOAA's GHCN-Daily dataset contains daily weather observations from over 100,000 land surface stations worldwide, with some records extending back to the 1700s. Unlike ERA5 (which is a gridded reanalysis), GHCN provides actual station observations — direct measurements from thermometers, rain gauges, and anemometers.

GHCN is particularly valuable for long-term climate trend analysis because it provides uninterrupted records from individual stations spanning decades or even centuries. The trade-off is spatial coverage: stations are concentrated in developed countries, with sparse coverage in oceans, polar regions, and parts of Africa and South America.

What Variables Are Available?

Across these three data sources, the key climate variables available include:

  • Temperature: Mean, minimum, maximum, and dew point at 2 meters above ground. Available daily, monthly, or hourly depending on source.
  • Precipitation: Total rainfall and snowfall accumulation. ERA5 provides hourly totals; GHCN and POWER provide daily totals.
  • Solar radiation: Global horizontal irradiance (GHI), direct normal irradiance (DNI), and diffuse horizontal irradiance (DHI). Critical for solar energy assessment.
  • Wind: Speed and direction at 10 meters (surface) and higher levels. ERA5 provides data at 37 pressure levels for wind energy applications.
  • Humidity: Relative humidity and specific humidity. Important for agriculture, comfort modeling, and HVAC design.
  • Pressure: Surface pressure and mean sea-level pressure. Useful for weather pattern analysis and altitude corrections.

The Unified API Approach

SciRouter's climate data endpoints consolidate access to these sources. Instead of learning three different APIs, handling three authentication methods, and parsing three data formats, you make one request:

Unified climate data query via SciRouter (coming soon)
import requests

API_KEY = "sk-sci-your-api-key"
BASE = "https://api.scirouter.ai/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Get historical climate data for any location
response = requests.post(f"{BASE}/climate/history",
    headers=HEADERS,
    json={
        "latitude": 40.7128,
        "longitude": -74.0060,
        "start_date": "2020-01-01",
        "end_date": "2023-12-31",
        "variables": ["temperature_mean", "temperature_max",
                      "precipitation", "solar_irradiance",
                      "wind_speed"],
        "frequency": "monthly",
        "source": "best"  # auto-select best available source
    })

data = response.json()
for month in data["monthly"][:6]:
    print(f"{month['date']}: {month['temperature_mean']:.1f}C, "
          f"Precip: {month['precipitation']:.0f}mm, "
          f"Solar: {month['solar_irradiance']:.0f} Wh/m2")

Real-World Use Cases

Agriculture: Growing Degree Days

Agricultural researchers and agtech companies use historical temperature data to calculate growing degree days (GDD), a measure of accumulated warmth that predicts crop development stages. By querying daily temperature data for a farm's coordinates, you can calculate when planting, flowering, and harvest stages will likely occur based on historical patterns.

Construction: Weather Risk Assessment

Construction firms analyze precipitation frequency and freeze-thaw cycles to plan schedules and assess risk. A concrete pour requires several consecutive dry days with temperatures above freezing. Historical data tells you the probability of finding such windows in each month, enabling better project planning and bid estimation.

Energy: Solar and Wind Resource Assessment

Solar and wind energy developers use multi-year irradiance and wind data to estimate expected energy production at proposed project sites. Bankable resource assessments typically require at least 10 years of data to capture interannual variability. The API approach makes it straightforward to pull this data for any location and feed it into production models.

Insurance: Climate Risk Scoring

Insurance companies and climate risk firms analyze trends in extreme weather events — heatwave frequency, flood recurrence intervals, drought severity — to price policies and assess portfolio exposure. Historical data at fine temporal resolution (daily or hourly) is essential for fitting extreme value distributions and detecting trend shifts.

Tip
When comparing data from different sources, be aware of systematic biases. ERA5 temperatures tend to be smoother than station observations because they represent grid-cell averages. NASA POWER precipitation can differ from ground observations, especially in mountainous terrain. For critical applications, validate against local station data when available.

Next Steps

To explore climate data and weather prediction further:

Ready to start working with climate data? Open the Weather Forecaster Studio or get a free API key to query historical climate data programmatically.

Frequently Asked Questions

What is the best free source of historical climate data?

For most use cases, NASA POWER is the best free starting point. It provides daily and monthly data from 1981 to near-present for any location on Earth, with no registration required. It covers temperature, precipitation, solar radiation, wind, humidity, and pressure. For higher temporal resolution (hourly) or longer historical coverage (back to 1940), ERA5 from ECMWF is the gold standard, though it requires registration with the Copernicus Climate Data Store. NOAA GHCN provides station-based observations going back over a century for locations with weather stations.

What is the difference between ERA5 and station observations?

Station observations are direct measurements from weather stations at specific locations. They are the ground truth but have gaps: stations are unevenly distributed (sparse in oceans, deserts, and developing regions), can have missing data, and only represent their immediate surroundings. ERA5 is a reanalysis dataset that combines all available observations with a physics-based model to produce a globally complete, gridded dataset at 0.25-degree resolution. ERA5 fills the gaps but introduces model-dependent biases. For locations near weather stations, observations are more accurate; for locations far from stations, ERA5 is more reliable.

How do I get climate data for a specific latitude and longitude?

Most climate data APIs accept latitude and longitude as query parameters. NASA POWER provides data at 0.5-degree resolution for any coordinate pair via its REST API. ERA5 provides data at 0.25-degree resolution through the CDS API. SciRouter's climate endpoints will unify access to multiple data sources through a single API call with latitude, longitude, date range, and desired variables. For all services, the API returns data for the grid cell containing your specified coordinates.

What temporal resolution is available for historical climate data?

It depends on the data source. ERA5 provides hourly data from 1940 to present. NASA POWER provides daily and monthly aggregations from 1981 to near-present. NOAA GHCN provides daily observations, with some stations having sub-daily data. For most applications like agriculture, energy modeling, and construction planning, daily data is sufficient. Hourly data from ERA5 is valuable for renewable energy assessments, HVAC modeling, and detailed hydrological studies.

Can I use climate data for commercial applications?

Yes. ERA5 data is freely available under the Copernicus licence, which permits commercial use with attribution. NASA POWER data is in the public domain. NOAA data is also freely available for commercial use. The main constraint is that you must attribute the data source appropriately. If you redistribute large volumes of raw data, check the specific licence terms. Using the data for analysis, modeling, and decision-making in commercial products is explicitly permitted by all three major sources.

Try this yourself

500 free credits. No credit card required.