# USGS Water/Streamflow Delta Monitor (`apex-nexus/usgs-water-streamflow-delta-monitor`) Actor

USGS streamflow delta monitor. Alerts on new NWIS instantaneous readings for your watched site. Free when nothing changes, pay per alert. Public USGS data only.

- **URL**: https://apify.com/apex-nexus/usgs-water-streamflow-delta-monitor.md
- **Developed by:** [Valunex](https://apify.com/apex-nexus) (community)
- **Categories:** Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 streamflow alerts

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

## USGS Water / Streamflow Delta Monitor

Monitors the USGS National Water Information System (NWIS) Instantaneous
Values service for streamflow / discharge / gage-height readings matching a
site / parameter watchlist and emits one dataset item (alert) per new reading
since the last run.

### Who it is for

Agricultural and irrigation operators, water utilities, environmental
consultants, flood-insurance underwriters, and recreational outfitters
(rafting/fishing) who need to know when watched streamgages change — without
re-polling USGS NWIS manually.

### What makes it different

Existing Apify Store actors for USGS water data are typically on-demand
fetchers: you query by site/state, get a batch, and run again when you want an
update. This Actor keeps a watchlist and remembers what it already reported, so
repeat runs emit only genuinely new readings — free when nothing changes.

### Data source

Public USGS data only, via the official NWIS Instantaneous Values web service:

- https://waterservices.usgs.gov/nwis/iv/?format=json (keyless, no signup)

No credentials, no proxies, no anti-bot scraping, no commercial inference (no
LLMs) inside the product.

### Pricing (pay-per-event, Apify Store)

- Actor start: $0.0001 per run (one-time)
- New reading (dataset item): $0.005 per reading

Apify retains a 20% commission on revenue; payouts are monthly and require
completed identity verification (KYC).

### Input

See actor/.actor/input_schema.json. Default watchlist: site 01646500 (Potomac
River near Washington DC), parameter 00060 (discharge), last 24 hours.

- `watchlist`: array of `{ site, parameterCd }` entries, max 50, default
  `[{ "site": "01646500", "parameterCd": "00060" }]`.
- `lookbackHours` (1-168, default 24), `maxResultsPerSite` (1-1000,
  default 100), `deliveryWebhookUrl` (optional HTTPS webhook).

### Output

One dataset item per new reading. See actor/.actor/dataset_schema.json. Sample
output item:

```json
{
  "site": "01646500",
  "siteName": "POTOMAC RIVER NEAR WASH, DC LITTLE FALLS PUMP STA",
  "parameterCd": "00060",
  "parameterName": "Streamflow, ft³/s",
  "unitCode": "ft3/s",
  "value": "2350",
  "valueFloat": 2350.0,
  "qualifiers": ["P"],
  "dateTime": "2026-11-01T13:50:00.000-05:00",
  "latitude": 38.94977778,
  "longitude": -77.12763889,
  "newSinceLastRun": true,
  "watchlistMatched": { "site": "01646500", "parameterCd": "00060" },
  "source": "https://waterservices.usgs.gov/nwis/iv/"
}
```

### Limits

- Max 50 watchlist entries per run, 1000 readings per entry per run.
- Checkpoints persist per watchlist entry (site + parameter) in a named Actor
  key-value store; resetting the store re-emits readings within the lookback
  window.

### Verification

Run `pytest actor/tests` before release (builder acceptance criterion).

# Actor input Schema

## `watchlist` (type: `array`):

Each entry watches one USGS site number and parameter code (00060 = discharge/streamflow, 00065 = gage height, ...). Leave empty to use the default watchlist: site 01646500 (Potomac River near Washington DC), parameter 00060 discharge. One checkpoint is kept per entry so repeat runs emit only new readings.

## `lookbackHours` (type: `integer`):

How far back to look for readings on the first run; repeat runs only emit readings newer than the last checked state.

## `maxResultsPerSite` (type: `integer`):

Cap the number of new readings emitted per watchlist entry in a single run.

## `deliveryWebhookUrl` (type: `string`):

Optional HTTPS webhook URL each new reading is POSTed to as JSON as it is detected. Webhook failures are logged and never abort the run.

## Actor input object example

```json
{
  "watchlist": [
    {
      "site": "01646500",
      "parameterCd": "00060"
    }
  ],
  "lookbackHours": 24,
  "maxResultsPerSite": 100,
  "deliveryWebhookUrl": ""
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset items filtered by the overview view defined in the dataset schema.

## `results` (type: `string`):

All dataset items emitted by the Actor run (newly observed USGS instantaneous-value readings).

# 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 = {
    "watchlist": [
        {
            "site": "01646500",
            "parameterCd": "00060"
        }
    ],
    "lookbackHours": 24,
    "maxResultsPerSite": 100,
    "deliveryWebhookUrl": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("apex-nexus/usgs-water-streamflow-delta-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 = {
    "watchlist": [{
            "site": "01646500",
            "parameterCd": "00060",
        }],
    "lookbackHours": 24,
    "maxResultsPerSite": 100,
    "deliveryWebhookUrl": "",
}

# Run the Actor and wait for it to finish
run = client.actor("apex-nexus/usgs-water-streamflow-delta-monitor").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 '{
  "watchlist": [
    {
      "site": "01646500",
      "parameterCd": "00060"
    }
  ],
  "lookbackHours": 24,
  "maxResultsPerSite": 100,
  "deliveryWebhookUrl": ""
}' |
apify call apex-nexus/usgs-water-streamflow-delta-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apex-nexus/usgs-water-streamflow-delta-monitor"
        }
    }
}
```

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/X5Zo8BbF8MTHoWkOO/builds/poViByhGLSlD67kHt/openapi.json
