# Open-Meteo Weather Scraper (`crawlergang/open-meteo-scraper`) Actor

Scrape Open-Meteo, free open-source weather API with global forecasts, historical weather, air quality, marine conditions, and climate data. No API key required.

- **URL**: https://apify.com/crawlergang/open-meteo-scraper.md
- **Developed by:** [Crawler Gang](https://apify.com/crawlergang) (community)
- **Categories:** Developer tools, Other, Automation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 11 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Open-Meteo Weather Scraper

Extract weather data from **Open-Meteo** — a free, open-source weather API with global coverage. Get weather forecasts up to 16 days ahead, historical weather going back to 1940, air quality data, marine conditions, and city geocoding. No API key required.

### What you can scrape

- **Weather forecasts** — up to 16 days of daily and hourly weather for any location worldwide
- **Historical weather** — past weather data for any date range since 1940
- **Air quality** — PM2.5, PM10, CO, NO2, ozone levels and European AQI index
- **Marine conditions** — wave heights, wave periods, swell data for coastal/ocean locations
- **Geocoding** — find latitude/longitude coordinates for any city worldwide

### Input

| Field | Type | Description |
|---|---|---|
| `mode` | select | What to fetch (see modes below) |
| `location` | string | City name for automatic geocoding (e.g. `Berlin`, `New York`) |
| `latitude` | number | Geographic latitude (-90 to 90), overrides location |
| `longitude` | number | Geographic longitude (-180 to 180), overrides location |
| `timezone` | select | Timezone for results (default: `auto`) |
| `forecastDays` | integer | Days to forecast, 1–16 (default: 7) |
| `startDate` | string | Historical start date YYYY-MM-DD |
| `endDate` | string | Historical end date YYYY-MM-DD |
| `hourlyVars` | array | Hourly variables to include |
| `dailyVars` | array | Daily summary variables to include |
| `cityName` | string | City to search in geocode mode |
| `country` | string | Country filter for geocode mode |
| `maxItems` | integer | Maximum records to return (1–10000) |

#### Modes

- **`forecast`** — Daily weather forecast for 1–16 days at any location
- **`historical`** — Past weather from 1940 onward for any date range
- **`airQuality`** — Air pollution data including PM2.5, PM10, NO2, ozone
- **`marine`** — Ocean wave data for coastal and offshore locations
- **`geocode`** — Translate city names to geographic coordinates

### Output

#### Forecast / Historical daily record

```json
{
  "recordType": "forecast",
  "dataGranularity": "daily",
  "date": "2026-05-25",
  "location": "Berlin, Germany",
  "latitude": 52.52,
  "longitude": 13.41,
  "timezone": "Europe/Berlin",
  "elevationMeters": 38.0,
  "temperatureMax": 22.5,
  "temperatureMin": 12.1,
  "temperatureUnit": "°C",
  "precipitation": 1.2,
  "weathercode": 2,
  "weatherDescription": "Partly cloudy",
  "windspeedMax": 18.3,
  "uvIndexMax": 5.2,
  "sunrise": "2026-05-25T05:02",
  "sunset": "2026-05-25T21:08",
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
```

#### Air quality record

```json
{
  "recordType": "airQuality",
  "time": "2026-05-25T00:00",
  "location": "Berlin, Germany",
  "latitude": 52.52,
  "longitude": 13.41,
  "pm25": 8.3,
  "pm10": 14.2,
  "co": 215.5,
  "no2": 12.1,
  "ozone": 62.8,
  "europeanAqiIndex": 28,
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
```

#### Marine record

```json
{
  "recordType": "marine",
  "date": "2026-05-25",
  "location": "North Sea",
  "latitude": 54.0,
  "longitude": 5.0,
  "waveHeightMax": 2.1,
  "waveDirectionDominant": 285.0,
  "wavePeriodMax": 8.5,
  "swellWaveHeightMax": 1.8,
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
```

#### Geocode record

```json
{
  "recordType": "geocode",
  "name": "Berlin",
  "country": "Germany",
  "countryCode": "DE",
  "latitude": 52.52437,
  "longitude": 13.41053,
  "elevation": 74.0,
  "timezone": "Europe/Berlin",
  "population": 3426354,
  "scrapedAt": "2026-05-25T12:00:00+00:00"
}
```

### Weather codes (WMO standard)

| Code | Description |
|---|---|
| 0 | Clear sky |
| 1–3 | Mainly clear / Partly cloudy / Overcast |
| 45–48 | Foggy |
| 51–55 | Drizzle (light to dense) |
| 61–67 | Rain (slight to freezing) |
| 71–77 | Snow |
| 80–82 | Rain showers |
| 85–86 | Snow showers |
| 95 | Thunderstorm |
| 96–99 | Thunderstorm with hail |

### Example use cases

- **Travel planning** — Get forecasts for upcoming trips to any city worldwide
- **Agriculture** — Historical precipitation and temperature trends for farming decisions
- **Environmental monitoring** — Track air quality trends for health and compliance
- **Shipping and logistics** — Wave and marine conditions for coastal routes
- **Research** — Long historical climate datasets going back to 1940

### FAQs

**Is an API key required?**
No. Open-Meteo is free for non-commercial use with no registration required.

**How far back does historical data go?**
Historical data is available from 1940 onward for most locations.

**How accurate is the forecast?**
Open-Meteo uses multiple global weather models (ECMWF, GFS, etc.) and is highly accurate, especially for the first 7 days.

**Can I get hourly data?**
Yes — set `hourlyVars` to include variables like `temperature_2m`, `windspeed_10m`, etc.

**Why is marine data not available for my location?**
Marine data requires coordinates in or near ocean/coastal areas. Inland coordinates will return an error.

**What timezones are supported?**
Any IANA timezone string (e.g. `Europe/Berlin`, `America/New_York`). Use `auto` to detect from coordinates automatically.

# Actor input Schema

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

What weather data to fetch.

## `location` (type: `string`):

City name to look up automatically (e.g. 'Berlin', 'New York', 'Tokyo'). If provided, geocoding is performed automatically. Ignored if latitude/longitude are set.

## `latitude` (type: `number`):

Geographic latitude (-90 to 90). Overrides location field if provided.

## `longitude` (type: `number`):

Geographic longitude (-180 to 180). Overrides location field if provided.

## `timezone` (type: `string`):

Timezone for returned data. Use 'auto' to detect automatically from coordinates.

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

Number of days to forecast (1–16). Defaults to 7.

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

Start date for historical data in YYYY-MM-DD format (e.g. '2023-01-01'). Required for historical mode.

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

End date for historical data in YYYY-MM-DD format (e.g. '2023-12-31'). Required for historical mode.

## `hourlyVars` (type: `array`):

Hourly weather variables to include (forecast and historical modes).

## `dailyVars` (type: `array`):

Daily weather summary variables to include.

## `cityName` (type: `string`):

City name to search for coordinates. Required for geocode mode.

## `country` (type: `string`):

Optional country to narrow geocode search (e.g. 'US', 'Germany').

## `climateModel` (type: `string`):

Climate model for projections. EC\_Earth3P\_HR is high-resolution. Use startDate/endDate to limit the range (default: 1990–2050).

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

Maximum number of records to return.

## Actor input object example

```json
{
  "mode": "forecast",
  "location": "Berlin",
  "timezone": "auto",
  "forecastDays": 7,
  "climateModel": "EC_Earth3P_HR",
  "maxItems": 100
}
```

# Actor output Schema

## `weatherData` (type: `string`):

Dataset containing all scraped 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 = {
    "mode": "forecast",
    "location": "Berlin",
    "timezone": "auto",
    "forecastDays": 7,
    "climateModel": "EC_Earth3P_HR",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlergang/open-meteo-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 = {
    "mode": "forecast",
    "location": "Berlin",
    "timezone": "auto",
    "forecastDays": 7,
    "climateModel": "EC_Earth3P_HR",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlergang/open-meteo-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 '{
  "mode": "forecast",
  "location": "Berlin",
  "timezone": "auto",
  "forecastDays": 7,
  "climateModel": "EC_Earth3P_HR",
  "maxItems": 100
}' |
apify call crawlergang/open-meteo-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/HTZnvo1cXlrvPKxGm/builds/vk1VlRN4wlf9n836w/openapi.json
