# Historical Weather Scraper — Daily & Hourly Since 1940 (`hipersoft/historical-weather-scraper`) Actor

Download historical weather for any place or coordinates: daily or hourly temperature, precipitation, wind and more, back to 1940. One tidy row per day or hour, exported as JSON, CSV or Excel for research, energy, agriculture and analytics.

- **URL**: https://apify.com/hipersoft/historical-weather-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0001 / row scraped

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Historical Weather Scraper — Daily & Hourly Since 1940

Download **historical weather data** for anywhere on Earth with the **Historical Weather Scraper**. Enter place names or coordinates and a date range, and export **daily or hourly temperature, precipitation, wind and more — back to 1940** — as one tidy row per day or hour in **JSON, CSV or Excel**.

Built for **climate and academic research, energy and demand forecasting, agriculture and insurance, and data analytics**, it turns decades of reanalysis weather into a clean, tabular dataset you can drop straight into a spreadsheet, notebook or model.

### What it does

- 📅 **Deep history** — daily or hourly weather back to 1940 for any location.
- 🌡️ **Rich variables** — temperature (max/min/mean), precipitation, rain, snowfall, wind, gusts, radiation and evapotranspiration.
- 🧱 **Tidy rows** — one row per day (or per hour), with each variable as its own column.
- 📍 **Name or coordinates** — type "London" or pass exact coordinates; batch many at once.
- 🕒 **Local or UTC** — timestamps in each location's local time or UTC.
- 📤 **Export anywhere** — JSON, CSV or Excel, or straight into a notebook, sheet or model.

### Example output

```json
{
  "name": "London",
  "date": "2024-01-01",
  "temperature_2m_max": 11.4,
  "temperature_2m_min": 6.2,
  "temperature_2m_mean": 8.7,
  "precipitation_sum": 4.9,
  "windspeed_10m_max": 28.1,
  "timezone": "Europe/London"
}
```

### How to use it

1. Add **place names** and/or exact **coordinates**.
2. Set a **start date** and **end date** (YYYY-MM-DD) and choose **daily** or **hourly**.
3. Run, and download the results as **JSON, CSV or Excel**.

### Input fields

| Field | Description |
|-------|-------------|
| **Places (by name)** | Place names to resolve and look up (e.g. Singapore, London). |
| **Locations (by coordinates)** | Exact `{name, latitude, longitude}` objects. |
| **Start / End date** | Date range as YYYY-MM-DD (data from 1940 onward). |
| **Granularity** | Daily (one row per day) or Hourly (one row per hour). |
| **Daily variables** | Which daily metrics to include (temp, precipitation, wind…). |
| **Hourly variables** | Which hourly metrics to include when using hourly granularity. |
| **Timezone** | `auto` for local time, or an IANA name like `UTC`. |
| **Max rows** | Cap on total rows across all locations (0 = no limit). |

### Output fields

Location columns — `name`, `query`, `latitude`, `longitude`, `country`, `admin1`, `elevation`, `timezone`, `granularity` — plus `date` (daily) or `datetime` (hourly) and one column per requested variable (e.g. `temperature_2m_max`, `precipitation_sum`, `windspeed_10m_max`).

### Popular use cases

- **Climate & academic research** — build long time series for any site.
- **Energy & demand forecasting** — correlate load with historical temperature and wind.
- **Agriculture & insurance** — analyze rainfall, frost and heat over past seasons.
- **Analytics & modeling** — feed clean historical weather into notebooks and models.
- **Reporting** — compare this year to prior years for any location.

### FAQ

**Do I need an account or key?**
No. Enter your locations and dates and run.

**How far back does the data go?**
From 1940 up to a few days before today.

**Daily or hourly — which should I pick?**
Daily gives one compact row per day; hourly gives 24 rows per day with finer detail (larger output).

**Can I pull many locations at once?**
Yes — add multiple place names or coordinate objects; each returns its own rows.

**Can I export to Excel or Google Sheets?**
Yes — results download as JSON, CSV or Excel and drop straight into spreadsheets and notebooks.

***

Structured **historical weather data** — daily and hourly temperature, precipitation and wind since 1940 — clean and export-ready for research, energy, agriculture and analytics.

# Actor input Schema

## `places` (type: `array`):

Place names to look up, one per line (e.g. "Singapore", "London", "New York"). Each name is resolved to coordinates automatically. Use this OR the Locations field below (you can combine both).

## `locations` (type: `array`):

Exact coordinates as a list of objects: {"name": "Farm A", "latitude": 1.29, "longitude": 103.85}. The optional name is used as a label; latitude and longitude are required.

## `startDate` (type: `string`):

First day of history to fetch, as YYYY-MM-DD (e.g. 2024-01-01). Data is available from 1940 onward.

## `endDate` (type: `string`):

Last day of history to fetch, as YYYY-MM-DD. History runs up to a few days before today.

## `granularity` (type: `string`):

Daily gives one row per day (with your daily variables). Hourly gives one row per hour (with your hourly variables) — larger output.

## `daily` (type: `array`):

Daily variables (used when Granularity is Daily), one per line. Options include temperature_2m_max, temperature_2m_min, temperature_2m_mean, precipitation_sum, rain_sum, snowfall_sum, windspeed_10m_max, windgusts_10m_max, shortwave_radiation_sum, et0_fao_evapotranspiration. Leave as-is for a sensible default set.

## `hourly` (type: `array`):

Hourly variables (used when Granularity is Hourly), one per line (e.g. temperature_2m, relativehumidity_2m, precipitation, windspeed_10m, cloudcover, surface_pressure).

## `timezone` (type: `string`):

Timezone for the returned timestamps. Use "auto" to match each location's local time, or an IANA name like "Asia/Singapore" or "UTC".

## `maxItems` (type: `integer`):

Maximum rows to collect across all locations (0 = no limit).

## `proxyConfiguration` (type: `object`):

Optional proxy settings for the run. Not required — the data is fetched over plain HTTP.

## Actor input object example

```json
{
  "places": [
    "Singapore",
    "London"
  ],
  "locations": [],
  "startDate": "2024-01-01",
  "endDate": "2024-12-31",
  "granularity": "daily",
  "daily": [
    "temperature_2m_max",
    "temperature_2m_min",
    "temperature_2m_mean",
    "precipitation_sum",
    "windspeed_10m_max"
  ],
  "hourly": [
    "temperature_2m",
    "precipitation",
    "windspeed_10m"
  ],
  "timezone": "auto",
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

The results as dataset items.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "places": [
        "Singapore",
        "London"
    ],
    "locations": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/historical-weather-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "places": [
        "Singapore",
        "London",
    ],
    "locations": [],
}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/historical-weather-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "places": [
    "Singapore",
    "London"
  ],
  "locations": []
}' |
apify call hipersoft/historical-weather-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/historical-weather-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Z4wcqfZEWmleEZ7tL/builds/FytB6s7XqTfmoHZni/openapi.json
