# Weather Data Scraper (`bovi/weather-scraper`) Actor

Collect daily and 48-hour forecasts plus rolling recent observations from weather.com for locations worldwide. Select metric or imperial units and cap the number of dataset records.

- **URL**: https://apify.com/bovi/weather-scraper.md
- **Developed by:** [Vitalii Bondarev](https://apify.com/bovi) (community)
- **Categories:** Travel, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 weather data scrapers

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

## Weather.com Weather Data Scraper

Extract daily and 48-hour forecasts plus rolling recent observations from public Weather.com data for recognized locations. Pricing is $0.001 per saved dataset item on the Free plan, plus $0.00005 per Actor Start event on the Free plan.

- Scrape daily conditions, temperatures, precipitation chances, wind, and sun times for travel planning.
- Extract hourly forecast details grouped by local date for short-term monitoring.
- Analyze rolling 24-hour observations, including temperature, pressure, visibility, and precipitation.
- Compare locations in metric or imperial units while capping saved records across the run.
- Run without a buyer-owned Weather.com API key or login; the Actor discovers the public client key at runtime.

### What you get

The Actor uses Weather.com location search and public weather data routes:

- `forecast-daily` returns up to 10 daily records per location.
- `forecast-hourly` groups the 48-hour forecast into records by local date.
- `history` groups the rolling 24-hour observations by local date and calculates summary values.

Source fields that are unavailable are omitted. `summary` is omitted when it has no values, and empty fields inside hourly arrays are omitted.

| Field family | Fields | Type | Mode |
| --- | --- | --- | --- |
| Record identity | `location`, `locationName`, `locationId`, `dataType`, `date`, `dayOfWeek`, `units` | string | All modes; omitted when unavailable |
| Collection time | `scrapedAt` | ISO 8601 string | All modes; omitted when unavailable |
| Daily forecast values | `highTemp`, `lowTemp`, `precipitation`, `windSpeed` | number | `forecast-daily`; omitted when unavailable |
| Daily forecast values | `precipChance`, `humidity`, `cloudCover`, `uvIndex` | integer | `forecast-daily`; omitted when unavailable |
| Daily forecast values | `conditions`, `windDirection`, `narrative` | string | `forecast-daily`; omitted when unavailable |
| Daily sun times | `sunrise`, `sunset` | string | `forecast-daily`; omitted when unavailable |
| Hourly forecast | `hourlyForecast.time`, `hourlyForecast.windDirection`, `hourlyForecast.conditions` | string | `forecast-hourly`; omitted when unavailable |
| Hourly forecast | `hourlyForecast.temp`, `hourlyForecast.feelsLike`, `hourlyForecast.windSpeed` | number | `forecast-hourly`; omitted when unavailable |
| Hourly forecast | `hourlyForecast.humidity`, `hourlyForecast.precipChance`, `hourlyForecast.cloudCover`, `hourlyForecast.uvIndex` | integer | `forecast-hourly`; omitted when unavailable |
| Hourly observations | `hourlyObservations.time`, `hourlyObservations.windDirection`, `hourlyObservations.conditions` | string | `history`; omitted when unavailable |
| Hourly observations | `hourlyObservations.temp`, `hourlyObservations.dewPoint`, `hourlyObservations.windSpeed`, `hourlyObservations.windGust`, `hourlyObservations.precip24Hour`, `hourlyObservations.pressure`, `hourlyObservations.visibility` | number | `history`; omitted when unavailable |
| Hourly observations | `hourlyObservations.humidity` | integer | `history`; omitted when unavailable |
| Observation summary | `summary` | object | `history`; omitted when empty |
| Observation summary values | `summary.highTemp`, `summary.lowTemp`, `summary.avgTemp`, `summary.dewPoint`, `summary.maxWindSpeed`, `summary.avgWindSpeed`, `summary.precipitation24Hour`, `summary.pressure`, `summary.visibility` | number | `history`; individual fields omitted when unavailable |
| Hourly data arrays | `hourlyForecast`, `hourlyObservations` | array of objects | `forecast-hourly` or `history`; entries for each local date |

### Sample output

Example `forecast-daily` record for `San Francisco, CA`

```json
{
  "location": "San Francisco, CA", "locationName": "San Francisco",
  "locationId": "USCA0987:1:US", "dataType": "forecast-daily",
  "date": "2026-11-16", "units": "metric",
  "scrapedAt": "2026-11-17T00:51:36.970524+00:00",
  "dayOfWeek": "Monday", "highTemp": 16, "lowTemp": 10,
  "conditions": "Partly Cloudy", "precipChance": 18, "humidity": 76,
  "windSpeed": 13, "windDirection": "NNW", "cloudCover": 36,
  "uvIndex": 0, "narrative": "Partly cloudy. Low 8C.",
  "precipitation": 0, "sunrise": "2026-11-16T06:51:03-0800",
  "sunset": "2026-11-16T16:57:20-0800"
}
```

### Pricing

This Actor uses pay-per-event billing:

| Charge event | Unit | Free-plan price |
| --- | --- | ---: |
| `apify-actor-start` | event | $0.00005 per event on the Free plan |
| `apify-default-dataset-item` | event | $0.001 per event on the Free plan |

Each saved dataset record is one billable dataset-item event. On the Free plan, 1,000 saved dataset records with one Actor Start event cost 1,000 × $0.001 + $0.00005 = $1.00005, and 10,000 saved dataset records with one Actor Start event cost 10,000 × $0.001 + $0.00005 = $10.00005. On the Free plan, the $5 credit covers 4,999 dataset items (with one Actor Start event).

Apify’s Free plan includes $5 of monthly platform usage credit.

You pay only for the events listed above. This Actor does not use the Pay per event + usage option, so compute, proxy traffic, and storage are not billed separately to you.

### How to use

1. Open the Actor in your Apify account.
2. Choose `forecast-daily`, `forecast-hourly`, or `history` for `dataType`.
3. Enter one or more city names or Weather.com-recognized locations.
4. Select `metric` or `imperial` units and set `maxResults` to the total record limit.
5. Use the default Apify Proxy with the `RESIDENTIAL` group, select another group in `proxyConfiguration`, or disable the proxy for direct requests.
6. Run the Actor and read the records from its dataset.
7. Repeat the run through Apify Schedules; daily is a suitable starting point for regularly collecting weather records.

Example input:

```json
{
  "dataType": "forecast-hourly",
  "locations": ["San Francisco, CA", "Prague"],
  "units": "metric",
  "maxResults": 20
}
```

Export the dataset as JSON or CSV, or read it through the Apify dataset API.

### Input parameters

| Parameter | What it does | Default |
| --- | --- | --- |
| `dataType` | Selects `forecast-daily`, `forecast-hourly`, or `history`. | `forecast-daily` |
| `locations` | Array of non-empty city names or Weather.com-recognized locations. A string is also accepted as one location. | No default; UI prefill: `San Francisco, CA` |
| `units` | Selects Weather.com units for temperature, wind, and precipitation: `metric` or `imperial`. | `metric` |
| `maxResults` | Maximum dataset records saved across the run. | `50` |
| `proxyConfiguration` | Optional Apify Proxy configuration. Select a proxy group or disable the proxy for direct requests. | Apify Proxy, `RESIDENTIAL` group |

### Limits and edge cases

| Condition | What you see | What to do |
| --- | --- | --- |
| Records are generated for a location | `forecast-daily` returns at most 10 records per location. `forecast-hourly` returns one record per local date in its 48-hour payload, about 2-3 per location. `history` returns one per local date in its 24-hour payload, about 1-2 per location. Unparseable dates are skipped. Each record is billable. | Choose the mode and time range you need. |
| `maxResults` is reached | The Actor stops pushing records when the total reaches the configured limit. | Increase `maxResults` or split locations across runs. |
| A location is ambiguous, has no candidates, or has no coordinates | One candidate is used. Matching uses the part before the first comma, so `Prague` can resolve to an unintended place. The result appears in `locationName` and `locationId`; no candidate or coordinates raises an error. | Check those fields and use a more specific location. |
| A weather payload is not an object or has no usable timestamps | No records are produced; the run does not fail, so the dataset can be empty or shorter than expected. | Check the mode and location, then run again. |
| A request fails, returns HTTP 429, or returns HTTP 500 or higher | The request is retried up to three attempts. Continued failure raises an error. Other HTTP responses raise an error without those retries. | Retry the run or select another proxy group. |
| Weather.com JavaScript does not list expected chunks or a public client key | The run raises an error during public-key discovery. | Retry later or use the proxy configuration. |
| `dataType` is unsupported, or `locations` is missing or empty | Validation fails. | Use one supported mode and provide one or more non-empty locations. |
| `units` is not `metric` or `imperial` | `metric` is used. | Use a supported unit value. |
| `maxResults` is zero or negative | The run ends as Succeeded with an empty dataset. | Use an integer of at least `1`. |

Records are pushed as each location is parsed. An error, timeout, or abort leaves already-pushed records in the dataset. A failing location stops the run, so later locations are not processed; pushed records remain subject to dataset-item billing.

### FAQ

#### How much does it cost to scrape Weather.com?

See Pricing for the event prices, Free-plan calculation, and platform usage treatment.

#### Why did the run return an empty dataset?

A payload can produce no records when it is not an object or has no usable timestamps. An unresolved location raises an error during discovery. Check the locations and selected `dataType`.

#### What should I check if the Actor is not working?

Confirm `dataType`, `units`, and `maxResults`. Network failures, HTTP 429, and HTTP 500-or-higher responses are retried up to three attempts. The Apify Proxy is on by default, and another proxy group can be selected in `proxyConfiguration`.

#### Is collecting public Weather.com data legal or allowed?

The Actor collects public data supplied through Weather.com’s public route. Whether a use is legal or allowed under the source’s terms and applicable law depends on the buyer’s use case; review those terms and requirements.

### Related actors

- [Auswärtiges Amt RSS Feed Scraper](https://apify.com/bovi/auswaertigesamt-scraper)

# Actor input Schema

## `dataType` (type: `string`):

Choose a 10-day daily forecast, 48-hour hourly forecast, or the latest rolling 24 hours of observations.

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

City names or locations recognized by Weather.com, such as San Francisco, CA, Prague, or Tokyo, Japan.

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

Units used by Weather.com for temperatures, wind, and precipitation values.

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

Maximum number of dataset records to save across all locations.

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

Optional Apify Proxy settings. If disabled or omitted, requests go directly to Weather.com.

## Actor input object example

```json
{
  "dataType": "forecast-daily",
  "locations": [
    "San Francisco, CA",
    "Prague",
    "Tokyo, Japan"
  ],
  "units": "metric",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset with the weather records.

# 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 = {
    "dataType": "forecast-daily",
    "locations": [
        "San Francisco, CA"
    ],
    "units": "metric",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/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 = {
    "dataType": "forecast-daily",
    "locations": ["San Francisco, CA"],
    "units": "metric",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bovi/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 '{
  "dataType": "forecast-daily",
  "locations": [
    "San Francisco, CA"
  ],
  "units": "metric",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bovi/weather-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bovi/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/v3zt9EY6vyfER85vI/builds/LnX2bb0B1lQ7sYZPO/openapi.json
