# Historical Weather Data API (`sfoln/historical-weather`)

Get daily historical weather for any place or coordinates and date range since 1940: max, min and mean temperature, precipitation, rain, snowfall, wind and sunshine, one row per day (Open-Meteo). $0.20 per 1,000 days + $0.002 per location.

- Family: Data utilities
- Categories: Developer tools, Automation, Travel
- Availability: on request (private on Apify). Email contact@sfoln.com with subject "Access request: Historical Weather Data API (sfoln/historical-weather)" before calling; calls fail until it is public.
- JSON: https://www.sfoln.com/actors/historical-weather.json
- MCP: https://mcp.apify.com?tools=sfoln/historical-weather
- REST (sync): POST https://api.apify.com/v2/actors/sfoln~historical-weather/run-sync-get-dataset-items
- REST (async): POST https://api.apify.com/v2/actors/sfoln~historical-weather/runs

Historical Weather Data API gets daily historical weather – max/min/mean temperature, precipitation, rain, snowfall, max wind speed and sunshine duration – for any list of places or coordinates and any date range back to 1940. Each location-day is one clean dataset row, ready for spreadsheets, BI tools, insurance and claims checks, energy and retail demand models, agronomy and machine-learning features.

## Price per delivered record

| Event | Price | Per 1,000 | Charged for |
| --- | --- | --- | --- |
| Historical weather day (`historical-weather-day`) | $0.0002 | $0.20 / 1,000 | Charged once per location-day row delivered (days without data in the archive are not returned or charged). |
| Historical weather location (`historical-weather-query`) | $0.002 | $2 / 1,000 | Charged once per location for which at least one day of history was delivered. |

Pay-per-event, USD, billed by Apify; no platform usage charge. Only records with status `ok` are charged. Cap a run with `maxTotalChargeUsd`. Apify free plan: up to 10 per run.

## Run

```bash
curl -X POST "https://api.apify.com/v2/actors/sfoln~historical-weather/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"locations":["London"],"startDate":"2025-01-01","endDate":"2025-01-07"}'
```

MCP client configuration:

```json
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=sfoln/historical-weather"
    }
  }
}
```

Example prompt: Get the daily weather in London from 1 to 7 January 2025: maximum and minimum temperature, rain and sunshine hours.

## Input

List places or coordinates and a date range. Each location produces one dataset row per day plus one per-location summary row.

| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `locations` (required) | array | — | Locations: One per line: a place name ("London", "Paris, France") or "latitude,longitude" ("35.6762,139.6503"). Via the API you can also pass objects like {"latitude": 52.52, "longitude": 13.41, "name": "Site A"} or {"place": "Springfield", "countryCode": "US"}. Accounts on the Apify free plan can process up to 10 locations per run and 31 days per location. |
| `startDate` (required) | string | — | Start date: First day (YYYY-MM-DD), 1940-01-01 or later. |
| `endDate` | string | — | End date: Last day (YYYY-MM-DD), inclusive. At most 366 days after the start date and not in the future. Defaults to the start date. The newest ~5 days are usually not in the archive yet. |
| `variables` | array | `[]` | Daily variables: Which daily values to return. Leave empty for all. |
| `units` | string | `"metric"` | Units: metric = °C, km/h, mm (snowfall cm) · imperial = °F, mph, inch. One of `"metric"`, `"imperial"`. |
| `maxLocations` | integer | `100` | Max locations: Safety cap on how many locations are processed in this run. |
| `concurrency` | integer | `5` | Concurrency: How many locations are processed in parallel. |
| `includeRaw` | boolean | `false` | Include raw upstream response: Attach the unmodified Open-Meteo payload to each per-location summary row. |

Example input:

```json
{
  "locations": [
    "London"
  ],
  "startDate": "2025-01-01",
  "endDate": "2025-01-07"
}
```

## Output

One record per input item with `status` (`ok` is charged; `not_found`, `error`, `skipped_*` are free) and `charged`. The run stores an `OUTPUT` summary record.

| Field | Type | Meaning |
| --- | --- | --- |
| `input` | string | object | Input: The parsed location input. |
| `recordType` | string | Record type: day = one billed row per location-day · location = per-location summary. |
| `location` | string | null | Location: Resolved place label or "lat,lng". |
| `resolvedPlace` | object | null | Resolved place: Geocoding match for place-name inputs. |
| `latitude` | number | null | Latitude: Grid-cell latitude used by the archive. |
| `longitude` | number | null | Longitude: Grid-cell longitude used by the archive. |
| `elevation` | number | null | Elevation (m) |
| `timezone` | string | null | Timezone: Local timezone used to aggregate days. |
| `date` | string | Date: Local calendar day (day rows). |
| `tempMax` | number | null | Max temperature |
| `tempMin` | number | null | Min temperature |
| `tempMean` | number | null | Mean temperature |
| `precipitation` | number | null | Precipitation sum |
| `rain` | number | null | Rain sum |
| `snowfall` | number | null | Snowfall sum: cm (metric) or inch. |
| `windMax` | number | null | Max wind speed (10 m) |
| `sunshineDuration` | number | null | Sunshine duration (s): Seconds of sunshine (WMO definition). |
| `units` | object | null | Units: Unit label per returned variable. |
| `startDate` | string | null | Start date (summary) |
| `endDate` | string | null | End date (summary) |
| `daysRequested` | integer | null | Days requested (summary) |
| `daysReturned` | integer | null | Days returned (summary) |
| `attribution` | string | null | Attribution: Weather data by Open-Meteo.com (CC BY 4.0). |
| `status` | string | Status: ok \| not_found \| error \| skipped_invalid \| skipped_budget \| skipped_free_plan |
| `charged` | boolean | Charged: Whether this record incurred a pay-per-event charge. |
| `chargedEvent` | string | null | Charged event |
| `source` | string | Source: openmeteo |
| `fetchedAt` | string | Fetched at: ISO timestamp. |

Example record:

```json
{
  "input": {
    "kind": "place",
    "place": "London"
  },
  "recordType": "day",
  "location": "London, England, United Kingdom",
  "latitude": 51.493847,
  "longitude": -0.12354,
  "elevation": 23,
  "timezone": "Europe/London",
  "units": {
    "tempMax": "°C",
    "tempMin": "°C",
    "precipitation": "mm"
  },
  "attribution": "Weather data by Open-Meteo.com (CC BY 4.0)",
  "date": "2025-01-01",
  "tempMax": 11.2,
  "tempMin": 6.1,
  "precipitation": 3.4,
  "status": "ok",
  "charged": true,
  "chargedEvent": "historical-weather-day",
  "source": "openmeteo",
  "fetchedAt": "2026-10-14T10:00:00.000Z"
}
```

## Related

- [Weather Forecast API](https://www.sfoln.com/actors/weather-forecast.md) (`sfoln/weather-forecast`)
- [Geocoding API – Address to Coordinates](https://www.sfoln.com/actors/geocode-address.md) (`sfoln/geocode-address`)

Publisher: SFOLN LLC, contact@sfoln.com. Catalogue: https://www.sfoln.com/catalog.json. Agent guide: https://www.sfoln.com/agents.md.
