# US Hourly Weather Windows for Outdoor Scheduling (`felixgoldwin/us-hourly-weather-windows`) Actor

Find consecutive forecast hours at US sites that fit your temperature, wind, precipitation and daytime criteria. Export time windows with local times, UTC times and links to hourly forecasts.

- **URL**: https://apify.com/felixgoldwin/us-hourly-weather-windows.md
- **Developed by:** [Felix GoldWin](https://apify.com/felixgoldwin) (community)
- **Categories:** Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 forecast windows

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

### Find a forecast window for an outdoor task

Choose a US site, specify the conditions you need, and get **one row per continuous stretch of qualifying hours**. For example, an event crew can look for three consecutive daytime hours in Dayton with temperatures from 50°F to 85°F, a precipitation chance of at most 25% and sustained wind up to 12 mph. Each result gives the crew a local start and end time plus the forecast extremes across that window.

The Actor calculates these windows from the US National Weather Service hourly forecast API. Coordinates must fall within a supported forecast grid. You can schedule recurring checks in Apify as the forecast changes. [Forecast API documentation](https://www.weather.gov/documentation/services-web-api)

### Try it

Paste this JSON into the **Input** tab, then select **Start**. This example uses a broad temperature threshold to show the shape of available coverage at a Washington, DC site.

```json
{
  "sites": [{"id": "dc-plaza", "latitude": 38.8977, "longitude": -77.0365}],
  "maxTemperatureF": 120,
  "horizonHours": 24,
  "minConsecutiveHours": 2,
  "maxItems": 3
}
```

For the Dayton event crew, use the same input form or send this payload through the **API** tab.

```json
{
  "sites": [{"id": "dayton-event", "latitude": 39.7589, "longitude": -84.1916}],
  "horizonHours": 72,
  "minConsecutiveHours": 3,
  "minTemperatureF": 50,
  "maxTemperatureF": 85,
  "maxPrecipProbabilityPct": 25,
  "maxWindMph": 12,
  "daytimeOnly": true,
  "maxItems": 20
}
```

### How the hours are selected

Supply 1–25 sites with unique IDs. Enable at least one weather threshold or select daytime only. All thresholds include the value entered. A 20% precipitation cap, for example, accepts an hour at exactly 20%. The probability applies to each hour individually. Sustained wind uses the upper end of a forecast range such as 5–10 mph. The daytime filter uses the forecast's own day/night flag.

The horizon counts whole hourly slots from the next full hour. A run at 09:15 with a 24-hour horizon looks from 10:00 today for 24 elapsed hours. A run exactly at 09:00 includes the 09:00 slot. The default horizon is 48 hours and the maximum is 168. A gap, a failed threshold or a missing value required by a filter breaks a window. Missing values for unused filters can still occur in qualifying hours. `minConsecutiveHours` defaults to 2 and accepts 1–24, up to the selected horizon. An uninterrupted nine-hour stretch produces one nine-hour result even when the minimum is three.

### Read the results

The **Output** tab links to the dataset and the run's `SUMMARY`. Download the dataset as JSON, CSV or Excel. The example below shows selected columns from an illustrative three-hour window.

```json
{
  "siteId": "dayton-event",
  "startLocal": "2026-04-15T09:00:00-04:00",
  "endLocal": "2026-04-15T12:00:00-04:00",
  "hours": 3,
  "minTemperatureF": 54,
  "maxTemperatureF": 61,
  "maxPrecipProbabilityPct": 15,
  "maxWindMph": 9
}
```

| Columns | Meaning |
| --- | --- |
| `siteId`, `latitude`, `longitude` | Your label and requested coordinates. |
| `startLocal`, `endLocal`, `timeZone` | Local start, exclusive end and site time zone. A 09:00–12:00 result covers the hours beginning at 09:00, 10:00 and 11:00. |
| `startUtc`, `endUtc`, `hours` | The same interval in UTC and its elapsed length, including across a daylight-saving change. |
| `minTemperatureF`, `maxTemperatureF`, `maxPrecipProbabilityPct`, `maxWindMph` | Forecast extrema across the interval. An extremum is null if any hour in the window lacks a usable value for that measurement. |
| `sourceUrl`, `forecastUpdatedAt`, `checkedAt` | Source grid forecast, its update time when supplied, and the time of this check. |

Use the summary when a site has no dataset rows. The `sites` entries explain what happened to each site.

| Site status | Meaning |
| --- | --- |
| `windows_found` | One or more qualifying windows were found. Check `savedWindows` for how many reached the dataset. |
| `no_matching_window` | All requested hours could be evaluated and no stretch met the criteria and minimum duration. |
| `no_window_in_complete_data`, `no_coverage` | The available hours did not establish a qualifying window, or there were no usable hourly periods in range. |
| `not_available` | The requested point or grid returned HTTP 404, or the point has no hourly forecast. Other sites can still be checked. |
| `source_rate_limited`, `not_checked_rate_limit` | The source returned HTTP 429, or the Actor skipped this later site after that rate limit. |
| `source_error`, `not_checked_source_error` | The source was unavailable, a network request failed, or the response could not be used. The second status identifies a later site skipped after that error. |
| `not_checked_limit` | The row limit or spending cap was reached before this site was checked. |

The summary gives per-site counts of missing, unknown, failed and matching hours. Its `limitedBy` field explains when a limit interrupted the run. A source diagnostic includes `detail` and the HTTP status code in `httpStatus` when available. Windows found before a source problem are preserved. For runs that found deliverable windows, `PLAN` stores the derived snapshot for interrupted writes, limited to the requested maximum and budget.

#### When should I run it again?

Schedule recurring runs around the forecast's update cadence. Use `forecastUpdatedAt` to see when the grid's forecast changed. Each run connects directly to weather.gov and reuses point and grid responses within that run, including repeated lookups for unavailable forecasts. Each new run checks coordinates afresh. [Forecast API documentation](https://www.weather.gov/documentation/services-web-api)

If the Actor defers further source requests, check `SUMMARY.retryNotBeforeUtc` before retrying the affected or skipped sites. That UTC timestamp allows at least 60 seconds from the failure and honors longer `Retry-After` values, including those given as an HTTP date. An available retry time is a suggestion for the next check. Source recovery may take longer.

### Price and limits

The price is **$2.00 per 1,000 saved windows plus $0.001 per run start**. One start and three saved windows cost $0.007. The smallest spending cap you can select is $0.003. One start with zero saved windows costs $0.001. Site diagnostics are included in the summary without a result charge. The default limit is 100 windows across all sites. Set `maxItems` to a value from 1 to 1,000 and use the run spending limit to control delivery.

US National Weather Service forecast data is publicly available for lawful reuse. FelixGoldwin independently computes the windows from that data. A forecast can change between runs. These criteria support routine scheduling and do not evaluate lightning, gusts, hazardous-weather alerts or onsite conditions. [Source data use policy](https://www.weather.gov/disclaimer)

# Actor input Schema

## `sites` (type: `array`):

Supply 1–25 sites. Give each a unique text id and numeric latitude and longitude in decimal degrees. Coverage requires a US National Weather Service hourly forecast grid.

## `horizonHours` (type: `integer`):

Check this many whole hourly slots, starting at the next full hour. A run that starts exactly on the hour includes that hour. Coverage depends on the forecast available.

## `minConsecutiveHours` (type: `integer`):

Require at least this many adjacent qualifying hours. A longer continuous run is returned as one window.

## `minTemperatureF` (type: `number`):

Optional inclusive lower bound on the hourly forecast air temperature, in degrees Fahrenheit.

## `maxTemperatureF` (type: `number`):

Optional inclusive upper bound on the hourly forecast air temperature, in degrees Fahrenheit.

## `maxPrecipProbabilityPct` (type: `number`):

Optional inclusive cap on each hour's forecast probability of any precipitation. Enter 0–100. Missing probability breaks the window when this condition is active.

## `maxWindMph` (type: `number`):

Optional inclusive cap on forecast sustained wind. For a range, the Actor checks its upper end. Gusts are outside this filter.

## `daytimeOnly` (type: `boolean`):

Include only hours the source marks as daytime. Overnight periods can qualify when this option is off.

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

Cap total dataset rows across all sites in this run. The run spending limit can also limit delivery.

## Actor input object example

```json
{
  "sites": [
    {
      "id": "dc-plaza",
      "latitude": 38.8977,
      "longitude": -77.0365
    }
  ],
  "horizonHours": 48,
  "minConsecutiveHours": 2,
  "maxPrecipProbabilityPct": 30,
  "daytimeOnly": false,
  "maxItems": 100
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (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 = {
    "sites": [
        {
            "id": "dc-plaza",
            "latitude": 38.8977,
            "longitude": -77.0365
        }
    ],
    "maxPrecipProbabilityPct": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("felixgoldwin/us-hourly-weather-windows").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 = {
    "sites": [{
            "id": "dc-plaza",
            "latitude": 38.8977,
            "longitude": -77.0365,
        }],
    "maxPrecipProbabilityPct": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("felixgoldwin/us-hourly-weather-windows").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 '{
  "sites": [
    {
      "id": "dc-plaza",
      "latitude": 38.8977,
      "longitude": -77.0365
    }
  ],
  "maxPrecipProbabilityPct": 30
}' |
apify call felixgoldwin/us-hourly-weather-windows --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,felixgoldwin/us-hourly-weather-windows"
        }
    }
}
```

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/tjMApS5HfORHglxIc/builds/zwDb1pNrbamWxxVmb/openapi.json
