npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

usa-dam-data

v1.0.0

Published

A modern, developer-first Node.js SDK for accessing United States dam, lake, reservoir, and water level data for free.

Downloads

155

Readme

🌊 DamAPI (usa-dam-data)

A modern, developer-first Node.js SDK and database for accessing publicly available United States dam, lake, reservoir, and water level data for free.

CI License Node.js TypeScript Open Source

A lightweight Node.js SDK designed to make U.S. dam and reservoir data easy to access, search, analyze, and integrate into applications.

Whether you're building dashboards, environmental tools, GIS applications, AI agents, research software, or monitoring systems, DamAPI provides a clean developer experience over publicly available datasets.

🌐 Website / Docs: https://kakahaja07.github.io/damapi/


✨ Features

  • 🇺🇸 349+ United States dams & lakes database
  • 🌊 Real-time water level data & full pool measurements
  • 📊 Storage & level differences
  • 📍 Search & filter by state (e.g. Texas, TX, California, CA)
  • 🔎 Fuzzy search by dam or lake name
  • 📈 Historical datasets for individual lakes
  • 📊 Dataset analytics & summary statistics (getStats())
  • 🔄 On-demand live scraper & auto updates (fetchLive())
  • 📦 Full TypeScript support (index.d.ts)
  • ⚡ Fast, zero-config JSON responses
  • ❤️ Open Source & Free

Installation

npm install usa-dam-data

or

yarn add usa-dam-data

or

pnpm add usa-dam-data

Requirements

  • Node.js 18+
  • npm 9+

Quick Start

const { DamAPI } = require("usa-dam-data");

const api = new DamAPI();

// Get all dams
const dams = api.getDams();
console.log(`Loaded ${dams.length} dams!`);

// Search dams in Texas
const texasLakes = api.getByState("Texas");
console.log(texasLakes);

ESM / TypeScript import

import { DamAPI, Dam } from "usa-dam-data";

const api = new DamAPI();
const dams: Dam[] = api.getDams();

Examples

Get All Dams

const dams = api.getDams();

Search by State

// Accepts full state name or 2-letter postal code
const texas = api.getByState("Texas");
const california = api.getByState("CA");

Search by Name

const matches = api.search("Alamo");

Get Dam by ID

const dam = api.get("alamo");

Get Dataset Statistics

const stats = api.getStats();
console.log(stats);
/*
{
  totalDams: 349,
  totalLakes: 349,
  statesCovered: [ 'AK', 'AL', 'AR', 'AZ', 'CA', 'CO', ... ],
  totalStates: 36,
  averageLevel: 985.42,
  highestLevel: 6710.2,
  lowestLevel: -12.4,
  lastUpdated: '2026-07-29T06:28:23.430Z'
}
*/

Get Historical Data for a Lake

const history = api.getHistory("alamo");
console.log(history.readings);

Live Fetch / Update Data

// Fetch latest live levels directly from upstream data source
await api.fetchLive();

Example Response Object

{
  "id": "alamo",
  "name": "Alamo",
  "state": "ARIZONA",
  "stateCode": "AZ",
  "river": null,
  "latitude": null,
  "longitude": null,
  "owner": "USACE / Local Water Authority",
  "currentLevel": 1100.6,
  "fullPool": 1129,
  "difference": -28.4,
  "waterLevel": {
    "value": 1100.6,
    "unit": "ft"
  },
  "fullPoolLevel": {
    "value": 1129,
    "unit": "ft"
  },
  "lastUpdated": {
    "date": "7/28/2026",
    "time": "9:00"
  },
  "updatedAt": "2026-07-29T06:28:23.430Z"
}

API Reference

new DamAPI(options?)

Initializes the SDK. Options include { dataFile?, historyDir?, autoLoad? }.

getDams(filter?) / getLakes(filter?)

Returns array of dams. Supports filtering: { state, sort, order, limit }.

get(idOrName)

Returns a single dam object by sanitized ID or exact name.

search(query)

Fuzzy search across dam names.

getByState(state)

Filters dams by state name or 2-letter postal code.

getByRiver(river)

Filters dams by river or river keyword.

getStats()

Returns analytics summary including state counts, average water level, highest/lowest levels.

getHistory(lakeNameOrId)

Loads historical readings for a specific dam/lake.

fetchLive()

Scrapes real-time water level data from source and updates local storage.


Development & Testing

# Clone the repository
git clone https://github.com/Kakahaja07/damapi.git

# Install dependencies
npm install

# Run tests
npm test

# Run live data updater
npm run update-data

Roadmap

  • [x] Dam database & JSON storage
  • [x] Search & Filter API
  • [x] TypeScript SDK definitions
  • [x] Historical water level readings
  • [x] Dataset statistics & analytics
  • [ ] REST API server endpoint
  • [ ] Daily automated GitHub Action workflow snapshots
  • [ ] CLI tools (npx usa-dam-data search <name>)

Data Sources

DamAPI is built using publicly available data from United States government agencies and other public resources where permitted.


Disclaimer

DamAPI is an independent open-source project. It is not affiliated with, endorsed by, sponsored by, or associated with any government organization.


License

MIT License. See LICENSE file.


Author

Prashant Sharma

  • GitHub: https://github.com/Kakahaja07
  • Website: https://kakahaja07.github.io/damapi/