
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@pondlog/source-usgs
Advanced tools
USGS Water Services (NWIS) API client: typed, Zod-validated, polite-rate-limited. Real-time and daily streamflow, gage height, and site metadata. Returns Result<T> instead of throwing.
USGS Water Services (NWIS) API client. Typed, Zod-validated, politely
rate-limited. Returns Result<T> instead of throwing.
Base URL: https://waterservices.usgs.gov/nwis/. No API key required.
Part of pondlog.
npm install @pondlog/source-usgs
| Function | Description |
|---|---|
getInstantaneousValues({ sites, parameterCodes?, period? }) | Real-time gauge readings (typically 15-min cadence). Defaults to discharge + gage height for the last 2 hours. |
getDailyValues({ sites, parameterCodes?, period?, startDt?, endDt?, statisticCodes? }) | Daily statistics. Use period for relative-to-now or startDt/endDt for historic. Defaults to discharge mean for the last 7 days. |
getSiteInfo({ siteNumber }) | Site metadata (name, coordinates, HUC, state, altitude). |
searchSites({ bbox?, stateCode?, hucCode?, siteType?, hasDataTypeCode? }) | Find sites by bounding box, US state, or hydrologic unit. Default siteType: "ST" (streams) and hasDataTypeCode: "iv" (live data). |
All functions return Result<T> from @pondlog/core.
bboxAround(coords, radiusKm): square bbox tuple around a point, ready for searchSites({ bbox }).PARAMETER_CODES: common USGS parameter constants (DISCHARGE, GAGE_HEIGHT, WATER_TEMP_C).| Code | Meaning | Unit |
|---|---|---|
| 00060 | Discharge / streamflow | ft³/s |
| 00065 | Gage height | ft |
| 00010 | Water temperature | °C |
/iv/ (instantaneous) does not accept historic startDT/endDT. It
returns HTTP 301. Use period (relative-to-now) for /iv/, or getDailyValues
for historic data.timeSeries: [] rather than an error. The
client surfaces this as ok: true with an empty array.-999999.0. The client translates this to
undefined so consumers never see the sentinel./site/ only returns RDB (tab-delimited); JSON is unsupported. The client
parses RDB internally and returns normalized objects.MIT.
FAQs
USGS Water Services (NWIS) API client: typed, Zod-validated, polite-rate-limited. Real-time and daily streamflow, gage height, and site metadata. Returns Result<T> instead of throwing.
The npm package @pondlog/source-usgs receives a total of 10 weekly downloads. As such, @pondlog/source-usgs popularity was classified as not popular.
We found that @pondlog/source-usgs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.