# Weather Forecast Scraper (`sweet_rebel/weather-forecast-scraper`) Actor

- **URL**: https://apify.com/sweet\_rebel/weather-forecast-scraper.md
- **Developed by:** [Rajat Sharda](https://apify.com/sweet_rebel) (community)
- **Categories:** News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 forecast day scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Weather Forecast Scraper & Open-Meteo API Tool

A lightweight, single-purpose tool for AI agents and weather monitoring systems: given latitude/longitude coordinates, returns a clean, structured daily weather forecast with temperature ranges, precipitation, wind speed, and WMO weather codes. Built for AI agent toolboxes — small JSON in, small JSON out.

### Features

- **Zero API Keys Required**: Uses the free, open Open-Meteo API — no auth setup needed.
- **Global Coverage**: Works for any location worldwide via latitude/longitude.
- **WMO Weather Descriptions**: Converts raw weather codes into human-readable descriptions (e.g. "Clear sky", "Heavy rain", "Thunderstorm").
- **Agent-Friendly Output**: Micro-structured JSON designed to fit comfortably inside LLM context windows.
- **Pay-Per-Event (PPE) Pricing**: Charged per forecast day returned.

### Input Parameters

| Field | Type | Required | Default | Description |
| :--- | :--- | :--- | :--- | :--- |
| `latitude` | Number | No | `40.7128` (NYC) | Latitude of the target location (-90 to 90). |
| `longitude` | Number | No | `-74.0060` (NYC) | Longitude of the target location (-180 to 180). |
| `max_items` | Integer | No | `5` | Number of forecast days to return (max 16). |

#### Example Input

```json
{
  "latitude": 48.8566,
  "longitude": 2.3522,
  "max_items": 3
}
```

### Output Schema

| Field | Type | Description |
| :--- | :--- | :--- |
| `date` | String | Date of the forecast (YYYY-MM-DD). |
| `weather_code` | Integer | WMO weather code. |
| `weather_description` | String | Human-readable weather description. |
| `temperature_max_c` | Number | Maximum temperature in Celsius. |
| `temperature_min_c` | Number | Minimum temperature in Celsius. |
| `precipitation_mm` | Number | Total precipitation in millimeters. |
| `wind_speed_max_kmh` | Number | Maximum wind speed in km/h. |

#### Example Output

```json
{
  "date": "2026-07-08",
  "weather_code": 0,
  "weather_description": "Clear sky",
  "temperature_max_c": 28.5,
  "temperature_min_c": 19.2,
  "precipitation_mm": 0.0,
  "wind_speed_max_kmh": 12.3
}
```

### Pricing Configuration

This Actor utilizes Apify's **Pay-Per-Event (PPE)** monetization model.

- **Primary Event**: `forecast-day-scraped`
- **Cost**: **$0.002** per forecast day returned.

## Actor input object example

```json
{}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("sweet_rebel/weather-forecast-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("sweet_rebel/weather-forecast-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call sweet_rebel/weather-forecast-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=sweet_rebel/weather-forecast-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/En9arbTH2awiBZxgG/builds/DeNPVuGssKcNBEqCM/openapi.json
