# Weather Scraper - Forecast, History & Air Quality (`goat255/weather-scraper`) Actor

Give it place names or coordinates and get current conditions, a daily forecast up to 16 days, historical daily records going back years, optional hourly detail and air quality. One row per location per period.

- **URL**: https://apify.com/goat255/weather-scraper.md
- **Developed by:** [Goutam Soni](https://apify.com/goat255) (community)
- **Categories:** Automation, Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 record 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 Scraper

Give it place names or coordinates and get current conditions, a daily forecast, historical records and air quality. One row per location per period. No login and no API key.

### What it does

- **Place names work directly** - enter Singapore or London and the location is matched to a point for you. Exact coordinates are accepted too.
- **Current conditions** - temperature, what it feels like, humidity, wind, gusts, cloud cover, pressure and whether it is day or night.
- **Daily forecast up to 16 days** - high and low, precipitation total and chance, wind, UV index, sunrise and sunset.
- **Historical records going back years**, in the same shape as the forecast, so you can join them.
- **Hourly detail** on request, for both forecast and history.
- **Air quality** on request - AQI plus the individual pollutant levels.
- **Plain English conditions** on every row, not just a numeric code, plus wind direction as a compass point.
- **Metric or imperial**, your choice.

Common uses: building a weather history for a location, demand and sales forecasting, travel and logistics planning, agriculture, energy modelling, and adding weather to any dataset that has a place in it.

### Input

| Field | Type | Description |
|---|---|---|
| `locations` | array | Place names to look up. |
| `coordinates` | array | Exact points as `latitude,longitude`. |
| `mode` | string | `forecast`, `historical` or `both`. |
| `forecastDays` | integer | Days ahead, up to 16. Default 7. |
| `startDate` / `endDate` | string | Historical range, `YYYY-MM-DD`. |
| `includeHourly` | boolean | Add one row per hour. Multiplies rows by 24. |
| `includeAirQuality` | boolean | Add a current air quality row per location. |
| `units` | string | `metric` or `imperial`. |
| `proxyConfiguration` | object | Optional. Enable to spread requests across IPs. |

#### Example input

```json
{
  "locations": ["Singapore", "London"],
  "mode": "both",
  "forecastDays": 14,
  "startDate": "2026-06-01",
  "endDate": "2026-06-30",
  "includeAirQuality": true,
  "units": "metric"
}
```

### Output

Rows start with the location and a `type`, so the four shapes are easy to split.

A forecast or historical day:

```json
{
  "location": "Example City, Example Region, Example Country",
  "latitude": 1.28967,
  "longitude": 103.85007,
  "country": "Example Country",
  "region": "Example Region",
  "timezone": "Asia/Singapore",
  "type": "forecast",
  "date": "2026-07-20",
  "weatherCode": 61,
  "conditions": "Slight rain",
  "temperatureMax": 32.1,
  "temperatureMin": 26.4,
  "feelsLikeMax": 38.0,
  "feelsLikeMin": 29.2,
  "precipitationSum": 12.4,
  "rainSum": 12.4,
  "snowfallSum": 0.0,
  "precipitationHours": 5.0,
  "precipitationChance": 68.0,
  "windSpeedMax": 14.8,
  "windGustsMax": 32.4,
  "windDirection": 210.0,
  "windCompass": "SSW",
  "uvIndexMax": 7.35,
  "sunrise": "2026-07-20T07:05",
  "sunset": "2026-07-20T19:12"
}
```

Current conditions use `type: "current"`, hourly rows use `type: "hourly"`, and air quality uses `type: "air_quality"` with `europeanAqi`, `usAqi`, `pm10`, `pm25` and the other pollutants.

### Notes

- No login and no API key. Enter a place and run.
- Every date and time is in the location's own timezone, which is returned on the row so there is no guessing.
- The last day of a long forecast can be partial, because the forecast model's horizon runs out. Those rows still carry the date and whatever the model does provide.
- Historical records are published with a short delay, so the most recent day or two may not be available yet.
- Locations that cannot be matched to a place are reported and skipped rather than returned as empty rows.

To improve our actors we collect anonymized usage telemetry (run stats and input patterns). No personal account data is collected.

# Actor input Schema

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

Place names to look up, for example Singapore or London. Each is matched to a point automatically.

## `coordinates` (type: `array`):

Exact points as latitude,longitude. Use this when you have coordinates rather than a place name.

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

Forecast ahead, historical records, or both.

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

How many days ahead to return, up to 16.

## `startDate` (type: `string`):

First day of historical records, format YYYY-MM-DD. Defaults to 30 days back.

## `endDate` (type: `string`):

Last day of historical records, format YYYY-MM-DD. Defaults to yesterday.

## `includeHourly` (type: `boolean`):

Add one row per hour as well as per day. This multiplies the number of rows by 24.

## `includeAirQuality` (type: `boolean`):

Add a current air quality row per location with AQI and pollutant levels.

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

Metric uses Celsius, km/h and millimetres. Imperial uses Fahrenheit, mph and inches.

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

Optional. Enable to spread requests across IP addresses.

## Actor input object example

```json
{
  "locations": [
    "Singapore",
    "London"
  ],
  "coordinates": [
    "1.29,103.85"
  ],
  "mode": "forecast",
  "forecastDays": 7,
  "startDate": "2026-06-01",
  "endDate": "2026-06-30",
  "includeHourly": false,
  "includeAirQuality": false,
  "units": "metric"
}
```

# Actor output Schema

## `records` (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": [
        "Singapore"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("goat255/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": ["Singapore"] }

# Run the Actor and wait for it to finish
run = client.actor("goat255/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": [
    "Singapore"
  ]
}' |
apify call goat255/weather-scraper --silent --output-dataset

```

## MCP server setup

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