# Historical Weather API: Hourly, Daily, Forecast and Climatology (`nabeelbaghoor/historical-weather-climatology-api`) Actor

Historical weather API: daily and hourly weather history, 15 day forecast and climatology normals by latitude/longitude, ZIP or postal code, DMA or OnPoint ID. Temperature, precipitation, snowfall, humidity, wind, cloud cover and solar radiation from Weather Source OnPoint. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/historical-weather-climatology-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 weather history or forecast rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 API: Hourly, Daily, Forecast and Climatology

Get daily and hourly historical weather, a 15 day forecast and climatology normals for any coordinate, ZIP or postal code, DMA or OnPoint grid point, as clean rows you can export to CSV, Excel or JSON.

This actor wraps the Weather Source OnPoint History, Forecast and Climatology APIs (by Pelmorex, The Weather Network for Business). OnPoint is a gap-free, homogeneous global weather grid covering every landmass and up to 200 miles offshore. Bring your own Weather Source API key.

BYOK, not live tested: every route, parameter and field comes from Weather Source's own OpenAPI descriptions, and every route was probed on 2026-11-07 with a bogus key of realistic length. It has not been run against a live key.

### What it does

- **Historical weather API**: daily or hourly weather history for any past date range. Daily rows carry min, average and max temperature, feels like, dew point, heat index, wind chill, wet bulb, humidity, pressure, wind speed and direction at 10, 80 and 100 meters, cloud cover, visibility, solar radiation, precipitation, snowfall, snow depth and precipitation type hour counts.
- **Weather forecast API**: the full daily forecast (up to 15 days) or hourly forecast (up to 240 hours) from NOAA GFS on the OnPoint grid, with probability of precipitation and snowfall.
- **Climatology API**: typical weather for each calendar day or hour, with standard deviations, 25th to 90th percentiles of precipitation and snowfall, and precipitation and snowfall frequency bands. Use it as the baseline for weather anomalies.
- **Any location type**: latitude/longitude points, ZIP and postal codes in many countries, Designated Market Areas (DMAs) and OnPoint IDs.
- **Long periods made easy**: date ranges longer than the documented 1 year per request are split automatically.
- **Units you choose**: imperial, metric or SI, with each field's unit saved to the key-value store as FIELD_UNITS.

### What you need

A Weather Source API key: sign up for a developer account at developer.weathersourceapis.com or ask Weather Source sales for a subscription. Paste the key into the **Weather Source API key** field, or set the DATA_API_KEY secret. Requests count against your Weather Source plan. The actor never signs up or buys anything for you.

### Input

| Field | Notes |
| --- | --- |
| `mode` | `history`, `forecast` or `climatology` |
| `interval` | `daily` or `hourly` |
| `apiKey` | your Weather Source key; falls back to DATA_API_KEY |
| `locations` | one per line: `40.7128,-74.0060`, `10001`, `M5V 3L9,CA`, `dma:501`, `onpoint:10725864` |
| `countryCode` | ISO country for postcodes written without one (default US) |
| `startDate`, `endDate` | history and climatology: YYYY-MM-DD, or a date-time for hourly data |
| `fields` | field names or groups (default `popular`) |
| `unitScale` | `IMPERIAL`, `METRIC` (default here) or `SI` |
| `maxResults` | stop after this many rows (default 1,000) |

Example input:

```json
{
    "mode": "history",
    "interval": "daily",
    "locations": ["40.7128,-74.0060", "60601", "SW1A 1AA,GB"],
    "startDate": "2024-07-01",
    "endDate": "2024-07-31",
    "fields": ["tempMax", "tempMin", "precip", "snowfall", "relHumAvg", "windSpdAvg"],
    "unitScale": "METRIC"
}
```

#### Field names

Groups work in every mode: `popular`, `all`, `allTemp`, `allPrecip`, `allHum`, `allWind`, `allPres`, `allRad`, `allCldCvr`.

- **History, daily**: `provisionalFlag`, `cldCvrMin/Avg/Max`, `dewPtMin/Avg/Max`, `feelsLikeMin/Avg/Max`, `heatIndexMin/Avg/Max`, `mslPresMin/Avg/Max`, `precip`, `presTendMin/Avg/Max`, `radSolarMin/Avg/Max/Tot`, `relHumMin/Avg/Max`, `sfcPresMin/Avg/Max`, `snowDepth`, `snowfall`, `spcHumMin/Avg/Max`, `tempMin/Avg/Max`, `visMin/Avg/Max`, `wetBulbMin/Avg/Max`, `windChillMin/Avg/Max`, `windDirAvg`, `windDir80mAvg`, `windDir100mAvg`, `windSpdMin/Avg/Max`, `windSpd80mMin/Avg/Max`, `windSpd100mMin/Avg/Max`, `precipHourCnt`, `snowfallHourCnt`, `freezingRainFlagCnt`, `icePelletsFlagCnt`, `rainFlagCnt`, `snowFlagCnt`.
- **History, hourly**: `provisionalFlag`, `cldCvr`, `dewPt`, `feelsLike`, `heatIndex`, `mslPres`, `precip`, `presTend`, `radSolar`, `relHum`, `sfcPres`, `snowfall`, `spcHum`, `temp`, `vis`, `wetBulb`, `windChill`, `windDir`, `windDir80m`, `windDir100m`, `windSpd`, `windSpd80m`, `windSpd100m`, `freezingRainFlag`, `icePelletsFlag`, `rainFlag`, `snowFlag`.
- **Forecast**: the daily and hourly history names without visibility, pressure tendency, snow depth and precipitation type fields, plus `precipProb`, `snowfallProb` and `timestampInit` (model run time).
- **Climatology**: the daily or hourly names with `Sd` standard deviations (`tempAvgSd`, `precipSd`), percentiles (`precip25p` to `precip90p`, `precipIqr`, the same for snowfall) and frequencies (`precipFreq`, `precipFreq0`, `precipFreq001To009` up to `precipFreq500Plus`, `snowfallFreq` bands), and hourly wind vector speeds (`windVecSpd`).

Write `tempMin/Avg/Max` as three names: `tempMin`, `tempAvg`, `tempMax`.

### Output

One row per location and day or hour. Example (history, daily, metric):

```json
{
    "recordType": "historyDay",
    "found": true,
    "mode": "history",
    "interval": "daily",
    "query": "40.7128,-74.006",
    "locationType": "point",
    "unitScale": "METRIC",
    "latitude": 40.7128,
    "longitude": -74.006,
    "timezone": "America/New_York",
    "countryCode": "US",
    "countryName": "United States",
    "subdivCode": "US-NY",
    "subdivName": "New York",
    "grid": "NORTH_AMERICA_GRID",
    "elevation": 10.4,
    "date": "2024-07-01",
    "tempMax": 27.8,
    "tempMin": 19.1,
    "precip": 0,
    "snowfall": 0,
    "relHumAvg": 58.2,
    "windSpdAvg": 14.6
}
```

The values above show the shape only. A skipped line, empty answer or refused lookup becomes a row with `found: false` and a `note`, and is never charged.

### Pricing

Pay per event, to this actor, on top of your Weather Source plan:

- **Weather history or forecast row**: $0.005 per location per day or hour.
- **Climatology row**: $0.01 per location per day or hour.

Skipped lines, empty answers and refused lookups are free. Set **Maximum rows** to cap spend: a year of hourly history for one location is 8,784 rows at most.

### FAQ

#### How do I get historical weather data for a ZIP code?

Set the mode to history, put the ZIP code (for example `10001`) in Locations, and set a start and end date. Postcodes outside the US take a country code after a comma, such as `M5V 3L9,CA`. Weather Source documents which countries have postcode support on its developer portal.

#### How far back does the historical weather go?

Weather Source History is built on a NOAA reanalysis dataset on the OnPoint grid. How many years your key can read depends on your Weather Source subscription; this actor sends any dates you give and reports the provider's answer.

#### What is the difference between history and climatology?

History is what actually happened on a date. Climatology is the typical weather for that calendar day or hour at that location, with standard deviations and percentiles, so you can tell how unusual a day was or plan around normal conditions.

#### Can I get hourly weather data?

Yes. Set the interval to hourly. For history and climatology you can give exact date-times with an offset, such as 2024-07-01T06:00:00-04:00. Hourly forecasts cover up to 240 hours.

#### What weather forecast does it return?

The Weather Source Forecast API, based on the NOAA GFS model on the OnPoint grid: up to 15 days daily or 240 hours hourly from today. Every forecast request returns the complete forecast; Maximum rows trims it.

#### What is a DMA or OnPoint ID?

A DMA is a Designated Market Area, a US media market such as 501 for New York; rows for a DMA are aggregated over sample points in it. An OnPoint ID is a point on Weather Source's grid. Both are documented on the Weather Source developer portal.

#### Which units are used?

You choose: imperial (Fahrenheit, inches, miles per hour), metric (Celsius, centimeters, km per hour) or SI (Kelvin). The exact unit of every returned field is saved to the key-value store as FIELD_UNITS.

#### Is it good for retail, energy and insurance analytics?

Weather Source data is widely used for demand forecasting, weather normalized sales, energy load modeling and claims checks. Your Weather Source agreement decides how you may use the data.

### Keyword map

historical weather API, weather history API, past weather data, hourly weather data, daily weather data, weather by ZIP code, weather by postal code, weather by latitude longitude, weather forecast API, 15 day forecast, climatology API, weather normals, climate normals, weather anomalies, DMA weather, temperature history, precipitation history, snowfall data, Weather Source OnPoint, Pelmorex.

### Routes and verification

| Mode | Routes | Probe with a bogus key (twice) |
| --- | --- | --- |
| History | GET history.weathersourceapis.com/v2/{points/{lat},{lng} or postcodes/{postcode},{country} or dmas/{id} or onpoints/{id}}/days/{date} or /days/{start},{end}, /hours/{timestamp} or /hours/{start},{end} (fields, unitScale) | 403 JSON "PERMISSION DENIED. Invalid API key" |
| Forecast | GET forecast.weathersourceapis.com/v2/{location}/days or /hours (fields, unitScale) | same |
| Climatology | GET climatology.weathersourceapis.com/v2/{location}/days/... or /hours/... (fields, unitScale) | same |
| Invented control routes | /v2/pointz/..., /v2/inventedz, /v3/points/... | 404 JSON "NOT FOUND. Resource not found" |

The key travels only in the X-API-KEY header.

### Licensing and data use

This actor works only with your own Weather Source API key, and your agreement with Weather Source applies. Weather Source licenses its data for the subscriber's internal business use; reselling or redistributing raw data needs a separate reseller agreement with Weather Source. Here every request runs on your own key for your own use. This actor is not affiliated with or endorsed by Weather Source or Pelmorex.

# Actor input Schema

## `mode` (type: `string`):

Weather history (past days or hours, from the History API), the forecast (up to 15 days or 240 hours ahead, from the Forecast API) or climatology (typical weather for each calendar day or hour, from the Climatology API). Each calls the documented Weather Source OnPoint routes with your own key.

## `interval` (type: `string`):

One row per day (min, average and max values and daily totals) or one row per hour.

## `apiKey` (type: `string`):

Your own Weather Source API key from your account at developer.weathersourceapis.com. Sent only in the X-API-KEY header to the Weather Source hosts and removed from every log line. Leave empty to use the DATA_API_KEY secret.

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

One location per line: a latitude,longitude pair (40.7128,-74.0060), a ZIP or postal code (10001, or M5V 3L9,CA with a country code), a Designated Market Area as dma:501, or an OnPoint grid point as onpoint:10725864. Duplicates are read once, and lines that are not a location are skipped for free.

## `countryCode` (type: `string`):

Two-letter ISO country code used for postcodes written without one, such as US, CA or GB.

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

History and climatology only, and then required. YYYY-MM-DD. For hourly data you may also give a date-time such as 2024-07-01T06:00:00-04:00 (no offset means UTC); a bare date starts at 00:00 UTC.

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

History and climatology only. YYYY-MM-DD, or a date-time for hourly data; a bare date ends at 23:00 UTC. Leave empty for the start date alone. Periods longer than the documented 1 year per request are split automatically.

## `fields` (type: `array`):

Field names or documented groups. Groups: popular (cloud cover, feels like, precipitation, humidity, snowfall, temperature, wind), all, allTemp, allPrecip, allHum, allWind, allPres, allRad, allCldCvr. Daily names carry Min, Avg or Max (tempMax, relHumAvg, windSpdMax, precip, snowfall); hourly names are plain (temp, relHum, windSpd). Climatology adds Sd, percentile and frequency fields such as tempAvgSd, precip90p and precipFreq. Leave empty for popular. Fewer fields make answers faster.

## `unitScale` (type: `string`):

IMPERIAL (Fahrenheit, inches, miles per hour), METRIC (Celsius, centimeters, km per hour) or SI (Kelvin, centimeters, km per hour). The units of every returned field are saved to the key-value store as FIELD_UNITS.

## `maxResults` (type: `integer`):

The run stops after this many rows (one row per location and day or hour). It also caps how many locations are read.

## Actor input object example

```json
{
  "mode": "history",
  "interval": "daily",
  "locations": [
    "40.7128,-74.0060"
  ],
  "countryCode": "US",
  "startDate": "2024-07-01",
  "endDate": "2024-07-07",
  "fields": [
    "popular"
  ],
  "unitScale": "METRIC",
  "maxResults": 1000
}
```

# Actor output Schema

## `records` (type: `string`):

One row per location and day or hour.

## `fieldUnits` (type: `string`):

Each returned field name with its unit, from the first answer.

# 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 = {
    "locations": [
        "40.7128,-74.0060"
    ],
    "startDate": "2024-07-01",
    "endDate": "2024-07-07",
    "fields": [
        "popular"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/historical-weather-climatology-api").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 = {
    "locations": ["40.7128,-74.0060"],
    "startDate": "2024-07-01",
    "endDate": "2024-07-07",
    "fields": ["popular"],
}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/historical-weather-climatology-api").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 '{
  "locations": [
    "40.7128,-74.0060"
  ],
  "startDate": "2024-07-01",
  "endDate": "2024-07-07",
  "fields": [
    "popular"
  ]
}' |
apify call nabeelbaghoor/historical-weather-climatology-api --silent --output-dataset

```

## MCP server setup

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

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/xr9wve0rVKUCsvhkr/builds/V3OrjKQz8wht7rhfX/openapi.json
