> ## Documentation Index
> Fetch the complete documentation index at: https://docs.climatifai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor agroclimatic alerts across LATAM zones

> Use the GraphQL alerts query to automatically monitor eight key LATAM agricultural zones for fire, heat waves, drought, and heavy rainfall in a single request.

The alerts system gives you a single query that simultaneously monitors eight critical agricultural zones across Latin America for four types of agroclimatic events: active fires, heat waves, drought, and heavy rainfall. Instead of polling each zone and event type separately, you send one GraphQL request and receive a consolidated, severity-ranked list of current conditions. The system runs all zone checks in parallel, so response time stays low regardless of the number of zones.

## The eight monitored zones

The API monitors the following zones, which were chosen to cover the most agriculturally significant and climate-sensitive regions of LATAM (excluding Brazil):

| # | Zone              | Country/Region               | Coordinates          |
| - | ----------------- | ---------------------------- | -------------------- |
| 1 | Orinoquía         | Colombia / Venezuela         | lat 6.5, lon −68.0   |
| 2 | Chaco             | Paraguay / Argentina         | lat −22.0, lon −60.0 |
| 3 | Bajío             | México                       | lat 20.5, lon −101.0 |
| 4 | Centroamérica     | Guatemala–Nicaragua corridor | lat 14.0, lon −87.0  |
| 5 | Llanos Orientales | Colombia                     | lat 4.0, lon −72.5   |
| 6 | Pampa Húmeda      | Argentina                    | lat −34.0, lon −61.0 |
| 7 | Valle Central     | Chile                        | lat −34.5, lon −71.0 |
| 8 | Sierra Peruana    | Peru                         | lat −13.0, lon −75.0 |

## Alert types and thresholds

Each zone is evaluated independently against the following rules. Alerts are only generated when a threshold is crossed.

| Alert type | Severity | Threshold                                                     | Data source                 |
| ---------- | -------- | ------------------------------------------------------------- | --------------------------- |
| `fire`     | `alta`   | ≥ 10 hotspots within 150 km in the last 48 hours              | NASA FIRMS VIIRS\_SNPP\_NRT |
| `fire`     | `media`  | 3–9 hotspots within 150 km in the last 48 hours               | NASA FIRMS VIIRS\_SNPP\_NRT |
| `heat`     | `alta`   | Maximum 2 m temperature ≥ 38 °C forecast in the next 72 hours | Open-Meteo forecast         |
| `heat`     | `media`  | Maximum 2 m temperature ≥ 34 °C forecast in the next 72 hours | Open-Meteo forecast         |
| `drought`  | `media`  | 0 mm precipitation forecast over 3 days                       | Open-Meteo forecast         |
| `rain`     | `media`  | ≥ 50 mm total precipitation forecast over 72 hours            | Open-Meteo forecast         |

Severity levels are `alta` (highest), `media`, and `baja`. Currently, fire and heat events can reach `alta`; drought and rain alerts are capped at `media` unless the API is extended in a future release.

## Querying alerts via GraphQL

The alerts feature is available exclusively through the GraphQL endpoint (`/graphql`). There is no REST equivalent.

<Steps>
  <Step title="Send the GraphQL query">
    Send the following query to the GraphQL endpoint. No variables are required — the zones are fixed server-side.

    ```graphql theme={null}
    query GetAlerts {
      alerts {
        generatedAt
        zonesChecked
        alerts {
          region
          alertType
          severity
          title
          message
          generatedAt
        }
      }
    }
    ```

    Using curl:

    ```bash theme={null}
    curl -X POST "https://api.climatifai.com/graphql" \
      -H "Content-Type: application/json" \
      -d '{"query":"{ alerts { generatedAt zonesChecked alerts { region alertType severity title message generatedAt } } }"}'
    ```

    A sample response when two alerts are active:

    ```json theme={null}
    {
      "data": {
        "alerts": {
          "generatedAt": "2026-05-18T14:32:07.841Z",
          "zonesChecked": 8,
          "alerts": [
            {
              "region": "Chaco (Paraguay/Argentina)",
              "alertType": "fire",
              "severity": "alta",
              "title": "Incendios activos",
              "message": "12 focos de calor detectados en Chaco (Paraguay/Argentina) (últimas 48h, radio 150km). Riesgo crítico para cultivos y suelo.",
              "generatedAt": "2026-05-18T14:32:05.210Z"
            },
            {
              "region": "Bajío (México)",
              "alertType": "heat",
              "severity": "alta",
              "title": "Ola de calor",
              "message": "Temperatura máxima de 39.4°C prevista en Bajío (México) (próximas 72h). Adelanta riego y protege cultivos sensibles.",
              "generatedAt": "2026-05-18T14:32:06.003Z"
            },
            {
              "region": "Valle Central (Chile)",
              "alertType": "drought",
              "severity": "media",
              "title": "Déficit hídrico",
              "message": "Sin precipitación prevista en Valle Central (Chile) por 3 días. Activa riego si el cultivo está en etapa crítica.",
              "generatedAt": "2026-05-18T14:32:06.441Z"
            }
          ]
        }
      }
    }
    ```

    The `alerts` array is sorted by severity — `alta` first, then `media`, then `baja` — so the most critical conditions always appear at the top.
  </Step>

  <Step title="Filter by severity">
    The API returns all alerts for all zones in a single response. To focus on critical events only, filter the `alerts` array on the client side:

    ```javascript theme={null}
    const critical = data.alerts.alerts.filter(a => a.severity === "alta");
    ```

    If you want to send push notifications only for `alta` severity, apply this filter before dispatching.
  </Step>

  <Step title="Filter by alert type">
    To monitor only a specific hazard category — for example, fire events for a fire-insurance dashboard — filter by the `alertType` field:

    ```javascript theme={null}
    // Fire events only
    const fireAlerts = data.alerts.alerts.filter(a => a.alertType === "fire");

    // Heat and drought together
    const climateStress = data.alerts.alerts.filter(
      a => a.alertType === "heat" || a.alertType === "drought"
    );
    ```

    Valid `alertType` values: `fire`, `heat`, `drought`, `rain`.
  </Step>
</Steps>
