usgs-water-iv-fetch
Installation
SKILL.md
USGS Water IV Fetch
Core Goal
- Fetch USGS Water Services
ivdata for one bounding box or explicit site list. - Keep the call atomic: one request, one structured JSON payload, no follow-up site-discovery chain required.
- Return site metadata plus flattened time-series records that downstream normalization can map into hydrology observations.
- Keep runtime deterministic with retries, throttling, response-size caps, and validation summaries.
Repository Policy
- This is the canonical USGS station-hydrology skill in this repository.
- When eco-council or OpenClaw assigns a raw artifact path, write this skill's full JSON payload to that exact path with
--output. - Do not treat dry-run output as collected evidence.
Required Environment
- Configure runtime by environment variables in
references/env.md. - Start from
assets/config.example.env. - Load env values before running commands:
set -a
source assets/config.example.env
set +a
Workflow
- Validate effective configuration.
python3 scripts/usgs_water_iv_fetch.py check-config --pretty
- Dry-run the query plan first.
python3 scripts/usgs_water_iv_fetch.py fetch \
--bbox=-77.3,38.8,-77.0,39.1 \
--period P1D \
--parameter-code 00060 \
--parameter-code 00065 \
--site-type ST \
--site-status active \
--dry-run \
--pretty
- Run one time-window fetch and write the payload.
python3 scripts/usgs_water_iv_fetch.py fetch \
--bbox=-77.3,38.8,-77.0,39.1 \
--start-datetime 2026-03-21T00:00:00Z \
--end-datetime 2026-03-22T23:59:59Z \
--parameter-code 00060 \
--parameter-code 00065 \
--site-type ST \
--site-status active \
--output ./data/usgs-water-iv.json \
--pretty
- Optional explicit-site fetch when the mission already knows site numbers.
python3 scripts/usgs_water_iv_fetch.py fetch \
--site 01646500 \
--site 01646000 \
--period P1D \
--parameter-code 00060 \
--parameter-code 00065 \
--output ./data/usgs-water-iv-sites.json \
--pretty
Output Record Shape
Each item in records is one site-parameter-timestamp observation with fields:
site_number,site_name,agency_codesite_type,state_code,county_code,huc_codelatitude,longitudeparameter_code,variable_name,variable_description,unitobserved_at_utc,valuequalifiers,provisionalsource_query_url
Scope Boundaries
- This skill targets the USGS Water Services
Instantaneous Valuesendpoint only. - This skill does not infer flood thresholds, return periods, or policy meaning.
- This skill does not geocode place names.
- This skill does not need an API key.
- This skill supports
file://base URLs for deterministic local fixture testing.
References
references/env.mdreferences/usgs-water-iv-api-notes.mdreferences/usgs-water-iv-limitations.mdreferences/openclaw-chaining-templates.md
Script
scripts/usgs_water_iv_fetch.py