Skip to content
MagnexisPublic

About

Water-aware infrastructure API for estimating data center water usage and WUE

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AquaStat logo

CI Docs Release License OpenAPI 3.1 Render Live CLI included

AquaStat API

AquaStat is a transparent data-center water intelligence API.

It combines public-style facility records, environmental disclosures, planning-document patterns, utility context, cooling-system metadata, grid characteristics, and estimation models to evaluate the direct and indirect water footprint of data centers.

Every result distinguishes documented, parsed, inferred, and estimated values and includes provenance, confidence, assumptions, and model versions.

AquaStat also distinguishes whether a published water figure is metered, officially reported, corroborated, derived, modeled, unverified, or unknown. It does not collapse permit maxima, projections, derived calculations, and measured values into the same category.

The repository also now includes:

  • a lawful public-record request template workflow for facilities
  • a typed source-connector registry
  • benchmark validation fixtures for water-accounting formulas
  • a strict TypeScript desktop foundation in desktop/

Limitation: AquaStat is a research and estimation platform. Facility records may be synthetic, incomplete, conflicting, outdated, or based on public-planning-style documents rather than verified operational measurements. AquaStat results are not regulatory findings or audited disclosures.

Control Center: https://aquastat-api.onrender.com/api/v1/control-center

Production API: https://aquastat-api.onrender.com

Interactive documentation: https://aquastat-api.onrender.com/docs

OpenAPI: https://aquastat-api.onrender.com/openapi.json

OpenAPI YAML: https://aquastat-api.onrender.com/openapi.yaml

Health: https://aquastat-api.onrender.com/health

GitHub Pages: https://magnexis.github.io/aquastat/

GitHub Pages OpenAPI: https://magnexis.github.io/aquastat/openapi.json

GitHub Pages OpenAPI YAML: https://magnexis.github.io/aquastat/openapi.yaml

Desktop App Preview

The repository includes a local-first TypeScript desktop shell for facility review and public-record workflows.

AquaStat desktop overview

AquaStat desktop public records and contradiction review

Command Line Preview

aquastat is now a real CLI for status checks, facility browsing, estimate lookups, and workload routing.

aquastat status
aquastat regions
aquastat estimate --provider aws --region us-east-1 --load-mw 2.5
aquastat facilities --query ashburn
aquastat route-workload --job-duration-hours 4 --compute-demand-mwh 12.5 \
  --candidate-region aws:us-east-1 \
  --candidate-region aws:eu-west-1 \
  --candidate-region gcp:asia-southeast1

What Problem It Solves

Cloud infrastructure decisions are usually optimized around latency, cost, and carbon. AquaStat adds water awareness by modeling how weather, cooling design, and regional water stress affect operational water impact.

Key Capabilities

  • Estimate instantaneous water use for supported cloud regions
  • Search synthetic Phase 3 facility records with evidence, sources, and history
  • Generate facility-based estimates from source-linked registry records
  • Use the AquaStat Control Center for overview metrics, calculations, facilities, request diagnostics, and API-key operations
  • Model wet-bulb-driven WUE changes
  • Rank workload destinations by water and carbon impact
  • Expose GeoJSON stress-map outputs
  • Parse billing CSVs into water-footprint estimates
  • Provide OpenAPI docs, Postman assets, and deployable infrastructure

Authentication

Protected endpoints accept either:

X-API-Key: aq_live_your_key

or:

Authorization: Bearer aq_live_your_key

Generate a key locally:

python scripts/generate_api_key.py

Store the resulting hash in:

AQUASTAT_API_KEY_HASHES=generated_hash_here
AQUASTAT_ADMIN_API_KEY_HASHES=generated_admin_hash_here

Managed control-center keys support scoped access such as calculations:read, calculations:write, facilities:read, facilities:write, and usage:read. Environment-level keys configured through AQUASTAT_API_KEY_HASHES remain full-access operator keys.

Quick Start

cURL

curl -sS "$AQUASTAT_BASE_URL/api/v1/estimate?provider=aws&region=us-east-1&load_mw=2.5" \
  -H "X-API-Key: aq_live_your_key"

JavaScript

const response = await fetch(
  `${process.env.AQUASTAT_BASE_URL}/api/v1/estimate?provider=aws&region=us-east-1&load_mw=2.5`,
  { headers: { "X-API-Key": process.env.AQUASTAT_API_KEY } }
);
console.log(await response.json());

Python

import os
import httpx

response = httpx.get(
    f"{os.environ['AQUASTAT_BASE_URL']}/api/v1/estimate",
    params={"provider": "aws", "region": "us-east-1", "load_mw": 2.5},
    headers={"X-API-Key": os.environ["AQUASTAT_API_KEY"]},
    timeout=10.0,
)
print(response.json())

Main Endpoints

  • GET /health
  • GET /api/v1/status
  • GET /api/v1/info
  • GET /api/v1/regions
  • GET /api/v1/estimate
  • GET /api/v1/facilities
  • GET /api/v1/facilities/{facilityId}
  • POST /api/v1/facilities/{facilityId}/estimate
  • GET /control-center
  • GET /health/live
  • GET /health/ready
  • GET /version
  • GET /api/v1/stress-map
  • GET /api/v1/benchmark
  • POST /api/v1/route-workload
  • POST /api/v1/footprint
  • compatibility routes also remain under /api/v2

Rate Limits

  • Anonymous: 60 requests/hour
  • Developer API key: 10,000 requests/day
  • Standard headers: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, Retry-After

See docs/rate-limits.md.

Control Center

Open the backend-served control center at /control-center. It uses AquaStat endpoints directly for:

  • overview metrics
  • interactive estimate submission
  • facility inspection
  • request explorer
  • model registry inspection
  • managed API key actions for operators with an admin API key

Error Format

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable message",
    "requestId": "unique-request-id"
  }
}

Local Development

API setup

python -m venv .venv
. .venv/Scripts/activate
pip install -e .[dev]
python scripts/generate_openapi.py
python scripts/build_docs_site.py
uvicorn app.main:app --host 0.0.0.0 --port 8080

Run tests:

pytest

CLI setup

The CLI is installed with the main Python package:

pip install -e .[dev]
aquastat status

Useful flags:

  • --base-url to point at a local or hosted AquaStat API
  • --api-key to use a protected endpoint
  • --json for machine-readable output

Desktop app setup

The desktop shell expects the API to be running locally at http://127.0.0.1:8080.

cd desktop
npm install
npm run build

Then open the compiled shell in a browser or lightweight desktop wrapper:

  1. Start the API locally.
  2. Build the desktop package with npm run build.
  3. Open desktop/index.html in your preferred local wrapper or browser.
  4. Use DESKTOP_APP.md for the desktop-specific workflow notes.

Render Deployment

Current hosted status: Render deployment is live and verified at https://aquastat-api.onrender.com.

To enable durable control-center state in production, install the normal database dependencies and apply sql/schema.sql before expecting request history, managed keys, and audit events to persist across restarts.

Docker

docker build -t aquastat-api .
docker run --rm -p 8080:8080 --env-file .env aquastat-api

Postman and OpenAPI

Examples

See examples.

GitHub Pages

Build the static technical docs artifact locally with:

python scripts/build_docs_site.py

The Pages guide is in GITHUB_PAGES.md.

Security Reporting

See SECURITY.md.

Contributing

See CONTRIBUTING.md.

License

Server: LICENSE
SDKs: Apache-2.0 under sdk/LICENSE

Support

Use GitHub Issues for bugs, documentation gaps, and feature requests.

About

Water-aware infrastructure API for estimating data center water usage and WUE

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages