# Dam Safety Risk Monitor — USACE National Inventory of Dams (`malonestar/nid-dam-risk-monitor`) Actor

Monitor US dam safety risk from the USACE National Inventory of Dams. Filter 92k+ dams by state, hazard potential, condition and owner; get a composite risk score from hazard, condition and inspection staleness, plus missing-EAP flags. For insurers, engineers and due diligence.

- **URL**: https://apify.com/malonestar/nid-dam-risk-monitor.md
- **Developed by:** [Kyle Maloney](https://apify.com/malonestar) (community)
- **Categories:** Lead generation, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Dam Safety Risk Monitor — USACE National Inventory of Dams (NID)

Search and monitor **92,000+ US dams** from the US Army Corps of Engineers **National Inventory of Dams** and get a normalized, analysis-ready record per dam with a **composite risk score** built from three signals regulators track: **hazard potential**, **latest condition assessment**, and **inspection staleness** — plus flags for dams with **no Emergency Action Plan (EAP)** on file.

No API key, no scraping fragile HTML: data comes straight from the official USACE NID ArcGIS service.

### Who this is for

- **P&C insurers and reinsurers** — underwrite flood and property exposure downstream of high-hazard dams; screen a book of locations against poor-condition, overdue-inspection dams.
- **Dam-safety and civil engineers** — build state watchlists of High-hazard dams in Poor/Unsatisfactory condition or with stale inspections.
- **Infrastructure due-diligence and real-estate risk teams** — check dams near an asset, portfolio, or development site before acquisition.
- **Journalists, researchers, and emergency managers** — track dams missing Emergency Action Plans, county by county.

### What it does

1. Queries the USACE NID FeatureServer (keyless, official) with your state / hazard / condition / owner filters.
2. Normalizes each dam into a clean snake_case record (trimmed names, ISO dates, parsed county).
3. Computes `risk_score` = hazard weight (High 10 / Significant 5 / Low 1) × condition weight (Unsatisfactory 3.5 / Poor 3 / Fair 2 / Satisfactory 1) × inspection-staleness factor (1.0 fresh → 3.0 at 20+ years), + 5 when no current EAP. Range ≈ 1–110.
4. Adds machine-readable `risk_flags` such as `high_hazard_poor_condition`, `inspection_stale_10yr`, `eap_missing`.
5. Optional client-side screens: `minRiskScore` and `requireMissingEap`.

### Example input

```json
{
  "states": ["CO"],
  "hazardPotential": ["High"],
  "conditionAssessment": ["Poor", "Unsatisfactory"],
  "minRiskScore": 40,
  "requireMissingEap": false,
  "maxResults": 500
}
````

States accept postal codes (`CO`) or full names (`Colorado`). Leave `states` empty to scan the whole country (bounded by `maxResults`).

### Output fields (one record per dam)

`nid_id`, `federal_id`, `name`, `state`, `county`, `city`, `river`, `latitude`, `longitude`, `owner_type`, `primary_purpose`, `primary_dam_type`, `dam_height_ft`, `max_storage_acre_ft`, `year_completed`, `hazard_potential`, `condition_assessment`, `condition_assess_date`, `last_inspection_date`, `inspection_age_years`, `inspection_frequency_years`, `eap_status`, `eap_last_rev_date`, `operational_status`, `risk_score`, `risk_flags[]`, `data_updated`, `source_url`

### Use as an MCP tool

This actor works as a clean, chainable **MCP tool** for AI agents (Claude, Cursor, etc.) via `mcp.apify.com` — the input and every output field are fully described, so an agent can query "high-hazard poor-condition dams in Texas without an EAP" unassisted.

### Monitoring

Schedule it (e.g. weekly per state) and diff `risk_score`, `condition_assessment`, and `eap_status` between runs to catch downgraded dams the day the inventory updates.

### FAQ

**How many high hazard dams are in my state?** Run with `states=["<your state>"]`, `hazardPotential=["High"]` — the dataset count is the answer, each row a dam.

**Which dams near me are in poor condition?** Filter your state with `conditionAssessment=["Poor","Unsatisfactory"]`, then sort by `risk_score` or filter by county.

**Which dams have no emergency action plan?** Set `requireMissingEap: true`. High-hazard dams without an EAP are the classic regulatory red flag.

**Is the National Inventory of Dams free / do I need an API key?** Yes, free and keyless — this actor reads the official USACE public ArcGIS service directly.

**How is the dam risk score calculated?** Hazard × condition × years-since-inspection, plus an EAP penalty — see "What it does" above; `risk_flags` explains every contributing factor per dam.

**How current is the data?** The NID is updated continuously by USACE and state regulators; each record carries its `data_updated` date.

# Actor input Schema

## `states` (type: `array`):

US states to search, as 2-letter postal codes (CO, TX) or full names (Colorado). Leave empty to search the whole national inventory (bounded by Max results). Note: the NID API stores full state names; codes are converted automatically.

## `hazardPotential` (type: `array`):

Filter by downstream hazard potential classification. Valid values: High, Significant, Low, Undetermined. Leave empty for all hazard classes.

## `conditionAssessment` (type: `array`):

Filter by latest condition assessment. Valid values: Unsatisfactory, Poor, Fair, Satisfactory, Not Available. Leave empty for all conditions.

## `ownerType` (type: `array`):

Filter by primary owner type. Valid values: Federal, State, Local Government, Public Utility, Private, Not Listed. Leave empty for all owners.

## `minRiskScore` (type: `integer`):

Only output dams whose composite risk\_score is at least this value (scale roughly 1 = low-hazard/satisfactory/freshly inspected to 110 = high-hazard/unsatisfactory/20+ years uninspected/no EAP). Leave empty to output all matching dams.

## `requireMissingEap` (type: `boolean`):

If true, only output dams that do NOT have an Emergency Action Plan on record (EAP missing, not required, or not available).

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

Maximum number of dam records to output (each record is one billed result). The full inventory is ~92,000 structures, so keep this bounded.

## Actor input object example

```json
{
  "states": [
    "CO"
  ],
  "hazardPotential": [
    "High"
  ],
  "requireMissingEap": false,
  "maxResults": 500
}
```

# Actor output Schema

## `dataset` (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 = {
    "states": [
        "CO"
    ],
    "hazardPotential": [
        "High"
    ],
    "maxResults": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("malonestar/nid-dam-risk-monitor").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 = {
    "states": ["CO"],
    "hazardPotential": ["High"],
    "maxResults": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("malonestar/nid-dam-risk-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "states": [
    "CO"
  ],
  "hazardPotential": [
    "High"
  ],
  "maxResults": 500
}' |
apify call malonestar/nid-dam-risk-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=malonestar/nid-dam-risk-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Dam Safety Risk Monitor — USACE National Inventory of Dams",
        "description": "Monitor US dam safety risk from the USACE National Inventory of Dams. Filter 92k+ dams by state, hazard potential, condition and owner; get a composite risk score from hazard, condition and inspection staleness, plus missing-EAP flags. For insurers, engineers and due diligence.",
        "version": "1.0",
        "x-build-id": "ga6EoavexH48sCS0T"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/malonestar~nid-dam-risk-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-malonestar-nid-dam-risk-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/malonestar~nid-dam-risk-monitor/runs": {
            "post": {
                "operationId": "runs-sync-malonestar-nid-dam-risk-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/malonestar~nid-dam-risk-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-malonestar-nid-dam-risk-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "states": {
                        "title": "States",
                        "type": "array",
                        "description": "US states to search, as 2-letter postal codes (CO, TX) or full names (Colorado). Leave empty to search the whole national inventory (bounded by Max results). Note: the NID API stores full state names; codes are converted automatically.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "hazardPotential": {
                        "title": "Hazard potential",
                        "type": "array",
                        "description": "Filter by downstream hazard potential classification. Valid values: High, Significant, Low, Undetermined. Leave empty for all hazard classes.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "conditionAssessment": {
                        "title": "Condition assessment",
                        "type": "array",
                        "description": "Filter by latest condition assessment. Valid values: Unsatisfactory, Poor, Fair, Satisfactory, Not Available. Leave empty for all conditions.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "ownerType": {
                        "title": "Owner type",
                        "type": "array",
                        "description": "Filter by primary owner type. Valid values: Federal, State, Local Government, Public Utility, Private, Not Listed. Leave empty for all owners.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "minRiskScore": {
                        "title": "Minimum risk score",
                        "minimum": 0,
                        "maximum": 110,
                        "type": "integer",
                        "description": "Only output dams whose composite risk_score is at least this value (scale roughly 1 = low-hazard/satisfactory/freshly inspected to 110 = high-hazard/unsatisfactory/20+ years uninspected/no EAP). Leave empty to output all matching dams."
                    },
                    "requireMissingEap": {
                        "title": "Only dams without a current EAP",
                        "type": "boolean",
                        "description": "If true, only output dams that do NOT have an Emergency Action Plan on record (EAP missing, not required, or not available).",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum number of dam records to output (each record is one billed result). The full inventory is ~92,000 structures, so keep this bounded.",
                        "default": 1000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
