# USGS Groundwater Daily — Well Level History (`zinin/usgs-groundwater-daily`) Actor

Get official USGS daily groundwater-level history by well and date range, including statistic, value, unit and approval status. No API key required for bounded requests.

- **URL**: https://apify.com/zinin/usgs-groundwater-daily.md
- **Developed by:** [Tim Zinin](https://apify.com/zinin) (community)
- **Categories:** Other
- **Features:** Limited permissions
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Groundwater Daily

Retrieve official daily groundwater-level observations for selected wells and a date range from the USGS Water Data OGC API. The Actor returns analysis-ready rows with the statistic, level, unit, approval status, coordinates, and provenance. It uses no proxy, browser, scraping, or customer API key.

### Use cases

- Compare groundwater history with irrigation demand, rainfall, or crop performance.
- Track long-term changes in aquifers and wells.
- Load approved and provisional USGS observations into GIS, BI, or data pipelines.
- Audit a model or report using exact source values and retrieval timestamps.

### Input

| Field | Required | Description |
|---|---|---|
| `wellIds` | Yes | Up to 20 complete monitoring-location IDs, including the agency prefix. |
| `startDate` | Yes | Inclusive `YYYY-MM-DD` start. |
| `endDate` | Yes | Inclusive end, at most 3,660 days after the start. |
| `maxItems` | No | Global observation limit, 1–1,000 (default 100). |

The Actor always requests USGS parameter `72019`. It performs sequential, polite API requests and stops at `maxItems`.

#### Input example

```json
{"wellIds":["MO005-375625091480401"],"startDate":"1984-05-01","endDate":"1984-05-31","maxItems":20}
```

### Output

`sourceValue` preserves the API decimal string while `value` is numeric. Codes `00001`, `00002`, and `00003` are labeled maximum, minimum, and mean.

```json
{"found":true,"wellId":"MO005-375625091480401","date":"1984-05-21","parameterCode":"72019","statisticCode":"00003","statistic":"mean","value":169.21,"sourceValue":"169.21","unit":"ft","approvalStatus":"Approved","qualifier":null,"retrievedAt":"2026-11-10T20:00:00.000Z","source":"U.S. Geological Survey","sourceUrl":"https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?..."}
```

No-data and request-failure records have `found:false` and are not billed as `result-found` events.

### Pricing

**$0.003 per daily groundwater value (`result-found`) on the Free plan, with automatic discounts on paid Apify plans: Bronze −5%, Silver −10%, Gold −15%, Platinum −18%, Diamond −20%. A small Actor start event ($0.002) applies per run**

Successful observations use the `result-found` event. Empty and error rows are free. Remaining run budget is checked immediately before every paid row.

### Limitations

- Only daily parameter `72019` is supported; the Actor does not discover wells or translate bare site numbers.
- USGS can revise records. `Provisional` observations are subject to revision; inspect `approvalStatus` and `lastModified`.
- Results are capped at 1,000 rows and 3,660 days. Use USGS bulk facilities for larger research jobs.
- Availability depends on the official API. Requests time out and only 429/5xx failures receive bounded retries.
- The API host's robots policy asks bulk automated clients to use an API key and disallows generic crawlers on item routes. This is a bounded official-API client, not an HTML crawler. For bulk retrieval, obtain a key and use USGS directly.

### Source, attribution, and terms

Data comes from the [USGS Water Data OGC API](https://api.waterdata.usgs.gov/ogcapi/v0/). Every row credits **U.S. Geological Survey** and includes the exact request URL and retrieval time.

USGS-authored information is generally in the U.S. public domain, although third-party material may not be. USGS requests proper credit such as “Credit: U.S. Geological Survey.” Review its [copyrights and credits](https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits), [credit guidance](https://www.usgs.gov/information-policies-and-instructions/acknowledging-or-crediting-usgs), and [provisional data statement](https://waterdata.usgs.gov/provisional-data-statement/). This Actor is not affiliated with or endorsed by USGS.

### Related Actors

- [usgs-streamflow-latest](https://apify.com/zinin/usgs-streamflow-latest)
- [us-nws-point-forecast](https://apify.com/zinin/us-nws-point-forecast)
- [noaa-metar-weather-extractor](https://apify.com/zinin/noaa-metar-weather-extractor)

# Actor input Schema

## `wellIds` (type: `array`):

USGS Water Data monitoring-location IDs. Use the full ID, including its agency prefix.

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

Inclusive first observation date (YYYY-MM-DD).

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

Inclusive last observation date (YYYY-MM-DD), no more than 3,660 days after the start.

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

Global maximum number of observation rows across all wells.

## Actor input object example

```json
{
  "wellIds": [
    "MO005-375625091480401"
  ],
  "startDate": "1984-05-01",
  "endDate": "1984-05-31",
  "maxItems": 20
}
```

# Actor output Schema

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

API URL for this run's default 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 = {
    "wellIds": [
        "MO005-375625091480401"
    ],
    "startDate": "1984-05-01",
    "endDate": "1984-05-31",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("zinin/usgs-groundwater-daily").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 = {
    "wellIds": ["MO005-375625091480401"],
    "startDate": "1984-05-01",
    "endDate": "1984-05-31",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("zinin/usgs-groundwater-daily").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 '{
  "wellIds": [
    "MO005-375625091480401"
  ],
  "startDate": "1984-05-01",
  "endDate": "1984-05-31",
  "maxItems": 20
}' |
apify call zinin/usgs-groundwater-daily --silent --output-dataset

```

## MCP server setup

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

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/Ah9dX32Q9tnQCjE6B/builds/JxgBgXxAkzKT6PWTU/openapi.json
