# Yahoo Weather Scraper (`searchapi/yahoo-weather-scraper`) Actor

Scrapes Yahoo Weather for current conditions, hourly and daily forecasts, humidity, wind, UV index, and air quality for any location.

- **URL**: https://apify.com/searchapi/yahoo-weather-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 92.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Yahoo Weather Scraper

Collect current conditions and up to eight days of Yahoo Weather forecasts for one or many public locations. Version 3 uses Yahoo's server-rendered structured React payload, so it needs one lightweight HTTP request per location and does not wait for a browser to render advertisements or client scripts.

### Input

`locations` accepts user-friendly `Town, REGION, COUNTRY` values such as `Nashville, TN, US` and `London, England, GB`. Existing `country/region/town` paths and complete `https://weather.yahoo.com/...` URLs remain supported. Town and region names are converted to Yahoo's lowercase URL slugs; country must be the two-letter code used in Yahoo's route.

Use `detailLevel` to control output size:

- `current`: current conditions and weather detail metrics only.
- `daily`: current conditions plus daily temperature, precipitation, and wind summaries.
- `full`: daily output plus aligned hourly temperature, condition, precipitation, and wind periods.

`forecastDays` selects 1–8 daily entries and `maxHourlyItems` limits hourly entries per location. Current-temperature and condition filters, four sort modes, exact `maxItems`, bounded concurrency/retries/timeouts, direct access, Apify Residential proxies, and custom HTTP proxy URLs are supported. Direct access is the default. `GOOGLE_SERP` is rejected because it is not compatible with Yahoo HTTPS pages.

### Output

Each dataset row represents one Yahoo Weather location. Stable location identity, geographic coordinates, typed current temperature, RealFeel, today's high/low, condition, sunrise/sunset, humidity, air quality, UV, allergens, pressure, visibility, moon phase, daily summaries, and hourly periods are included when published by Yahoo. Optional source fields are omitted when unavailable; the Actor never writes `null`, empty-string, challenge-page, or fabricated placeholder values.

Daily labels are stored exactly as Yahoo publishes them (`Today`, `Tomorrow`, `Tue 1`, and similar) with a numeric `dayOffset`. The page does not publish an unambiguous time zone in this payload, so the Actor does not fabricate ISO dates from those labels.

### Reliability and access

The Actor validates HTTP status, HTML content type, final host, response size, structured payload shape, location identity, and required forecast fields before normalization. Certificate verification stays enabled; intercepting proxies that require disabling verification are rejected. It uses sessions and bounded retries for ordinary temporary failures. HTTP 401, 403, 407, or 429, or a detected CAPTCHA, verification, access-denied, or rate-limit page, stops remaining queued requests without access-gate retries or session rotation. Responses already in flight are discarded after a gate. An unexpected redirect or changed payload also fails closed, and no partial dataset is written. Proxies are for ordinary authorized access resilience, not for bypassing authentication, CAPTCHAs, subscriptions, or other access controls.

### Example

```json
{
  "locations": ["Nashville, TN, US", "Sacramento, CA, US", "New York, NY, US", "London, England, GB"],
  "detailLevel": "full",
  "forecastDays": 8,
  "maxHourlyItems": 48,
  "maxItems": 4,
  "maxConcurrency": 8,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

# Actor input Schema

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

Enter each location as Town, REGION, COUNTRY (for example Nashville, TN, US). Existing Yahoo paths such as us/tn/nashville remain supported.

## `detailLevel` (type: `string`):

Current returns current conditions only; daily adds daily summaries; full also adds aligned hourly temperature, precipitation, and wind periods.

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

Number of Yahoo daily forecasts to include per location.

## `maxHourlyItems` (type: `integer`):

Maximum aligned hourly periods stored for each location in full mode.

## `minTemperature` (type: `number`):

Keep locations at or above this value in Yahoo's source temperature unit.

## `maxTemperature` (type: `number`):

Keep locations at or below this value in Yahoo's source temperature unit.

## `conditionIncludes` (type: `string`):

Case-insensitive current-condition filter, for example Sunny or Rain.

## `sortBy` (type: `string`):

Order final matching location records.

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

Maximum final location records after filters and sorting.

## `maxConcurrency` (type: `integer`):

Maximum concurrent Yahoo Weather HTTP requests.

## `maxRequestRetries` (type: `integer`):

Bounded retries for temporary transport and target failures.

## `requestTimeoutSecs` (type: `integer`):

Maximum time allowed for each Yahoo Weather response.

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

Direct access is the default. Apify Residential and custom HTTP proxy URLs are supported; GOOGLE_SERP is not compatible with Yahoo HTTPS pages.

## Actor input object example

```json
{
  "locations": [
    "Nashville, TN, US",
    "Sacramento, CA, US",
    "New York, NY, US",
    "London, England, GB"
  ],
  "detailLevel": "full",
  "forecastDays": 8,
  "maxHourlyItems": 48,
  "sortBy": "input",
  "maxItems": 10,
  "maxConcurrency": 1,
  "maxRequestRetries": 2,
  "requestTimeoutSecs": 45,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `datasetConsole` (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 = {
    "locations": [
        "Nashville, TN, US",
        "Sacramento, CA, US",
        "New York, NY, US",
        "London, England, GB"
    ],
    "maxConcurrency": 1,
    "maxRequestRetries": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/yahoo-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 = {
    "locations": [
        "Nashville, TN, US",
        "Sacramento, CA, US",
        "New York, NY, US",
        "London, England, GB",
    ],
    "maxConcurrency": 1,
    "maxRequestRetries": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/yahoo-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 '{
  "locations": [
    "Nashville, TN, US",
    "Sacramento, CA, US",
    "New York, NY, US",
    "London, England, GB"
  ],
  "maxConcurrency": 1,
  "maxRequestRetries": 0
}' |
apify call searchapi/yahoo-weather-scraper --silent --output-dataset

```

## MCP server setup

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