# Weather Forecast and History Scraper (`parselab/weather-forecast-history-scraper`) Actor

Get weather for any place in the world: daily and hourly forecasts with sunrise and sunset, and daily history since 1981 with monthly summaries, degree days, frost and rain days. For the United States also get active weather alerts and live station observations. Export to CSV or Excel.

- **URL**: https://apify.com/parselab/weather-forecast-history-scraper.md
- **Developed by:** [ParseLab](https://apify.com/parselab) (community)
- **Categories:** Travel, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $13.50 / 1,000 results

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

## Weather Forecast and History Scraper

This weather scraper returns forecasts and past weather for any place in the world, plus active weather alerts and live observations for the United States. Enter city names or coordinates and get clean rows in metric or imperial units: a daily forecast with highs, lows, rain, wind, sunrise and sunset, an hourly forecast, daily history back to 1981, and monthly or yearly climate summaries.

Beyond the usual temperature and rain, the history rows include the numbers farmers, energy analysts and event planners ask for: growing degree days, heating and cooling degree days, frost days, rain days, hot days, solar radiation, dew point, humidity and wind. Monthly and yearly summaries add totals and counts for the whole period. For the United States you also get active alerts such as tornado, flood, heat and winter storm warnings, with severity, instructions and expiry time, and the latest reading measured at the nearest weather station.

Farmers, energy traders, logistics teams, insurers, event planners and app developers use it to plan, to model demand and to explain sales.

### What can you do with this weather scraper?

- Get a 7 day forecast for a list of cities
- Get an hourly forecast with feels like temperature, wind gusts, cloud cover and UV
- Find sunrise and sunset times for every day of the forecast
- Download daily weather history for a place since 1981
- Compare monthly rainfall and temperature across years
- Count frost days, rain days and hot days in a season
- Calculate heating and cooling degree days for energy demand
- Track growing degree days for crops
- List active tornado, flood and heat warnings in a state
- Read the latest measured temperature, wind and visibility at a United States station
- Export weather data to CSV or Excel

### What data can you extract about the weather?

| Mode | One row is | Highlights |
|---|---|---|
| Forecast, daily | One place and day | High, low and mean temperature, total precipitation, rainy periods, highest rain probability, wind and gust maximum, mean humidity, cloud cover, UV index, pressure, sunrise, sunset, main weather |
| Forecast, hourly | One forecast step | Temperature, feels like, dew point, humidity, pressure, wind speed, gust and direction, cloud cover by layer, fog, UV, precipitation and probability, weather |
| History | One place and day, month or year | Mean, maximum and minimum temperature, dew point, humidity, precipitation, wind at 2 and 10 meters, pressure, solar radiation, degree days, frost, rain and hot day flags |
| Alerts (United States) | One active alert | Event, severity, certainty, urgency, headline, description, instructions, area, states, effective and expiry time, sender |
| Observations (United States) | One place | Station, time, conditions, temperature, dew point, humidity, wind, pressure, visibility, heat index, wind chill, cloud layers |

Every row shows its units. You can switch all fields between metric and imperial.

### How to scrape weather

1. Choose **What to collect**, for example Forecast.
2. Enter places as city names or coordinates such as `40.71,-74.00`.
3. Pick daily or hourly detail, the number of days and the units.
4. For history, set the start and end dates. For alerts, enter states.
5. Set **Max Items** and click **Start**.
6. Export the dataset as CSV, Excel or from the Apify console.

### Input example

```json
{
  "mode": "forecast",
  "locations": ["40.71,-74.00", "Berlin"],
  "forecastDays": 7,
  "units": "metric",
  "maxItems": 50
}
```

### Daily forecast output example

```json
{
  "location": "40.71,-74.00",
  "latitude": 40.71,
  "longitude": -74,
  "timezone": "America/New_York",
  "date": "2026-09-29",
  "temperatureMax": 21.2,
  "temperatureMin": 14.8,
  "temperatureMean": 19.3,
  "precipitationTotal": 0,
  "windSpeedMax": 9,
  "humidityMeanPct": 82,
  "cloudCoverMeanPct": 86,
  "pressureMean": 1016.6,
  "sunrise": "2026-09-29T06:50-04:00",
  "sunset": "2026-09-29T18:41-04:00",
  "weather": "Cloudy",
  "units": { "temperature": "°C", "speed": "km/h", "precipitation": "mm", "pressure": "hPa" }
}
```

### Monthly history output example

```json
{
  "location": "40.71,-74.00",
  "period": "2025-01",
  "days": 31,
  "temperatureMean": 0.2,
  "temperatureMax": 9.7,
  "temperatureMin": -8.4,
  "precipitationTotal": 22.3,
  "rainDays": 5,
  "frostDays": 22,
  "humidityMeanPct": 76,
  "heatingDegreeDaysTotal": 560,
  "coolingDegreeDaysTotal": 0,
  "source": "NASA POWER"
}
```

### How much does it cost to scrape weather?

You pay per result: $18 per 1,000 rows plus a tiny start fee. The free plan returns up to 10 rows per run. A 7 day daily forecast for 100 cities is 700 rows, and a full year of daily history for one place is 365 rows.

### Tips for better results

- Coordinates are exact and faster. City names are looked up in a public place database and the first match is used, so check the place name in the result.
- The first day of a forecast can be partial when you run late in the day. Daily rows show how many hours they cover and flag a partial day.
- History comes from a global model that combines satellite and ground data at a resolution of about 50 kilometers. It is good for trends, farming and energy work, not for the exact reading of one weather station.
- The most recent days of history are missing for a few days. The default end date is five days ago.
- Alerts and observations cover the United States only. Forecast and history cover the whole world.

### Who uses weather data?

- **Farmers and agronomists** track growing degree days, frost and rain.
- **Energy and utility analysts** model demand with heating and cooling degree days.
- **Retail, logistics and event teams** plan around forecasts and past weather.
- **Developers** power apps, dashboards and alerts.

### Automate and connect

Schedule the Actor every morning for your list of places, or every hour for alerts in your states. Send finished datasets to Google Sheets, Slack, Zapier, Make or n8n, or trigger a webhook when a run ends.

### FAQ

**Do I need an account?**
No. The Actor works without any login.

**Where does the data come from?**
Forecasts come from MET Norway and are shared under the Creative Commons Attribution 4.0 license, so credit MET Norway if you publish them. History comes from NASA POWER. Alerts and observations come from the United States National Weather Service.

**How many days ahead is the forecast?**
Up to 10 days.

**How far back does the history go?**
To 1981.

**Does it include air quality?**
No. This Actor covers weather only.

### Legal note

This Actor collects information that is publicly visible on the website. Check the source site's terms and your local rules before using the data. Forecast data is provided by MET Norway. Weather can change quickly, so do not use this data alone for decisions about safety.

### Support

Missing a field or found a bug? Open an issue from the Actor page.

# Actor input Schema

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000.

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

Forecast gives daily or hourly forecasts for any place in the world. History gives past daily weather since 1981, or monthly and yearly summaries. Alerts gives active United States weather warnings. Observations gives the latest measured weather at the nearest United States station.

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

City names or coordinates, one per line. For example New York, Berlin or 40.71,-74.00. Coordinates are the most exact. Alerts mode can also use states instead of places.

## `units` (type: `string`):

Metric uses degrees Celsius, km/h, millimeters and hPa. Imperial uses degrees Fahrenheit, mph, inches and inHg.

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

Daily returns one summary row per day with highs, lows, rain, wind, sunrise and sunset. Hourly returns every forecast step. Hourly steps are one hour for about 2.5 days and six hours after that.

## `forecastDays` (type: `integer`):

How many days ahead, from 1 to 10.

## `dateFrom` (type: `string`):

First day of the history, YYYY-MM-DD. Data starts in 1981. The default is 30 days before the end date.

## `dateTo` (type: `string`):

Last day of the history, YYYY-MM-DD. The most recent days are usually available after a delay of a few days. The default is five days ago.

## `historyAggregate` (type: `string`):

Daily returns one row per day. Monthly and yearly return one row per period with averages, totals, rain days, frost days and degree days.

## `states` (type: `array`):

Two letter United States state or territory codes for alerts mode, for example TX, FL, CA.

## `minSeverity` (type: `string`):

Keep only alerts at or above this severity.

## `alertEvents` (type: `array`):

Keep only alerts whose type contains one of these words, for example Tornado, Flood, Hurricane, Heat or Winter Storm.

## `contactEmail` (type: `string`):

The weather services ask automated tools to identify themselves. Your email is sent only in the request header to them. It is optional.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "forecast",
  "locations": [
    "40.71,-74.00",
    "Berlin"
  ],
  "units": "metric",
  "granularity": "daily",
  "forecastDays": 7,
  "historyAggregate": "daily",
  "minSeverity": "Minor"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "maxItems": 10,
    "locations": [
        "40.71,-74.00",
        "Berlin"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parselab/weather-forecast-history-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 = {
    "maxItems": 10,
    "locations": [
        "40.71,-74.00",
        "Berlin",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("parselab/weather-forecast-history-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 '{
  "maxItems": 10,
  "locations": [
    "40.71,-74.00",
    "Berlin"
  ]
}' |
apify call parselab/weather-forecast-history-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parselab/weather-forecast-history-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/N7p0xHI9bCPuASkKw/builds/0dAqTveq6sVRJJPb0/openapi.json
