# SHMÚ Weather Forecast for Slovakia (ALADIN) (`damikun/shmu-weather-forecast`) Actor

Will it rain? Get rain, snow, temperature and wind for today and the next 2 days for any Slovak town, village or GPS point, from the official SHMÚ ALADIN weather model.

- **URL**: https://apify.com/damikun/shmu-weather-forecast.md
- **Developed by:** [Dalo Kundrat](https://apify.com/damikun) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## SHMÚ Weather Forecast for Slovakia (ALADIN)

**Will it rain at your place today, tomorrow or the day after?** This Actor reads the official forecast of the Slovak Hydrometeorological Institute (SHMÚ) from its high-resolution **ALADIN** model and returns one simple row per day: rain yes/no, how many millimetres, at what time, plus temperature, wind gusts and clouds.

Use it for a cottage, a hike, a garden, an event, or as a daily weather feed for your own automation (Make, Zapier, n8n, a webhook).

### What you get

- ☔ **Rain yes/no** for each day, using a threshold you choose
- 🕒 **When it rains**, for example `14:00–17:00`, in Slovak time
- ❄️ **Snow or rain**: total precipitation, how much of it is snow, and the type (`rain`, `snow`, `mixed`)
- 🌡️ Min/max temperature, strongest wind gusts (km/h) and average cloud cover
- ⏱️ Optional **hour-by-hour** forecast
- 📍 About **1,000 places in Slovakia**. Use a town name, an SHMÚ ID, or GPS coordinates; the nearest SHMÚ forecast point is picked automatically.

### Input

| Field | Description | Default |
|---|---|---|
| `locations` | Towns or villages (`Prešov`, `presov`), GPS coordinates (`49.05, 21.30`), or SHMÚ IDs (`31379`) | `["Prešov"]` |
| `days` | 1–3: today, tomorrow, the day after | `3` |
| `rainThresholdMm` | A day counts as rainy when its total rain and snow is at least this many mm | `0.5` |
| `includeHourly` | Add an `hourly` list to each day | `false` |
| `proxyConfiguration` | shmu.sk closes connections from cloud servers, so Apify Proxy is on by default (the datacenter proxy is enough) | Apify Proxy |

```json
{
    "locations": ["Prešov", "49.05, 21.30", "Štrbské Pleso"],
    "days": 3,
    "rainThresholdMm": 0.5
}
```

If a name has several SHMÚ points (for example *Košice (centrum)* and *Košice (letisko)*), the town centre is used, and the run log lists the other IDs. If a name isn't found, the log suggests similar names.

### Output

One item per location and day:

```json
{
    "location": "Prešov",
    "query": "Prešov",
    "stationId": 31379,
    "latitude": 49,
    "longitude": 21.25,
    "elevationM": 295,
    "date": "2026-10-16",
    "day": "tomorrow",
    "willRain": true,
    "precipitationMm": 3.2,
    "snowMm": 0,
    "precipitationType": "rain",
    "rainyHours": 4,
    "rainTimes": "14:00–18:00",
    "maxHourlyPrecipitationMm": 1.4,
    "temperatureMinC": 3.6,
    "temperatureMaxC": 12.9,
    "maxWindGustKmh": 27,
    "cloudCoverPercent": 74,
    "fromTime": "2026-10-16T00:00+02:00",
    "toTime": "2026-10-17T00:00+02:00",
    "model": "ALADIN SHMU/SK 4.5km 87L",
    "modelRun": "2026-10-15T00:00Z",
    "sourceUrl": "https://www.shmu.sk/data/datanwp/json/aladin/2026-10-15/31379_2026-10-15_00.json"
}
```

The run's status message also gives a one-line answer, for example
`Prešov: today dry, tomorrow rain 3.2 mm (14:00–18:00), day after tomorrow dry`.

### How "rain" is decided

- ALADIN gives precipitation for every hour. An hour with at least **0.1 mm** counts as rainy and shows up in `rainTimes`.
- A day gets `willRain: true` when its total is at least `rainThresholdMm` (0.5 mm by default, which is about a light shower).
- For **today**, only the hours that haven't happened yet are counted (see `fromTime`).
- Snow is counted as its water equivalent, so 1 mm is roughly 1 cm of fresh snow.
- `precipitationType` describes what falls (`rain`, `snow`, `mixed`) even when it's below the threshold. It's `none` only for less than 0.1 mm in the day.

### Data source

Forecast data comes from the **Slovak Hydrometeorological Institute (SHMÚ)**, [shmu.sk](https://www.shmu.sk), model ALADIN SHMU/SK (4.5 km grid, updated 4 times a day). This Actor is not affiliated with SHMÚ.

The Actor uses the newest model run that reaches the end of the last requested day. The 00 UTC run looks 4 days ahead, but the 06, 12 and 18 UTC runs only look 3 days ahead. So at night, a 3-day request uses the previous 00 UTC run. The `modelRun` field shows which run was used.

The Actor uses the same JSON endpoints as the interactive meteograms on shmu.sk. These aren't a documented public API, so they may change without notice.

### Limitations

- Slovakia only: GPS points more than 30 km from the nearest SHMÚ point are rejected.
- GPS input uses the nearest SHMÚ point. In the mountains, that can be a peak or a mountain hut (e.g. *Chopok*), which has very different weather from the valley. Check `location` and `elevationM` in the output, and if needed enter a nearby village by name.
- ALADIN looks about 3–4 days ahead, so this Actor returns at most 3 days.
- A forecast point stands for a 4.5 km grid area. In the mountains, the real weather can differ from the forecast.
- shmu.sk doesn't accept connections straight from cloud servers. Keep Apify Proxy turned on when you run this on Apify.

### Development

```bash
npm install
npm start          # runs locally with input from storage/key_value_stores/default/INPUT.json
npm test           # unit tests (vitest)
npm run build      # TypeScript type-check and compile

npm i -g apify-cli
apify login
apify push         # build and deploy to your Apify account
```

The code is split into small steps that are easy to follow:

| File | What it does |
|---|---|
| `src/main.ts` | Reads input, runs an `HttpCrawler`, writes the status message |
| `src/routes.ts` | 3 crawler steps: location list → forecast files for a location → forecast |
| `src/stations.ts` | Matches a name, ID or GPS point to an SHMÚ forecast point |
| `src/forecast.ts` | Turns hourly ALADIN data into one summary per day (in Slovak time) |

# Actor input Schema

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

Where you want the forecast. Each line can be:<ul><li>a Slovak town or village, e.g. <code>Prešov</code> or <code>Presov</code> (accents are optional)</li><li>GPS coordinates, e.g. <code>49.05, 21.30</code> (copy them from Google Maps). The nearest SHMÚ forecast point is used.</li><li>an SHMÚ location ID, e.g. <code>31379</code></li></ul>SHMÚ has forecasts for about 1,000 places in Slovakia.

## `days` (type: `integer`):

How many days to return: 1 = today only, 3 = today, tomorrow and the day after.

## `rainThresholdMm` (type: `number`):

A day is marked as rainy (<code>willRain: true</code>) when its total rain and snow is at least this much. 0.5 mm is a light shower; 0.1 mm also counts drizzle.

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

Adds an <code>hourly</code> list to each day with rain, snow, temperature, clouds and wind for every hour.

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

shmu.sk closes connections that come from cloud servers, including Apify's, so the Actor uses Apify Proxy by default. The cheap datacenter proxy is enough.

## Actor input object example

```json
{
  "locations": [
    "Prešov"
  ],
  "days": 3,
  "rainThresholdMm": 0.5,
  "includeHourly": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `forecast` (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": [
        "Prešov"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("damikun/shmu-weather-forecast").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": ["Prešov"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("damikun/shmu-weather-forecast").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": [
    "Prešov"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call damikun/shmu-weather-forecast --silent --output-dataset

```

## MCP server setup

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

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/7ghyWPnyqqckaA4yP/builds/iSw3AzWjLJ2lOu45x/openapi.json
