Water-Accounting / Processing API
v3.0.0 · 39 endpoints 2 basins loaded OpenAPI 2.0 · Flask · MySQL 8

IWMI Water-Accounting Processing API

Basin-scale water accounting, served as a clean REST API. Built on the IWMI Water Accounting Plus (WA+) framework — rainfall, evapotranspiration, blue/green water, land use, basin closure, environmental water stress — derived from satellite remote sensing, hydrological modelling, and basin-scale field data.

Swagger UI

Interactive try-it-out. Hit endpoints from your browser with live parameter editing, response inspection, and auth flow. Best for debugging.

Open Swagger
📖

ReDoc

Polished reference docs: searchable, three-pane layout, every parameter and response field documented. Best for browsing the API surface.

Open ReDoc

Schema Explorer

The database, browsable. Every table and view with field descriptions, foreign-key arrows, an ER diagram, and a back-link to the API endpoints that query each table.

Open Schema
{ }

OpenAPI Spec

Raw OpenAPI 2.0 JSON. Feed it to a client generator (openapi-generator, Postman), a contract test, or your own tooling.

Download JSON

What this service exposes

A versioned REST API over the water-accounting data warehouse. Resource-oriented, kebab-case URLs, basin as a first-class path resource.

/v1/basins/{basin}/… — dashboard-shaped endpoints used by the IWMI Digital Twin and basin portals. Water balance, water availability, land use, monthly climatology, water yield, change analysis. All returns are Plotly-ready traces, GeoJSON, or key-metric blocks.

/v1/watercopilot/basins/{basin}/… — LLM-friendly variants. Returns a server-rendered chart URL plus a one-sentence prose summary and a small stats block — designed to keep token cost low and avoid leaking large numeric arrays into conversation context.

/v1/basins + /v1/metrics — discovery. Call these first when scripting against the API for an unfamiliar basin or metric.

Errors follow RFC 7807 (application/problem+json) and read endpoints set Cache-Control + ETag for client/CDN caching.