# Spain Wildfire Risk & Active Fires (EFFIS) (`rubenpa/spain-fire-risk`) Actor

Daily wildfire danger (FWI) forecast per Spanish province or lat/lon point plus nearby satellite fire detections, from official Copernicus EFFIS open data; optional AEMET weather with your own key. No scraping, no personal data. Unofficial service.

- **URL**: https://apify.com/rubenpa/spain-fire-risk.md
- **Developed by:** [Ruben](https://apify.com/rubenpa) (community)
- **Categories:** AI, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 location-day delivereds

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

## 🔥 Spain Wildfire Risk & Active Fires · Riesgo de incendio forestal en España

> **EN** · A **fire danger forecast (FWI) per location and day** for Spain, plus **satellite fire detections near each point**, built **only** from official open data: **Copernicus EFFIS** (European Forest Fire Information System) and, optionally, **AEMET OpenData** weather with *your own* free key.
> **ES** · **Previsión de peligro de incendio (FWI) por localización y día** para España, más **detecciones de incendio por satélite cercanas a cada punto**, con **datos abiertos oficiales**: **Copernicus EFFIS** y, opcionalmente, el tiempo de **AEMET OpenData** con *tu propia* clave gratuita.

**Sources / Fuentes:** © European Union, European Forest Fire Information System (EFFIS), Copernicus Emergency Management Service – CC BY 4.0 · *Fuente: AEMET* (only when you supply an AEMET key / solo si aportas clave AEMET).

⚠️ **Unofficial service. / Servicio no oficial.** Not affiliated with, sponsored or endorsed by the European Commission, Copernicus/EFFIS, AEMET or any public body. Model forecasts and unconfirmed satellite detections: **do not use as the only basis for safety-critical decisions**; official warnings come from AEMET and civil protection. / No vinculado, patrocinado ni respaldado por la Comisión Europea, Copernicus/EFFIS, AEMET ni ningún organismo público. Previsiones de modelo y detecciones sin confirmar: **no usar como única base de decisiones de seguridad**; los avisos oficiales los emiten AEMET y Protección Civil.

***

## 🇬🇧 English

### What it does

Give it Spanish **provinces** (all 52 are built in, capital point) and/or your own **latitude/longitude points** (forests, farms, insured assets, wind/solar sites, municipalities). For every location and every forecast day it returns **one row**:

- the **Fire Weather Index (FWI)** from the EFFIS fire-danger forecast (**ECMWF 8 km, up to 9 days**, or **Météo-France, up to 3 days**) and the official **EFFIS danger class** (very low … very extreme),
- the FWI sub-indices (FFMC, DMC, DC, ISI, BUI), the EFFIS **anomaly** and **ranking percentile** versus ~40 years of history, and the **change vs the previous day**,
- **active fire detections** (VIIRS, MODIS, Sentinel-3 via EFFIS) within your radius and look-back window: count, last 24 h, nearest distance, FRP, and the nearest detections with bearing,
- optionally **AEMET** daily weather (max/min temperature, relative humidity, wind, gusts, rain probability) per municipality,
- the **source attribution and legal notice** in every row.

A **risk threshold** (`minDangerClass`) turns it into an alert list: only rows at or above, e.g., *high* are returned **and billed**.

#### Who it is for

Forestry and brush-clearing companies planning crews, insurers and brokers monitoring portfolios, municipalities and fire brigades, agriculture/energy operators with assets in the countryside, and anyone building dashboards or alerts on top of Apify schedules, webhooks or the API.

### What makes it different

Wildfire actors on the Apify Store mostly list US incidents (NIFC/WFIGS), raw NASA detections, or generic hazard feeds. This actor is built around the **forecast fire danger index (FWI) for your own points in Spain, day by day**, joined with nearby detections and (optionally) official AEMET weather, in one row per location-day, with the legal attribution handled for you. It does not scrape anything and needs **no key** to deliver the core data.

### Quick start

1. Press **Start** with the defaults (Ourense and Valencia, 3 days) – no key needed.
2. Pick provinces, tick *All 52 provinces*, or paste your own points in `locations`.
3. Set `minDangerClass` (e.g. `high`) to get alerts only, and schedule the actor daily.
4. Optional: add your free **AEMET API key** to include weather (see below).

### Input

| Field | Meaning | Default |
|---|---|---|
| `provinces` | Spanish provinces (capital point). Names are accent-insensitive via API (`Orense`, `Vizcaya`, `Baleares`…) | Ourense, Valencia |
| `allProvinces` | All 52 provinces and autonomous cities | false |
| `locations` | `[{ "name", "latitude", "longitude", "aemetMunicipalityCode"? }]` WGS84, inside Spain (incl. Balearics, Canaries, Ceuta, Melilla) | – |
| `forecastDays` | 1-9 (ECMWF) or 1-3 (Météo-France), starting today (Europe/Madrid) | 3 |
| `minDangerClass` | `very_low` (all rows) … `very_extreme`. Only rows ≥ this class are returned and billed | `very_low` |
| `fwiModel` | `ecmwf` (~8 km, 9 d) or `meteofrance` (~25 km, 3 d) | `ecmwf` |
| `includeFwiComponents` | Add FFMC/DMC/DC/ISI/BUI | true |
| `fireRadiusKm`, `fireLookbackDays`, `maxFireDetectionsPerRow` | Active-fire window (1-100 km, 1-30 days, up to 50 listed) | 25 km, 3 d, 5 |
| `aemetApiKey` (secret) | Your own AEMET OpenData key → adds `weather` | – |
| `maxLocations` | Safety cap | 200 |

**EFFIS danger classes** (FWI, upper bound excluded): very low < 5.2 · low 5.2–11.2 · moderate 11.2–21.3 · high 21.3–38 · very high 38–50 · extreme 50–70 · very extreme ≥ 70.

### Output (one row per location and day)

| Field | Description |
|---|---|
| `locationName`, `province`, `autonomousCommunity`, `latitude`, `longitude` | The location |
| `date`, `forecastDay` | Day (Europe/Madrid) and offset from today |
| `fwiModel` | Model used |
| `fireDangerIndex`, `dangerClass`, `dangerClassLabel`, `dangerLevel` (1-7) | FWI and EFFIS class |
| `fwiChangeVsPreviousDay` | FWI difference vs the previous consecutive day in the run |
| `fwiComponents` | `ffmc`, `dmc`, `dc`, `isi`, `bui` |
| `anomalyIndex`, `rankingIndex` | EFFIS anomaly (σ) and percentile vs ~40-year history (ECMWF model only) |
| `weather` | AEMET daily weather or `null` (see below) |
| `activeFires` | `radiusKm`, `lookbackDays`, `asOf`, `count`, `countLast24h`, `totalFrpMw`, `maxFrpMw`, `nearestKm`, `latestDetectionUtc`, `detections[]` (distance, bearing, direction, FRP, confidence, satellite, UTC time) |
| `sources`, `legalNotice`, `dataAccessedAt` | Required attribution, disclaimer, access timestamp |

A real example is in `examples/sample-output.json`. When AEMET is enabled, `weather` looks like (format illustration):

```json
"weather": { "source": "AEMET", "municipalityCode": "32054", "municipalityName": "Ourense", "elaboratedAt": "2026-11-09T12:03:00",
  "tempMaxC": 17, "tempMinC": 8, "humidityMaxPct": 95, "humidityMinPct": 55, "windMaxKmh": 15, "gustMaxKmh": 35, "precipProbabilityMaxPct": 10 }
```

### What works without an AEMET key

**Everything except `weather`.** The fire danger forecast, classes, sub-indices, anomaly/ranking and the active-fire detections come from EFFIS and need no key. With a key you also get AEMET weather. Request a free key at <https://opendata.aemet.es/centrodedescargas/altaUsuario> (keys last 3 months), paste it into `aemetApiKey`. For provinces the capital municipality is used automatically; for custom points add `aemetMunicipalityCode` (5-digit INE code). If the key is invalid or expired the run **continues with EFFIS data** and logs a warning.

### Pricing

Pay-per-event: **$0.002 per location-day** (`location-day`). Example: all 52 provinces × 3 days = 156 rows ≈ **$0.31**. Rows without data and rows below your threshold are **not billed**. Apify platform usage is small: a 5-location, 15-row run takes ~4 s.

### Legal (open data only)

- **Copernicus EFFIS** – content owned by the EU is licensed **CC BY 4.0** (Commission reuse policy, Decision of 12 Dec 2011); commercial reuse is allowed with attribution and an indication of changes. Licence: <https://forest-fire.emergency.copernicus.eu/about-effis/data-license>. EFFIS documents the WMS/WFS services used here (<https://forest-fire.emergency.copernicus.eu/downloads-instructions>). Data are processed (point sampling, classification, distance filtering) – this is stated in every row.
- **AEMET OpenData** – the AEMET legal note (<https://www.aemet.es/es/nota_legal>) allows reuse **for commercial and non-commercial purposes** (Ley 18/2015) provided AEMET is cited ("Fuente: AEMET" for value-added services), the meaning of the information is not altered, the last-update date is kept (`weather.elaboratedAt`) and no AEMET endorsement is implied. AEMET API keys are personal (tied to an email) and expire after 3 months, so **you supply your own key**; this actor never ships or shares a key and never stores yours in the dataset.
- **No scraping, no personal data.** Only gridded model values, satellite detections and weather forecasts.
- **Not used:** NASA FIRMS directly. NASA data are open, but EFFIS already redistributes the same VIIRS/MODIS detections under CC BY 4.0 without requiring a personal MAP_KEY, so FIRMS was left out to keep one clear licence chain.
- Detections include any satellite-seen heat source (also controlled burns, agricultural fires and industry). Check `confidence` and `frpMw` and treat them as unconfirmed.

### Limits

FWI is a **model value for a grid cell** (ECMWF ~8 km), sampled at the exact point; terrain and local fuels are not resolved. The EFFIS forecast horizon is 9 days (ECMWF) / 3 days (Météo-France). Provinces use the capital city as sampling point; use `locations` for the exact site. EFFIS and AEMET availability is outside our control; failed days are skipped and not billed.

***

## 🇪🇸 Español

### ¿Qué hace?

Dale **provincias** (las 52 están incluidas, punto de la capital) y/o tus **puntos con latitud/longitud** (montes, fincas, activos asegurados, parques eólicos/solares, municipios). Para cada localización y cada día de previsión devuelve **una fila** con:

- el **Índice Meteorológico de Incendio (FWI)** de la previsión de peligro de EFFIS (**ECMWF 8 km, hasta 9 días**, o **Météo-France, hasta 3 días**) y la **clase de peligro oficial de EFFIS** (muy bajo … muy extremo),
- los subíndices (FFMC, DMC, DC, ISI, BUI), la **anomalía** y el **percentil (ranking)** de EFFIS frente a ~40 años de histórico, y el **cambio respecto al día anterior**,
- las **detecciones de incendio activo** (VIIRS, MODIS, Sentinel-3 vía EFFIS) dentro de tu radio y ventana temporal: número, últimas 24 h, distancia al más cercano, FRP y las detecciones más próximas con rumbo,
- opcionalmente el **tiempo diario de AEMET** (temperatura máx./mín., humedad relativa, viento, rachas, probabilidad de lluvia) por municipio,
- la **atribución de fuentes y el aviso legal** en cada fila.

Un **umbral de riesgo** (`minDangerClass`) lo convierte en lista de alertas: solo se devuelven **y se cobran** las filas iguales o superiores a, por ejemplo, *alto*.

#### ¿Para quién?

Empresas forestales y de desbroce que planifican cuadrillas, aseguradoras y corredurías que vigilan carteras, ayuntamientos y brigadas, operadores agrarios y energéticos con activos en el campo, y quien construya paneles o alertas con las programaciones, webhooks o la API de Apify.

### En qué se diferencia

Los actores de incendios de la tienda de Apify suelen listar incidentes de EE. UU. (NIFC/WFIGS), detecciones en bruto de la NASA o feeds genéricos de peligros. Este actor se centra en la **previsión del índice de peligro de incendio (FWI) para tus propios puntos en España, día a día**, unida a las detecciones cercanas y (opcionalmente) al tiempo oficial de AEMET, en una fila por localización y día y con la atribución legal resuelta. No hace scraping y **no necesita ninguna clave** para entregar los datos principales.

### Inicio rápido

1. Pulsa **Start** con los valores por defecto (Ourense y Valencia, 3 días): no hace falta clave.
2. Elige provincias, marca *Todas las provincias* o pega tus puntos en `locations`.
3. Fija `minDangerClass` (p. ej. `high`) para recibir solo alertas y programa el actor a diario.
4. Opcional: añade tu **clave gratuita de AEMET** para incluir el tiempo.

### Qué funciona sin clave de AEMET

**Todo menos `weather`.** La previsión de peligro, las clases, los subíndices, la anomalía/ranking y las detecciones de incendio activo vienen de EFFIS y no requieren clave. Con clave se añade el tiempo de AEMET. Solicita una clave gratuita en <https://opendata.aemet.es/centrodedescargas/altaUsuario> (caduca a los 3 meses) y pégala en `aemetApiKey`. Para provincias se usa automáticamente el municipio de la capital; para puntos propios añade `aemetMunicipalityCode` (código INE de 5 dígitos). Si la clave es inválida o ha caducado, la ejecución **continúa con los datos de EFFIS** y avisa en el log.

### Precio

Pago por evento: **0,002 USD por localización-día** (`location-day`). Ejemplo: las 52 provincias × 3 días = 156 filas ≈ **0,31 USD**. Las filas sin dato y las que no alcanzan tu umbral **no se cobran**.

### Legal (solo datos abiertos)

- **Copernicus EFFIS**: el contenido de titularidad de la UE se licencia bajo **CC BY 4.0** (política de reutilización de la Comisión, Decisión de 12-12-2011); se permite la reutilización comercial con atribución e indicación de los cambios. Licencia: <https://forest-fire.emergency.copernicus.eu/about-effis/data-license>. Los datos se procesan (muestreo puntual, clasificación, filtrado por distancia) y así se indica en cada fila.
- **AEMET OpenData**: la nota legal de AEMET (<https://www.aemet.es/es/nota_legal>) permite la reutilización **con fines comerciales y no comerciales** (Ley 18/2015) citando a AEMET («Fuente: AEMET» en servicios de valor añadido), sin desnaturalizar la información, conservando la fecha de actualización (`weather.elaboratedAt`) y sin sugerir respaldo de AEMET. Las claves de API de AEMET son personales (ligadas a un correo) y caducan a los 3 meses, por lo que **aportas tu propia clave**; este actor nunca incluye ni comparte una clave y nunca guarda la tuya en el dataset.
- **Sin scraping y sin datos personales.** Solo valores de modelo en malla, detecciones por satélite y previsiones meteorológicas.
- **No se usa** NASA FIRMS directamente: sus datos son abiertos, pero EFFIS ya redistribuye las mismas detecciones VIIRS/MODIS bajo CC BY 4.0 sin exigir MAP_KEY personal; así queda una única cadena de licencia.
- Las detecciones incluyen cualquier fuente de calor vista por satélite (también quemas controladas, agrícolas e industria). Revisa `confidence` y `frpMw` y trátalas como no confirmadas.

### Límites

El FWI es un **valor de modelo para una celda de malla** (ECMWF ~8 km) muestreado en el punto exacto; no resuelve relieve ni combustible local. El horizonte de EFFIS es 9 días (ECMWF) / 3 días (Météo-France). Las provincias usan la capital como punto de muestreo; usa `locations` para el sitio exacto. La disponibilidad de EFFIS y AEMET no depende de nosotros; los días fallidos se omiten y no se cobran.

***

*Data: © European Union, EFFIS – Copernicus EMS, CC BY 4.0. Weather (optional): Fuente: AEMET. Unofficial service / Servicio no oficial.*

# Actor input Schema

## `provinces` (type: `array`):

Spanish provinces (capital city point). Accent-insensitive names also accepted via API (e.g. 'Orense', 'Vizcaya', 'Baleares').

## `allProvinces` (type: `boolean`):

Process all 52 provinces and autonomous cities (capital point of each). Combine with a danger threshold to get an alert list.

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

Your own sites (forests, farms, insured assets, municipalities). JSON list of {"name", "latitude", "longitude", "aemetMunicipalityCode"?}. Coordinates in WGS84 decimal degrees, inside Spain. aemetMunicipalityCode is the 5-digit INE municipality code, needed only for AEMET weather on custom points.

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

Days to return, starting today (Europe/Madrid). ECMWF model: up to 9. Météo-France model: up to 3. One row (and one billed event) per location per day.

## `minDangerClass` (type: `string`):

Only rows at or above this EFFIS class are returned and billed. FWI ranges: very_low <5.2 · low 5.2-11.2 · moderate 11.2-21.3 · high 21.3-38 · very_high 38-50 · extreme 50-70 · very_extreme >70.

## `fwiModel` (type: `string`):

EFFIS fire danger model: ECMWF (~8 km, 1-9 days) or Météo-France (~25 km, 1-3 days).

## `includeFwiComponents` (type: `boolean`):

Add FFMC, DMC, DC, ISI and BUI.

## `fireRadiusKm` (type: `integer`):

Satellite fire detections (VIIRS and MODIS, via EFFIS) within this distance of each point.

## `fireLookbackDays` (type: `integer`):

How many days back to look for detections.

## `maxFireDetectionsPerRow` (type: `integer`):

The nearest N detections are listed; counts and totals always cover all detections in the radius.

## `aemetApiKey` (type: `string`):

Your own free AEMET OpenData key adds temperature, humidity, wind, gusts and rain probability per day. Request it at https://opendata.aemet.es/centrodedescargas/altaUsuario (keys last 3 months). Never stored in the dataset.

## `maxLocations` (type: `integer`):

Safety cap on locations processed in one run.

## Actor input object example

```json
{
  "provinces": [
    "Ourense",
    "Valencia"
  ],
  "allProvinces": false,
  "locations": [
    {
      "name": "Sierra de Gredos (example)",
      "latitude": 40.25,
      "longitude": -5.2
    }
  ],
  "forecastDays": 3,
  "minDangerClass": "very_low",
  "fwiModel": "ecmwf",
  "includeFwiComponents": true,
  "fireRadiusKm": 25,
  "fireLookbackDays": 3,
  "maxFireDetectionsPerRow": 5,
  "maxLocations": 200
}
```

# Actor output Schema

## `risk` (type: `string`):

No description

## `dataset` (type: `string`):

No description

## `summary` (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 = {
    "provinces": [
        "Ourense",
        "Valencia"
    ],
    "locations": [
        {
            "name": "Sierra de Gredos (example)",
            "latitude": 40.25,
            "longitude": -5.2
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rubenpa/spain-fire-risk").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 = {
    "provinces": [
        "Ourense",
        "Valencia",
    ],
    "locations": [{
            "name": "Sierra de Gredos (example)",
            "latitude": 40.25,
            "longitude": -5.2,
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("rubenpa/spain-fire-risk").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 '{
  "provinces": [
    "Ourense",
    "Valencia"
  ],
  "locations": [
    {
      "name": "Sierra de Gredos (example)",
      "latitude": 40.25,
      "longitude": -5.2
    }
  ]
}' |
apify call rubenpa/spain-fire-risk --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rubenpa/spain-fire-risk"
        }
    }
}
```

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/1VpqTecLvx5OzZE2l/builds/DdH10QHe5snmRDuWb/openapi.json
