SmartWater API
The SmartWater API provides a full-featured analytics engine for water utilities and developers.
Access short-term forecasting, leakage detection, inflow & infiltration decomposition,
water flow component analysis, pipe survival, and more — all via simple HTTPS POST requests.
Fully cloud-native — no infrastructure required
Automation & LLM-ready for AI pipelines
Handles real-world water network data at scale
Secure API key authentication with JSON payloads
Pricing (Per Request)
Tier
Endpoint / Feature
Price
Basic
Sewer Blockage Detection
$0.10 / 0.90 SEK
Leakage Anomaly Detection
$0.10 / 0.90 SEK
Intermediate
Level → Flow Conversion
$0.30 / 2.80 SEK
Impute Missing Values
$0.30 / 2.80 SEK
Inflow & Infiltration Decomposition
$0.30 / 2.80 SEK
Water Flow Component Analysis
$0.30 / 2.80 SEK
48-Hour Forecast
$0.30 / 2.80 SEK
Advanced
Pipe Survival & RUL
$1.00 / 9.40 SEK
Volume Discounts:
1–100 API calls: standard rates
101–1,000: 10% discount
1,001+: 20% discount
Quickstart
Here’s how to call the SmartWater API in cURL or Python . Replace YOUR_API_KEY with your API key.
cURL
curl -X POST https://www.waterworks.ai/api/forecast \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"df": [{"ds":"2024-01-01 00:00:00","y":100}]
}'
Python
import requests
url = "https://www.waterworks.ai/api/forecast"
payload = {
"api_key": "YOUR_API_KEY",
"df": [{"ds":"2024-01-01 00:00:00","y":100}]
}
response = requests.post(url, json=payload)
print(response.json())
Authentication
All SmartWater API endpoints require HTTPS POST requests with a JSON body.
Authentication is performed by including your api_key in the request payload:
Request Example
{
"api_key": "YOUR_API_KEY",
"df": [{"ds": "2024-01-01 00:00:00", "y": 100}]
}
Ensure your API key is kept secret. Each endpoint validates the key and will return an
authentication error if missing or invalid.
Inflow & Infiltration
POST https://www.waterworks.ai/api/inflow
Separates measured wastewater flow into sewage, infiltration, and inflow components.
Request Schema
Field Type Required Description
api_key string Yes Authentication key
df array<object> Yes Time series: ds (ISO datetime), y (flow)
population number No Connected population
use number No Specific sewage use per capita
Response Schema
Field Type Description
ds string Timestamp
sewage number Sanitary sewage flow
infiltration number Groundwater infiltration
inflow number Rainfall / fast inflow
y number Total observed flow
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/inflow \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"df": [{"ds":"2026-03-24 00:00:00","y":150}],
"population": 5000,
"use": 150
}'
import requests
url = "https://www.waterworks.ai/api/inflow"
payload = {
"api_key": "YOUR_API_KEY",
"df": [{"ds":"2026-03-24 00:00:00","y":150}],
"population": 5000,
"use": 150
}
r = requests.post(url, json=payload)
print(r.json())
Example Response
[
{"ds":"2026-03-24 00:00:00","sewage":80,"infiltration":40,"inflow":30,"y":150}
]
Water Flow Component Analysis
POST https://www.waterworks.ai/api/watercomponents
Decomposes network flow into night baseline, customer consumption, and leakage.
Request Schema
Field Type Required Description
api_key string Yes API key
df array<object> Yes Hourly flow: ds, y
population number No
use number No
Response Schema
Field Type Description
night number Baseline night flow
consumption number Customer demand
leaks number Estimated leakage
y number Total observed flow
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/watercomponents \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","y":200}],
"population": 5000,
"use": 150
}'
import requests
url = "https://www.waterworks.ai/api/watercomponents"
payload = {
"api_key":"YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","y":200}],
"population": 5000,
"use":150
}
r=requests.post(url,json=payload)
print(r.json())
Example Response
[
{"ds":"2026-03-24 00:00:00","night":50,"consumption":120,"leaks":30,"y":200}
]
48-Hour Forecast
POST https://www.waterworks.ai/api/forecast
Generates short-term forecasts for water or wastewater flow time series. Optional weather integration can improve accuracy.
Request Schema
Field Type Required Description
api_key string Yes API key
df array<object> Yes Time series: ds (datetime), y (flow)
lat number No Latitude (optional, for weather)
lon number No Longitude (optional, for weather)
Response Schema
Field Type Description
forecast array<object> Forecast for next 48h with ds, yhat, hi_90, lo_90
historical array<object> Observed data with ds, y, yhat
MAE number Mean absolute error vs historical
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/forecast \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"df": [{"ds":"2026-03-24 00:00:00","y":120}],
"lat": 59.3293,
"lon": 18.0686
}'
import requests
url = "https://www.waterworks.ai/api/forecast"
payload = {
"api_key":"YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","y":120}],
"lat":59.3293,
"lon":18.0686
}
r=requests.post(url,json=payload)
print(r.json())
Example Response
{
"forecast":[
{"ds":"2026-03-24 01:00:00","yhat":123,"hi_90":130,"lo_90":116}
],
"historical":[
{"ds":"2026-03-24 00:00:00","y":120,"yhat":119}
],
"MAE": 3.5
}
Leakage Anomaly Detection
POST https://www.waterworks.ai/api/leakage
Detects abnormal increases in flow indicative of leaks, near-real-time or retrospective.
Request Schema
Field Type Required Description
api_key string Yes
df array<object> Yes Hourly flow: ds, y
unit string Yes Measurement unit
Response Schema
Field Type Description
df array<object> Time series with anomaly (boolean) and alarm (boolean)
night_quote number Night flow baseline estimate
night_trend string "increasing" | "decreasing" | "stable"
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/leakage \
-H "Content-Type: application/json" \
-d '{
"api_key":"YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","y":120}],
"unit":"m3/h"
}'
import requests
url="https://www.waterworks.ai/api/leakage"
payload={
"api_key":"YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","y":120}],
"unit":"m3/h"
}
r=requests.post(url,json=payload)
print(r.json())
Example Response
{
"df":[{"ds":"2026-03-24 00:00:00","y":120,"anomaly":false,"alarm":false}],
"night_quote":100,
"night_trend":"stable"
}
Blockage Detection
POST /api/blockage
Detects abnormal drops in sewer flow (inverse anomaly logic).
Request/Response
Same schema as /api/leakage .
Example Request
cURL
Python
curl -X POST https://www.waterworks.ai/api/blockage \
-H "Content-Type: application/json" \
-d '{
"api_key":"YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","y":100}],
"unit":"m3/h"
}'
import requests
url="https://www.waterworks.ai/api/blockage"
payload={"api_key":"YOUR_API_KEY","df":[{"ds":"2026-03-24 00:00:00","y":100}],"unit":"m3/h"}
r=requests.post(url,json=payload)
print(r.json())
Level → Flow Conversion
POST /api/leveltoflow
Converts high-resolution level measurements to hourly flow estimates.
Request Schema
api_key string Yes
df array<object> Yes (minute-level)
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/leveltoflow \
-H "Content-Type: application/json" \
-d '{
"api_key":"YOUR_API_KEY",
"df":[{"ds":"2026-03-24 00:00:00","level":2.5}]
}'
import requests
url="https://www.waterworks.ai/api/leveltoflow"
payload={"api_key":"YOUR_API_KEY","df":[{"ds":"2026-03-24 00:00:00","level":2.5}]}
r=requests.post(url,json=payload)
print(r.json())
Response Schema
ds string Hourly timestamp
y number Estimated flow
Impute Missing Values
POST /api/impute
Fills missing values in time series based on historical patterns. Returns imputed values, outage duration, and outage type.
Request Schema
Field Type Required Description
api_key string Yes API key
df array<object> Yes Time series with ds (timestamp) and y (value). Missing values are null.
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/impute \
-H "Content-Type: application/json" \
-d '{
"api_key":"YOUR_API_KEY",
"df":[
{"ds":"2026-03-24 00:00:00","y":100},
{"ds":"2026-03-24 00:01:00","y":null}
]
}'
import requests
url="https://www.waterworks.ai/api/impute"
payload={"api_key":"YOUR_API_KEY","df":[{"ds":"2026-03-24 00:00:00","y":100},{"ds":"2026-03-24 00:01:00","y":None}]}
r=requests.post(url,json=payload)
print(r.json())
Response Schema
Field Type Description
ds string Timestamp
y number Imputed or original value
missing boolean True if value was missing
outage_hours integer Duration of missing data in hours
outage_type string Classification: signal loss / mechanical / none
Example Response
[
{"ds":"2026-03-24 00:00:00","y":100,"missing":false,"outage_hours":0,"outage_type":"none"},
{"ds":"2026-03-24 00:01:00","y":103.5,"missing":true,"outage_hours":1,"outage_type":"signal loss"}
]
Pipe Survival & Remaining Useful Life (RUL)
POST /api/survival
Estimates pipe failure probability and remaining lifespan using pipe attributes, material, age, renovations, and environmental data.
Request Schema
Field Type Required Description
api_key string Yes API key
data array<object> Yes Pipe attributes
material_column string Yes Name of material column in data
construction_year_column string Yes Name of construction year column
renovation_year_column string No Name of last renovation year column
soil_type_column string No Name of soil type column
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/survival \
-H "Content-Type: application/json" \
-d '{
"api_key":"YOUR_API_KEY",
"data":[{"material":"PVC","construction_year":2000}],
"material_column":"material",
"construction_year_column":"construction_year"
}'
import requests
url="https://www.waterworks.ai/api/survival"
payload={"api_key":"YOUR_API_KEY","data":[{"material":"PVC","construction_year":2000}],"material_column":"material","construction_year_column":"construction_year"}
r=requests.post(url,json=payload)
print(r.json())
Response Schema
Field Type Description
LoF number Likelihood of failure
RUL number Remaining Useful Life (years)
Example Response
[
{"material":"PVC","LoF":0.02,"RUL":28}
]
Earth Observation Data
POST /api/earth
Returns geospatial datasets such as terrain depressions, NDVI, impervious surfaces, and flow accumulation.
Request Schema
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/earth \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY"}'
import requests
url="https://www.waterworks.ai/api/earth"
payload={"api_key":"YOUR_API_KEY"}
r=requests.post(url,json=payload)
print(r.json())
Response Schema
Depressions
NDVI
Impervious surface change
Flow accumulation
Example Response
{
"depressions": [...],
"ndvi": [...],
"impervious": [...],
"flow_accumulation": [...]
}
Geospatial Consequence & Risk
POST /api/georisk
Calculates consequence-of-failure scores for pipes based on street network, critical infrastructure, and spatial exposure.
Request Schema
Example Requests
cURL
Python
curl -X POST https://www.waterworks.ai/api/georisk \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY"}'
import requests
url="https://www.waterworks.ai/api/georisk"
payload={"api_key":"YOUR_API_KEY"}
r=requests.post(url,json=payload)
print(r.json())
Response Schema
Pipe consequence score
Critical infrastructure proximity
Street network consequence ranking
Example Response
{
"pipe_scores": [...],
"critical_infra_proximity": [...],
"street_ranking": [...]
}