# Weather API - Meteomatics Forecast, Historical and Station Data (`nabeelbaghoor/weather-forecast-historical-data-api`) Actor

Weather forecast and historical weather data from the Meteomatics Weather API: 1,800+ parameters such as temperature, precipitation, wind, solar radiation and snow, at 90 m resolution from ECMWF, GFS, ERA5 and more, plus weather station observations and MOS forecasts. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/weather-forecast-historical-data-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 weather time series row returneds

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

## Weather API - Meteomatics Forecast, Historical and Station Data

Pull weather forecasts, historical weather and weather station data from the Meteomatics Weather API with your own credentials, and get any of its 1,800+ parameters (temperature, precipitation, wind, solar radiation, snow, humidity, pressure and more) as clean rows, one per location and time.

Works with the official Meteomatics REST API on api.meteomatics.com. The actor turns coordinates, postal codes or station ids plus a time range into deduplicated rows with every requested parameter as its own column, which you can download as JSON, CSV or Excel, schedule, or feed into energy forecasting, agriculture, logistics, insurance, event planning, Google Sheets and AI agents. Bring your own API key: a Meteomatics API username and password.

BYOK, not live-tested: every path, notation, source and option comes from the public Meteomatics API documentation on meteomatics.com, and the API host was confirmed to answer with its own authentication messages, but the actor has not been run against a live Meteomatics account.

### What it does

- **Weather forecast and history for points**: any Meteomatics parameter for latitude,longitude points or postal codes, from historical data back to 1940 (ECMWF ERA5) to forecasts days, weeks and months ahead, in steps from 5 minutes to 1 day.
- **Pick the model**: the Meteomatics Mix (default, up to 90 m resolution), ECMWF IFS, ECMWF ENS ensemble, AI models (ECMWF AIFS, GraphCast, FourCastNet), NCEP GFS and HRRR, UK Met Office, DWD ICON, CMC GEM, the 1 km EURO1k and US1k models, ERA5 reanalysis, CAMS air quality, WAM ocean waves, radar and satellite.
- **Weather station observations**: measured values from WMO, METAR, AMDA, C-MAN and MeteoSwiss stations and buoys (source mix-obs), with gaps flagged.
- **Weather station MOS forecasts**: statistically corrected station forecasts up to 15 days ahead (source mm-mos).
- **Find weather stations**: stations near a point, inside a bounding box or in a country, filtered by measured parameters, elevation and recording period, with the wmo\_ id to use in the station modes.
- **Ensemble and calibration options**: ensemble members, mean, median, spread and quantiles; station calibration; land or sea mask.
- **Reserved values explained**: -999, -888, -777 and -666 are kept as returned and explained in a reservedValues column.
- **Pay only for results**: refused and empty lookups are recorded as a free row that says why, never charged.

### How to get your Meteomatics API credentials

Meteomatics issues a Weather API username and password, sent by email, rather than a single key. Sign up for the free Basic account (non-commercial use, 500 queries a day, 15 basic parameters, forecasts up to 10 days and the last 24 hours), request a 14 day trial, or talk to Meteomatics about a business licence on meteomatics.com. Paste the API username into the API username field and the password into the API password field, or set the DATA_API_KEY secret to username:password. The credentials are sent only in the HTTP Basic Authorization header to api.meteomatics.com and are never logged.

### Input

| Field | Modes | Description |
| --- | --- | --- |
| `mode` | all | `forecastHistory`, `stationObservations`, `stationForecast` or `findStations` |
| `locations` | time series modes | latitude,longitude or postal_CH9014; station ids such as wmo_066810 or metar_LSZH in station modes |
| `parameters` | all | Parameters with units, such as t_2m:C, precip_1h:mm, wind_speed_10m:ms |
| `startDate`, `endDate` | time series modes | ISO 8601 UTC times or shortcuts such as now, now+48H, todayT00Z |
| `interval` | time series modes | PT5M to P1D, default PT1H |
| `validDateTime` | time series modes | Advanced: the raw Meteomatics time notation |
| `source` | forecast and history | Model or source, default mix |
| `ensembleSelect` | forecast and history | member:1-50, mean, median, spread, quantile0.9 |
| `calibrated`, `mask` | forecast and history | Station calibration; land or sea mask |
| `onInvalid` | station modes | Fill gaps with -999 (default) or refuse the lookup |
| `stationSearchArea` | find stations | Point, bounding box or country shortcut |
| `stationElevation`, `stationsSince`, `stationsUntil`, `stationNetwork` | find stations | Elevation, recording period, observation or MOS stations |
| `maxResults` | all | Row ceiling for the run (default 200) |
| `requestsPerMinute` | all | Pacing, default 30 |
| `apiKey`, `apiSecret` | all | Your Meteomatics API username and password |

Example: an hourly 2 day forecast for Berlin and New York.

```json
{
    "mode": "forecastHistory",
    "locations": ["52.5200,13.4050", "40.7128,-74.0060"],
    "parameters": ["t_2m:C", "precip_1h:mm", "wind_speed_10m:ms", "relative_humidity_2m:p"],
    "startDate": "now",
    "endDate": "now+48H",
    "interval": "PT1H"
}
```

Example: daily historical temperature for 2020 from ERA5.

```json
{
    "mode": "forecastHistory",
    "locations": ["47.4245,9.3767"],
    "parameters": ["t_max_2m_24h:C", "t_min_2m_24h:C", "precip_24h:mm"],
    "startDate": "2020-01-01",
    "endDate": "2020-12-31",
    "interval": "P1D",
    "source": "ecmwf-era5",
    "maxResults": 400
}
```

### Example output

An illustrative row, shaped like the documented Meteomatics JSON response (values are an example, not real data).

```json
{
    "mode": "forecastHistory",
    "modeLabel": "Weather forecast and history for points",
    "recordType": "weather",
    "identifier": "52.5200,13.4050",
    "found": true,
    "location": "52.52,13.405",
    "latitude": 52.52,
    "longitude": 13.405,
    "stationId": null,
    "validDate": "2026-10-20T12:00:00Z",
    "source": "mix",
    "dateGenerated": "2026-10-20T09:01:10Z",
    "reservedValues": null,
    "parameterCount": 4,
    "values": { "t_2m:C": 14.2, "precip_1h:mm": 0.1, "wind_speed_10m:ms": 4.3, "relative_humidity_2m:p": 71.5 },
    "t_2m:C": 14.2,
    "precip_1h:mm": 0.1,
    "wind_speed_10m:ms": 4.3,
    "relative_humidity_2m:p": 71.5,
    "retrievedAt": "2026-10-20T09:01:12.000Z",
    "note": null
}
```

### FAQ

#### What is the Meteomatics Weather API?

Meteomatics is a Swiss weather technology company. Its Weather API on api.meteomatics.com serves forecast, historical and climate weather data from more than 110 models and sources, downscaled to 90 m, for any point on Earth, with more than 1,800 parameters. Requests are written as time, parameters, location and format in the URL.

#### Do I need my own Meteomatics account?

Yes. This is a bring-your-own-key actor: it calls Meteomatics with your API username and password, under your Meteomatics licence and terms. Missing, rejected or exhausted credentials end the run cleanly with a status message that explains what to change, and nothing is charged.

#### Which weather parameters can I get?

Any parameter your licence covers, written as name and unit: t_2m:C or t_2m:F for temperature, precip_1h:mm for rain, wind_speed_10m:ms and wind_gusts_10m_1h:ms for wind, global_rad:W for solar radiation, fresh_snow_24h:cm for snow, msl_pressure:hPa, relative_humidity_2m:p, uv:idx, weather_symbol_1h:idx and many more listed on the Meteomatics Available Parameters pages. The free Basic account covers 15 basic parameters.

#### How far back does historical weather data go?

ECMWF ERA5 reanalysis covers 1940 to the present in hourly steps, and the Meteomatics Mix covers recent history and forecasts. The free Basic account reads only the last 24 hours of history.

#### How far ahead do forecasts go?

The Mix and ECMWF IFS reach about 15 days, VAREPS 46 days and the ECMWF seasonal forecast 7 months. The 1 km EURO1k and US1k models reach 72 and 48 hours. The free Basic account reads up to 10 days ahead.

#### How do I get weather station data?

Use Find weather stations with a point, box or country to list stations and their wmo\_ ids, then Weather station observations or Weather station MOS forecasts with those ids (or with coordinates, which pick the nearest station).

#### What do I pay?

Pay per result: 0.005 USD per weather row (one location at one valid time with all requested parameters) and 0.005 USD per weather station. Refused and empty lookups are never charged. Your Meteomatics licence is billed separately by Meteomatics. Each request counts as one query on your plan; up to 10 locations and 10 parameters go in one request.

#### What happens if my credentials are wrong or my limit runs out?

A 401 ("Wrong username or password provided") or 402 ends the run cleanly with the API's own words. A 403 means the parameter, model or area is not on your licence and also ends the run cleanly. A 429 ("limits of license reached") is waited out a few times, then the run ends cleanly. A time, parameter or place the API refuses or does not cover becomes a free row with its message, and the run moves on.

### Pricing

| Event | Price | Charged for |
| --- | --- | --- |
| `weather-record` | 0.005 USD | Each location and valid time row |
| `station-record` | 0.005 USD | Each weather station |

### Keyword map

weather API, weather forecast API, historical weather data, Meteomatics API, ERA5 historical weather, ECMWF forecast data, GFS forecast, hourly weather forecast, temperature data, precipitation data, wind data, solar radiation data, snow forecast, weather station data, METAR observations, MOS forecast, ensemble forecast, weather data for energy, agriculture weather data, weather time series.

### Terms and data use

Meteomatics data is licensed under the Meteomatics General Terms and Conditions (meteomatics.com/files/Terms-Conditions). The licence is non-exclusive and limited to the term, territory and purpose of your contract. It does not allow transferring the licence or the data to third parties, or editing or publishing the data in whole or in part, unless agreed in writing. The Meteomatics AG terms also exclude archiving data for more than six months after delivery unless you are legally required to. The free Basic account is for non-commercial use only. Run this actor with your own credentials, keep the results for your own internal use, delete datasets you no longer need within that period, and contact Meteomatics before republishing or reselling the data. This actor is not affiliated with or endorsed by Meteomatics.

# Actor input Schema

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

Weather forecast and history reads any of the 1,800+ Meteomatics parameters for coordinates or postal codes from the source you pick, from 1940 to weeks ahead. Station observations reads measured values from weather stations (source mix-obs). Station MOS forecasts reads statistically corrected forecasts for stations (source mm-mos). Find weather stations lists stations near a point, in a box or in a country, with the ids to use in the station modes.

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

Time series modes. One per line. Weather forecast and history: latitude,longitude in decimal degrees (52.52,13.405) or a postal code written postal\_<country><zip> (postal_CH9014, postal_US10001). Station modes: a station id (wmo_066810, metar_LSZH, amda_P100, cman_mrka2, mch_LUG) or latitude,longitude for the nearest station. Up to 10 locations go in one request.

## `parameters` (type: `array`):

Meteomatics parameters with their unit, one per line, such as t_2m:C (temperature 2 m above ground in Celsius), t_2m:F, precip_24h:mm, wind_speed_10m:kmh, wind_dir_10m:d, msl_pressure:hPa, global_rad:W, uv:idx, weather_symbol_1h:idx, fresh_snow_24h:cm or sunrise:sql. See the Available Parameters list on meteomatics.com. Empty reads temperature, precipitation, wind speed and humidity. Find weather stations: only stations measuring these.

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

Time series modes. ISO 8601 UTC time such as 2026-10-20T06:00Z or a date such as 2020-01-01, or a shortcut: now, now-6H, todayT00Z, yesterdayT12Z, tomorrow. Empty means now.

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

Time series modes. Same notation, such as 2026-10-22T00:00Z or now+48H. Empty reads the start time only.

## `interval` (type: `string`):

Time series modes. Spacing between the start and end time. Accumulated parameters such as precip_1h:mm cover the period before each step.

## `validDateTime` (type: `string`):

Time series modes. Overrides start, end and step with the full Meteomatics notation, such as 2026-10-20T00Z--2026-10-27T00Z:P1D, 2026-10-20T00ZP2D:PT6H or a comma separated list of times.

## `source` (type: `string`):

Weather forecast and history only. The default Meteomatics Mix blends radar, satellite, stations and models at up to 90 m resolution. Pick ECMWF ERA5 for long historical series, or a single model to compare forecasts. Your licence decides which sources you can read.

## `ensembleSelect` (type: `string`):

Ensemble sources only (ECMWF ENS, AIFS ENS, GEFS, VAREPS, seasonal). member:1, member:1-50, mean, median, spread or a quantile such as quantile0.9, comma separated. Empty returns the control run.

## `calibrated` (type: `boolean`):

Weather forecast and history only. Calibrates historical data and the first 6 hours of forecast with nearby station measurements.

## `mask` (type: `string`):

Weather forecast and history only. Return values only over land or only over sea.

## `onInvalid` (type: `string`):

Station modes only. How gaps in station records are handled. Filled gaps are flagged in the reservedValues column.

## `stationSearchArea` (type: `string`):

Find weather stations only. latitude,longitude for the nearest stations (47.3,9.3), a bounding box written max_lat,min_lon_min_lat,max_lon (47.9,5.8_45.8,10.5), or a country shortcut such as germany or switzerland.

## `stationElevation` (type: `integer`):

Find weather stations only. Prefer stations near this height above sea level; the offset is in the verticalDistanceM column.

## `stationsSince` (type: `string`):

Find weather stations only. Only stations recording at least since this date, such as 2018-01-01.

## `stationsUntil` (type: `string`):

Find weather stations only. Only stations recording at least until this date, such as 2026-10-01.

## `stationNetwork` (type: `string`):

Find weather stations only. Stations with measured observations, or stations with MOS forecasts.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for. One row is one location at one valid time, or one station.

## `requestsPerMinute` (type: `integer`):

Pacing. The free Basic account allows 50 queries a minute and 500 a day; a limit answer is waited out a few times before the run ends cleanly.

## `apiKey` (type: `string`):

Your own Meteomatics Weather API username, from the email Meteomatics sent when your account was set up (not your website login). Stored as a secret and sent only in the HTTP Basic Authorization header to api.meteomatics.com. You can instead set the DATA_API_KEY environment secret to username:password.

## `apiSecret` (type: `string`):

Your own Meteomatics Weather API password. Stored as a secret, sent only in the Authorization header and never logged. You can instead set the DATA_API_SECRET environment secret.

## Actor input object example

```json
{
  "mode": "forecastHistory",
  "locations": [
    "52.5200,13.4050",
    "40.7128,-74.0060"
  ],
  "parameters": [
    "t_2m:C",
    "precip_1h:mm",
    "wind_speed_10m:ms",
    "relative_humidity_2m:p"
  ],
  "startDate": "now",
  "endDate": "now+24H",
  "interval": "PT1H",
  "source": "mix",
  "calibrated": false,
  "mask": "none",
  "onInvalid": "fill_with_invalid",
  "stationNetwork": "observations",
  "maxResults": 200,
  "requestsPerMinute": 30
}
```

# Actor output Schema

## `records` (type: `string`):

One row per location and valid time, or one row per weather station.

# 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": [
        "52.5200,13.4050",
        "40.7128,-74.0060"
    ],
    "parameters": [
        "t_2m:C",
        "precip_1h:mm",
        "wind_speed_10m:ms",
        "relative_humidity_2m:p"
    ],
    "startDate": "now",
    "endDate": "now+24H"
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/weather-forecast-historical-data-api").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": [
        "52.5200,13.4050",
        "40.7128,-74.0060",
    ],
    "parameters": [
        "t_2m:C",
        "precip_1h:mm",
        "wind_speed_10m:ms",
        "relative_humidity_2m:p",
    ],
    "startDate": "now",
    "endDate": "now+24H",
}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/weather-forecast-historical-data-api").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": [
    "52.5200,13.4050",
    "40.7128,-74.0060"
  ],
  "parameters": [
    "t_2m:C",
    "precip_1h:mm",
    "wind_speed_10m:ms",
    "relative_humidity_2m:p"
  ],
  "startDate": "now",
  "endDate": "now+24H"
}' |
apify call nabeelbaghoor/weather-forecast-historical-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/weather-forecast-historical-data-api"
        }
    }
}
```

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/IZVaK73O8PiMpxMwP/builds/HbiMbTU2vpMg2NNMW/openapi.json
