# USGS Water & Streamflow Scraper — Discharge & Gage Height (`hipersoft/usgs-water-scraper`) Actor

Pull US stream-gauge data from USGS monitoring sites: streamflow (discharge), gage height, water temperature and more, as daily or instantaneous values. Query by site, state or bounding box and export as JSON, CSV or Excel for water management, research and alerts.

- **URL**: https://apify.com/hipersoft/usgs-water-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0001 / observation scraped

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/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 Scraper — Discharge & Gage Height

Pull **US stream-gauge data** straight from USGS monitoring sites with the **USGS Water & Streamflow Scraper**. Get **streamflow (discharge), gage height, water temperature and more** — as daily or instantaneous values — for any site, state or map area, and export each reading as **JSON, CSV or Excel**.

Built for **water and reservoir management, flood and drought monitoring, hydrological research, and recreation apps (paddling, fishing, rafting)**, it turns the national water-monitoring network into a clean, tabular dataset.

### What it does

- 🌊 **Streamflow & stage** — discharge (ft³/s), gage height (ft), water temperature and other parameters.
- 🗺️ **Query any way** — by site number, by US state, or by a bounding-box map area.
- 🕒 **Daily or instantaneous** — one value per day, or sub-hourly readings for a recent period.
- 🧱 **Tidy rows** — one row per observation with site, parameter, value, unit and timestamp.
- 📍 **Site coordinates** — latitude/longitude for every monitoring site.
- 📤 **Export anywhere** — JSON, CSV or Excel, or straight into an alert, model or dashboard.

### Example output

```json
{
  "site": "01646500",
  "siteName": "POTOMAC RIVER NEAR WASH, DC LITTLE FALLS PUMP STA",
  "latitude": 38.9497,
  "longitude": -77.1278,
  "parameterCode": "00060",
  "parameter": "Streamflow, ft³/s",
  "value": 5750,
  "unit": "ft³/s",
  "dateTime": "2024-06-01T00:00:00.000"
}
```

### How to use it

1. Enter **site numbers**, or a **state code**, or a **bounding box**.
2. Choose the **parameters** (discharge, gage height…) and **daily** or **instantaneous** values.
3. Set a **date range** or **period**, run, and download as **JSON, CSV or Excel**.

### Input fields

| Field | Description |
|-------|-------------|
| **Site numbers** | USGS site numbers to fetch (e.g. 01646500). |
| **State code** | Two-letter US state to fetch all matching sites (md, ca…). |
| **Bounding box** | west,south,east,north degrees for a map area. |
| **Parameter codes** | 00060 discharge, 00065 gage height, 00010 temperature, and more. |
| **Data service** | Daily values or instantaneous (sub-hourly) values. |
| **Start / End date** | Explicit date range as YYYY-MM-DD. |
| **Period** | Relative window (P7D, P1M…) when no date range is set. |
| **Max observations** | Cap on total rows (0 = no limit). |

### Output fields

`site`, `siteName`, `latitude`, `longitude`, `parameterCode`, `parameter`, `parameterDescription`, `value`, `unit`, `dateTime`, `qualifiers`.

### Popular use cases

- **Flood & drought monitoring** — track discharge and stage against thresholds.
- **Water & reservoir management** — feed live flow into operations dashboards.
- **Research & modeling** — build long streamflow time series for any basin.
- **Recreation apps** — surface current flow for paddling, fishing and rafting.
- **Alerts** — notify when a gauge rises or falls past a set level.

### FAQ

**Do I need an account or key?**
No. Enter your sites or area and run.

**What parameters can I get?**
Discharge (00060), gage height (00065), water temperature (00010) and many other USGS parameter codes.

**Daily or instantaneous?**
Daily gives one value per day over long ranges; instantaneous gives sub-hourly readings for a recent period.

**How do I find site numbers?**
Query by state or bounding box to discover sites, then reuse their site numbers for targeted pulls.

**Can I export to Excel or Google Sheets?**
Yes — results download as JSON, CSV or Excel and integrate with alerts, models and dashboards.

***

Structured **USGS streamflow and water data** — discharge, gage height and more by site, state or area — clean and export-ready for water management, research and alerts.

# Actor input Schema

## `sites` (type: `array`):

USGS site numbers to fetch, one per line (e.g. 01646500 for the Potomac near Washington, DC). Provide this OR a State / Bounding box below.

## `stateCd` (type: `string`):

Two-letter US state code to fetch all matching sites (e.g. md, ca, tx). Used only when no site numbers are given.

## `bBox` (type: `string`):

Bounding box as west,south,east,north decimal degrees (e.g. -83.0,36.5,-81.0,38.5). Used only when no site numbers or state are given. Keep it small — the source limits very large boxes.

## `parameterCd` (type: `string`):

USGS parameter codes, comma-separated. Common: 00060 = discharge (streamflow, ft³/s), 00065 = gage height (ft), 00010 = water temperature (°C), 00300 = dissolved oxygen, 00095 = specific conductance.

## `service` (type: `string`):

Daily values (one value per day) or Instantaneous values (sub-hourly readings, recent period only).

## `startDate` (type: `string`):

First day, as YYYY-MM-DD. Set together with End date for an explicit range; otherwise the Period below is used.

## `endDate` (type: `string`):

Last day, as YYYY-MM-DD.

## `period` (type: `string`):

Relative period ending now when no date range is set, ISO-8601 duration (e.g. P7D = last 7 days, P1M = last month, P1D = last day).

## `maxItems` (type: `integer`):

Maximum observation rows to collect (0 = no limit).

## Actor input object example

```json
{
  "sites": [
    "01646500"
  ],
  "stateCd": "",
  "bBox": "",
  "parameterCd": "00060,00065",
  "service": "dv",
  "startDate": "",
  "endDate": "",
  "period": "P7D",
  "maxItems": 0
}
```

# Actor output Schema

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

The results as dataset items.

# 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 = {
    "sites": [
        "01646500"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/usgs-water-scraper").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 = { "sites": ["01646500"] }

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/usgs-water-scraper").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 '{
  "sites": [
    "01646500"
  ]
}' |
apify call hipersoft/usgs-water-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/usgs-water-scraper"
        }
    }
}
```

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/AcxQPFUkQJ7emwmB7/builds/kn7kavWnvmpniZkJH/openapi.json
