# Supply Chain Risk Monitor: Earthquakes, Floods (`jet_elation/global-hazard-supply-chain-radar`) Actor

Integrates USGS, NASA EONET, and GDACS hazards, then calculates Haversine distances from earthquakes, cyclones, floods, wildfires, volcanoes, droughts, and landslides to your factories, warehouses, ports, and routes. B2B alert JSON with zero-charge no-match days.

- **URL**: https://apify.com/jet_elation/global-hazard-supply-chain-radar.md
- **Developed by:** [y u](https://apify.com/jet_elation) (community)
- **Categories:** AI, Business, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 hazard event 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/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

## Supply Chain Risk Monitor: Earthquakes, Floods

One call scans **USGS earthquakes**, **NASA EONET natural events**, and **GDACS / UN & European Commission alerts**, then calculates **Haversine distances in kilometres** from every earthquake, cyclone, flood, wildfire, volcano, drought, landslide, or other hazard to your own factories, warehouses, stores, ports, offices, suppliers, travel destinations, or delivery routes.

**Apify Store:** [Supply Chain Risk Monitor: Earthquakes, Floods](https://apify.com/jet_elation/global-hazard-supply-chain-radar)\
**Actor ID:** `jet_elation~global-hazard-supply-chain-radar`\
**MCP tool name:** `jet_elation--global-hazard-supply-chain-radar`

> **Data sources: USGS, NASA EONET, Global Disaster Alert and Coordination System (GDACS).**

This Actor is built for B2B logistics, procurement, insurance, manufacturing, retail, and AI-agent workflows. It does not use a browser, Chromium, proxies, or screenshots. Every request is a server-side HTTPS JSON call to an official public API. Results are normalized into one stable schema that n8n, Make, Apify MCP Server, LangChain, and custom agents can consume without special-case parsing.

***

### Why this Actor exists

A global supply chain does not fail because of one data format. It fails because a typhoon in Japan, a wildfire in California, and an earthquake in Chile arrive as three unrelated feeds with different alert scales, coordinate orders, and geometry types. This Actor solves that aggregation and proximity problem in one run:

1. **Fetch** open hazards from three official sources.
2. **Normalize** source-specific fields into one hazard category and one `RED` / `ORANGE` / `GREEN` urgency scale.
3. **Calculate** the great-circle distance from each hazard to every configured watch location.
4. **Filter** by source, hazard type, magnitude, alert level, and watch-location radius.
5. **Deduplicate** repeated source records and add cross-source duplicate hints.
6. **Write** only valid, selected records to the Apify dataset and charge only for those records.

The result is a daily watchlist that answers a practical question: *“Which natural hazards are close enough to matter to my operations today?”*

***

### Key features

- **Three official feeds in one run:** USGS FDSN Event API, NASA EONET v3, and GDACS MHEWS.
- **One unified schema:** every dataset item has the same `id`, `source`, `hazardType`, `alertLevel`, coordinates, timestamps, official URL, and distance fields.
- **Haversine proximity:** distance to every watch location in km, sorted nearest first, with a per-location `withinRadius` flag.
- **Global urgency ordering:** `RED` first, then nearest watch location, then most recent event. One API cannot crowd out a more urgent hazard.
- **Zero-charge no-match days:** with `onlyMatchingLocations: true`, a day with no in-radius hazard writes zero records and therefore costs zero pay-per-event charges.
- **Cross-source hints:** flags likely duplicates across sources without deleting or merging official records.
- **Source isolation:** a GDACS HTML/empty/malformed response never prevents USGS or NASA EONET results from being returned.
- **MCP-first defaults:** every input has a default. An AI agent can call the Actor with only a list of locations.
- **Offline mock mode:** `useMockData: true` exercises normalization, distances, deduplication, filtering, dataset writes, and charging with no network access.
- **No browser or proxy costs:** pure HTTPS JSON and a 512 MB default memory limit.

***

### Supported sources and hazard coverage

| Source | API | Hazard categories | Official alert level |
| --- | --- | --- | --- |
| **USGS** | FDSN Event GeoJSON API | Earthquakes | PAGER `green` / `yellow` / `orange` / `red`, combined with magnitude |
| **NASA EONET** | EONET v3 events API | Wildfires, volcanoes, severe storms, floods, landslides, drought, other event categories | No official alert scale; conservative derivation documented below |
| **GDACS** | MHEWS event search API | Earthquakes, tropical cyclones, floods, volcanoes, droughts, wildfires | Official `Red` / `Orange` / `Green` |

USGS coordinates are read as **`[longitude, latitude, depthKm]`** and converted to separate `latitude` / `longitude` fields. EONET Point, Polygon, and MultiPolygon geometries are supported; a polygon becomes a circular mean of its vertices. GDACS point geometries are supported, and malformed geometry is skipped rather than charged.

***

### Unified alert normalization

All records use exactly one of:

- `RED`
- `ORANGE`
- `GREEN`

#### USGS earthquakes

| Condition | Unified alert |
| --- | --- |
| PAGER `red`, or magnitude ≥ 6.5 | `RED` |
| PAGER `orange` or `yellow`, or magnitude ≥ 5.5 | `ORANGE` |
| Everything else | `GREEN` |

A missing PAGER alert cannot hide a major earthquake: magnitude is always considered. Earthquakes are point-in-time events, so USGS records use `isActive: false`.

#### GDACS

GDACS's official `Red`, `Orange`, and `Green` alert levels are used directly. The Actor also applies the requested `minAlertLevel` locally, in case the API returns a broader set than requested. GDACS records are active when `iscurrent` is true or the event's `todate` has not passed.

#### NASA EONET

EONET does not publish a PAGER or GDACS-style alert level. The Actor uses a transparent, conservative mapping:

| EONET category | Derived alert |
| --- | --- |
| Severe storm / tropical cyclone | `ORANGE`; promoted to `RED` for major winds (≥ 96 kts, ≥ 178 km/h, or ≥ 111 mph) |
| Wildfire | `ORANGE` |
| Volcano | `ORANGE` |
| Flood | `ORANGE` |
| Landslide | `ORANGE` |
| Drought | `GREEN` |
| Earthquake (if present) | Magnitude ≥ 6.5 `RED`; ≥ 5.5 `ORANGE`; otherwise `GREEN` |
| Other (sea/lake ice, dust, etc.) | `GREEN` |

This is a hazard-triage heuristic, not an official EONET rating. The source and its caveat are recorded in `SUMMARY.notes`, and the raw category is retained in `sourceDetails`.

***

### Haversine distance and watch-location matching

Input example:

```json
{
  "watchLocations": [
    { "name": "Tokyo Port", "lat": 35.6329, "lon": 139.7753, "radiusKm": 300 },
    { "name": "Rotterdam DC", "lat": 51.949, "lon": 4.14, "radiusKm": 150 }
  ]
}
```

For every hazard and every watch location, the Actor computes:

```text
a = sin²(Δφ/2) + cos φ1 · cos φ2 · sin²(Δλ/2)
c = 2 · atan2(√a, √(1−a))
distanceKm = 6371.0088 · c
```

`affectedWatchLocations` contains **all** configured locations, sorted nearest first:

```json
[
  { "name": "Tokyo Port", "distanceKm": 8.5, "withinRadius": true },
  { "name": "Rotterdam DC", "distanceKm": 9363.6, "withinRadius": false }
]
```

`minDistanceToWatchKm` is the nearest distance, or `null` when no watch locations were provided. The `withinRadius` boolean is the authoritative match flag, so an agent can decide whether an out-of-radius hazard is still worth watching.

When `onlyMatchingLocations: true`, a record is kept only if **at least one** watch location has `withinRadius: true`. The filter is applied before dataset writes and before charging. When false, all hazard records that pass the other filters are returned, with distances for context.

#### Cross-source duplicate hints

The same physical event can appear in more than one official feed. This Actor does **not** silently delete one source's version. Instead, each record gets:

```json
{
  "crossSourceHint": {
    "isLikelyDuplicateAcrossSources": true,
    "matches": [
      {
        "source": "gdacs",
        "sourceEventId": "1579006",
        "title": "Earthquake in Japan",
        "distanceKm": 0,
        "hoursApart": 0.5
      }
    ]
  }
}
```

The hint is heuristic: same unified `hazardType`, at most **24 hours** apart, and at most **200 km** between source points. Up to five nearest matches are included. Use it to reconcile alerts, not as a legal determination.

Within a source, exact composite-ID duplicates (`<source>:<sourceEventId>`) are removed and counted in `SUMMARY.totals.duplicatesSkipped`.

***

### Zero-charge by design — ideal for daily schedules

**This is the most important section for n8n/Make users.**

Pay-per-event charging is intentionally tied to **successful dataset writes**, not to the number of locations, API calls, or runs.

- A record is charged **once** when it is valid, selected, written, and charged as `hazard-returned`.
- One record costs one event **regardless of how many watch locations it is measured against**.
- `onlyMatchingLocations: true` + no hazard inside any radius = **0 records = 0 charges**.
- `onlyMatchingLocations: true` + `watchLocations: []` = **0 records = 0 charges**.
- Hazards removed by `hazardTypes`, `minAlertLevel`, `minEarthquakeMagnitude`, invalid coordinates, deduplication, or the spending limit are **not charged**.
- If the user's `maxTotalChargeUsd` limit is reached, the Actor stops **before** writing an uncharged record and exits successfully. The last successfully charged record is still written.
- The `SUMMARY` key in the default key-value store always records the zero-charge reason, so an n8n/Make workflow can branch on `zeroChargeReason` or simply check whether the dataset is empty.

This makes a **daily scheduled monitor economically safe**: quiet days cost nothing, and busy days charge only for the hazards that actually affect your operations.

> Apify platform compute usage is separate from pay-per-event charges. The Actor itself charges only the `hazard-returned` event defined in `.actor/pay_per_event.json`.

***

### Input parameters

Every field has a default. Only `watchLocations` is normally needed for a useful supply-chain run.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `sources` | array | `["usgs","nasa_eonet","gdacs"]` | Official feeds to query. |
| `hazardTypes` | array | `["all"]` | `all`, `earthquake`, `cyclone_storm`, `flood`, `wildfire`, `volcano`, `drought`, `landslide`, or `other`. USGS is skipped automatically when `earthquake` is not selected. |
| `lookbackDays` | integer | `7` | 1–30 days of history. |
| `minEarthquakeMagnitude` | number | `4.5` | Passed to USGS, and applied locally to USGS, GDACS, and EONET earthquake records when a numeric magnitude is available. |
| `minAlertLevel` | string | `ALL` | `ALL`, `ORANGE_AND_RED`, or `RED_ONLY`. |
| `watchLocations` | array | `[]` | Objects with `name`, `lat`, `lon`, and optional `radiusKm` (default 100). |
| `onlyMatchingLocations` | boolean | `false` | Keep only hazards inside at least one radius. No matches means zero records and zero charges. |
| `maxResults` | integer | `50` | 1–200 records, after global urgency sorting. |
| `useMockData` | boolean | `false` | Use `fixtures/mock_data.json` with no external requests. |

#### Input example

```json
{
  "sources": ["usgs", "nasa_eonet", "gdacs"],
  "hazardTypes": ["all"],
  "lookbackDays": 7,
  "minEarthquakeMagnitude": 4.5,
  "minAlertLevel": "ALL",
  "watchLocations": [
    { "name": "Tokyo Port", "lat": 35.6329, "lon": 139.7753, "radiusKm": 300 },
    { "name": "Rotterdam DC", "lat": 51.949, "lon": 4.14, "radiusKm": 150 }
  ],
  "onlyMatchingLocations": true,
  "maxResults": 50,
  "useMockData": false
}
```

***

### Output

One dataset item = one normalized hazard event. The default dataset schema includes:

```json
{
  "id": "usgs:us7000tokyo",
  "source": "usgs",
  "sourceEventId": "us7000tokyo",
  "hazardType": "earthquake",
  "title": "M 6.8 - 12 km E of Tokyo, Japan",
  "alertLevel": "RED",
  "magnitudeOrSeverity": 6.8,
  "countryOrPlace": "12 km E of Tokyo, Japan",
  "latitude": 35.68,
  "longitude": 139.85,
  "occurredAt": "2026-11-27T20:15:00.000Z",
  "isActive": false,
  "affectedWatchLocations": [
    { "name": "Tokyo Port", "distanceKm": 8.5, "withinRadius": true },
    { "name": "Rotterdam DC", "distanceKm": 9363.6, "withinRadius": false }
  ],
  "minDistanceToWatchKm": 8.5,
  "officialNoticeUrl": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000tokyo",
  "attribution": "Data sources: USGS, NASA EONET, Global Disaster Alert and Coordination System (GDACS)",
  "crossSourceHint": {
    "isLikelyDuplicateAcrossSources": true,
    "matches": [
      {
        "source": "gdacs",
        "sourceEventId": "1579006",
        "title": "Earthquake in Japan",
        "distanceKm": 0,
        "hoursApart": 0.5
      }
    ]
  },
  "sourceDetails": {
    "magnitude": 6.8,
    "depthKm": 30,
    "tsunami": false,
    "pagerAlert": "red",
    "place": "12 km E of Tokyo, Japan",
    "reviewStatus": "reviewed",
    "feltReports": 8421
  }
}
```

`sourceDetails` retains source-specific fields for auditability. Common keys include `depthKm`, `tsunami`, `pagerAlert`, `categoryId`, `geometryType`, `eventType`, `severityText`, `fromDate`, `toDate`, and `iso3`.

After every run, `SUMMARY` in the default key-value store contains per-source status (`success`, `partial`, `empty`, `error`, `skipped`), fetched/normalized/matched/returned counts, invalid and duplicate counts, billing details, notes, attribution, and `zeroChargeReason` when nothing was written.

***

### Use from Apify MCP Server

The Actor is designed so an MCP client can call it with a single JSON object. Load only this Actor:

```json
{
  "mcpServers": {
    "apify-hazard-radar": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=jet_elation/global-hazard-supply-chain-radar"
    }
  }
}
```

In an agent, use the tool:

```text
jet_elation--global-hazard-supply-chain-radar
```

Minimal useful call:

```json
{
  "watchLocations": [
    { "name": "Tokyo Port", "lat": 35.6329, "lon": 139.7753, "radiusKm": 300 }
  ],
  "onlyMatchingLocations": true
}
```

All other fields fall back to safe defaults: all three sources, all hazard types, 7 days, magnitude 4.5, all alert levels, and 50 maximum records.

Example agent prompt:

> “Check the latest global natural hazards within 300 km of Tokyo Port and 150 km of our Rotterdam DC. Return only orange/red alerts, sorted by nearest distance.”

**Combined toolset:** [Jet Elation AI Tools](https://github.com/Matsuda681/jet-elation-ai-tools) — five Apify Actors in one MCP connection.

***

### Use from n8n

#### Option A — synchronous run and dataset items

Use an **HTTP Request** node:

- **Method:** `POST`
- **URL:** `https://api.apify.com/v2/acts/jet_elation~global-hazard-supply-chain-radar/run-sync-get-dataset-items?token={{ $env.APIFY_TOKEN }}`
- **Body type:** JSON

```json
{
  "sources": ["usgs", "nasa_eonet", "gdacs"],
  "minAlertLevel": "ORANGE_AND_RED",
  "watchLocations": [
    { "name": "Tokyo Port", "lat": 35.6329, "lon": 139.7753, "radiusKm": 300 },
    { "name": "Rotterdam DC", "lat": 51.949, "lon": 4.14, "radiusKm": 150 }
  ],
  "onlyMatchingLocations": true,
  "maxResults": 50
}
```

The response is a JSON array of dataset items. Add an **IF** node:

```text
{{ $json.length > 0 }}
```

If true, send a Slack/Teams/email alert. If false, the daily run is quiet — **and no `hazard-returned` charges were made**.

#### Option B — asynchronous run for very large scans

1. `POST https://api.apify.com/v2/acts/jet_elation~global-hazard-supply-chain-radar/runs?token=...`
2. Read `data.id` from the response.
3. `GET https://api.apify.com/v2/actor-runs/{runId}?token=...` until `status` is `SUCCEEDED`.
4. `GET https://api.apify.com/v2/datasets/{defaultDatasetId}/items?token=...`.

For a daily 7-day scan, Option A is normally enough.

***

### Use from Make (Integromat)

1. Add an **HTTP > Make a request** module.
2. Method `POST`.
3. URL: `https://api.apify.com/v2/acts/jet_elation~global-hazard-supply-chain-radar/run-sync-get-dataset-items?token=<APIFY_TOKEN>`.
4. Body type `Raw`, content type `application/json`, and paste the JSON input.
5. Parse the returned array; iterate with **Iterator** and filter or route by `alertLevel`, `hazardType`, or `minDistanceToWatchKm`.
6. Add a second route for an empty array as the “no active hazards” branch.

***

### Pricing

The Actor uses **pay-per-event**:

- Event: `hazard-returned`
- Price: **$0.01 per valid hazard record written to the dataset**
- No `hazard-returned` charge for source fetches, runs, watch locations, filtered-out hazards, or empty days
- The platform enforces the user's `maxTotalChargeUsd` spending limit

Because the event is written **after filtering and deduplication**, a typical quiet day costs **$0.00**, and a busy day charges only for the records that survive every filter.

***

### Reliability and limitations

- **No API keys required.** USGS, NASA EONET, and GDACS are public, unauthenticated endpoints.
- **Hard timeouts and one polite retry** are applied to every source request. Transient 429/5xx responses are retried with a short backoff.
- **GDACS is defensive by design.** Empty bodies, `features: null`, non-JSON HTML, and malformed coordinates are treated as a source-level failure, not a run-level failure. USGS and NASA EONET still return results.
- **EONET serves JSON with an RSS content type**, so the Actor validates the body rather than rejecting on `Content-Type` alone.
- **EONET has no official alert level.** Its normalized alert is a documented conservative heuristic.
- **Cross-source hints are not deduplication.** Both official records remain available.
- **GDACS may not publish every hazard category for every period.** An empty GDACS response is normal and is reported as an empty source, not an error.
- **Coordinates are WGS84.** Invalid latitudes/longitudes are dropped before they can be charged.
- **Earthquakes are point-in-time events.** USGS and most GDACS earthquake records may have `isActive: false` even when recent.
- The default `lookbackDays` is deliberately short (7) for daily monitoring. Use up to 30 for retrospective checks.

***

### Local development and tests

Requirements: Node.js 20 or newer.

```bash
npm install
npm run build
npm run typecheck
npm test
```

`npm test` runs:

- Unit tests for Haversine math, input validation, source normalization, alert mapping, EONET geometry extraction, GDACS defensive parsing, filtering, deduplication, cross-source hints, record validation, and HTML rejection.
- End-to-end Actor runs with local Apify storage:
  - 24 normalized mock records
  - watch-location filtering
  - zero-match zero-charge day
  - one charge per returned record
  - spending-limit stop
  - hazard/alert/magnitude filters
  - null distances when no watch locations exist
  - invalid-input diagnostics

Run the Actor locally with the Apify CLI:

```bash
apify run --input-file input.example.json
```

To exercise local pay-per-event charging without the Apify platform:

```bash
## macOS / Linux
ACTOR_TEST_PAY_PER_EVENT=true apify run --input-file input.example.json
```

```powershell
## Windows PowerShell
$env:ACTOR_TEST_PAY_PER_EVENT = "true"
apify run --input-file input.example.json
```

`useMockData: true` makes no external requests at all. It is the recommended mode for CI and for testing MCP/n8n wiring without consuming API quotas.

***

### Deployment

From this directory:

```bash
npm install
npm run build
npm test
apify login
apify push
```

Then, in the Apify Console:

1. Open the Actor's **Publication** settings.
2. Confirm the pay-per-event event `hazard-returned` at $0.01 (from `.actor/pay_per_event.json`).
3. Add the Store description, categories, and a representative run.
4. Publish.

The Actor uses `apify/actor-node:20` in both Docker stages. No browser, display, or proxy configuration is required.

***

### Attribution and terms

> **Data sources: USGS, NASA EONET, Global Disaster Alert and Coordination System (GDACS).**

- USGS Earthquake Hazards Program: <https://earthquake.usgs.gov/>
- NASA Earth Observatory Natural Event Tracker (EONET): <https://eonet.gsfc.nasa.gov/>
- GDACS, a cooperation framework of the United Nations Office for the Coordination of Humanitarian Affairs (UN OCHA) and the European Commission: <https://www.gdacs.org/>

This Actor is an independent normalization and proximity layer. It is not endorsed by USGS, NASA, the United Nations, or the European Commission. Source availability and alert classifications can change without notice. Always confirm a high-impact event against the linked official notice before making operational decisions.

***

### 日本語クイックスタート

**世界の自然災害を、自社拠点からの距離で監視する B2B レーダー**です。USGS（地震）、NASA EONET（山火事・火山・暴風雨・洪水・地滑り・干ばつ）、GDACS（国連・欧州委員会）の公式 API を統合し、指定した緯度経度との Haversine 距離（km）と緊急度 `RED` / `ORANGE` / `GREEN` を返します。

最小入力:

```json
{
  "watchLocations": [
    { "name": "東京港", "lat": 35.6329, "lon": 139.7753, "radiusKm": 300 }
  ],
  "onlyMatchingLocations": true
}
```

- 半径内に災害がない日は **0 件・課金 0 円**。毎日の n8n / Make 定期実行に向いています。
- 課金は有効なレコードを 1 件書き込むごとに `hazard-returned` 1 回（$0.01）だけです。拠点数や API 呼び出し回数では課金されません。
- `onlyMatchingLocations: true` と `watchLocations` を設定すれば、拠点に影響する災害だけを抽出できます。
- `minAlertLevel` で `ALL` / `ORANGE_AND_RED` / `RED_ONLY` を選択できます。
- MCP ツール名: `jet_elation--global-hazard-supply-chain-radar`。
- 出典: **Data sources: USGS, NASA EONET, Global Disaster Alert and Coordination System (GDACS)**。

# Actor input Schema

## `sources` (type: `array`):

Official public feeds to query. All three sources are free, unauthenticated HTTPS APIs. GDACS failure is isolated and never stops USGS or NASA EONET.

## `hazardTypes` (type: `array`):

Unified hazard categories to keep. `all` selects every category. USGS is skipped automatically when `earthquake` is not selected.

## `lookbackDays` (type: `integer`):

How many days back to query. Applies to all three official APIs. Range: 1 to 30.

## `minEarthquakeMagnitude` (type: `number`):

Minimum magnitude for earthquakes. Passed to the USGS FDSN query and also applied locally to USGS and GDACS earthquake records when a magnitude is available.

## `minAlertLevel` (type: `string`):

Unified urgency filter. ALL keeps GREEN, ORANGE, and RED. ORANGE_AND_RED drops GREEN. RED_ONLY keeps only RED. USGS PAGER/magnitude, GDACS alert levels, and conservative EONET derivations are normalized to the same scale.

## `watchLocations` (type: `array`):

Your factories, warehouses, stores, ports, offices, suppliers, or travel destinations. Each hazard is measured against every location with the Haversine formula. Example: \[{"name":"Tokyo Port","lat":35.6329,"lon":139.7753,"radiusKm":300}]. `radiusKm` defaults to 100.

## `onlyMatchingLocations` (type: `boolean`):

When true, hazards outside every `radiusKm` are dropped before dataset writes and before charging. If nothing matches, the run succeeds with zero records and zero 'hazard-returned' charges — ideal for daily n8n/Make schedules. When false, all filtered hazards are returned with distances to every watch location.

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

Maximum hazard records written to the dataset, from 1 to 200. Records are ordered globally by alert level, then nearest watch location, then recency. Charging occurs only for written records.

## `useMockData` (type: `boolean`):

Run against `fixtures/mock_data.json` without any network requests. Normalization, Haversine distances, filtering, deduplication, dataset writes, and pay-per-event charging still execute. Useful for CI and MCP demos.

## Actor input object example

```json
{
  "sources": [
    "usgs",
    "nasa_eonet",
    "gdacs"
  ],
  "hazardTypes": [
    "all"
  ],
  "lookbackDays": 7,
  "minEarthquakeMagnitude": 4.5,
  "minAlertLevel": "ALL",
  "watchLocations": [],
  "onlyMatchingLocations": false,
  "maxResults": 50,
  "useMockData": false
}
```

# Actor output Schema

## `hazards` (type: `string`):

Earthquakes, cyclones, floods, wildfires, volcanoes, droughts, landslides, and other hazards with unified alert levels and supply-chain proximity fields.

## `summary` (type: `string`):

Per-source status, fetched/normalized/matched/returned counts, billing information, zero-charge reason, notes, and source attribution.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jet_elation/global-hazard-supply-chain-radar").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("jet_elation/global-hazard-supply-chain-radar").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 '{}' |
apify call jet_elation/global-hazard-supply-chain-radar --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jet_elation/global-hazard-supply-chain-radar"
        }
    }
}
```

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/ulkew4WlPmODQitIn/builds/CSsgbzTHS16mJ22Hd/openapi.json
