Technical documentation — open API
Water Leak Risk Index
Water Leak Risk Index (formerly known as the "Hydro Safety Oracle") is an open software tool from Kashf that estimates the water leak risk (Leak-Risk Score) of a property in Saudi Arabia from 0 to 100: the higher the score, the higher the risk. The result is an estimate using editorial weights set by the Kashf team for geographic, climate and engineering factors drawn from the site's content (city soil analyses in the pillar articles and the plumbing pipe comparison table in the engineering guide); it is not a measurement or a statistic of real cases. The calculation doesn't depend on any external server or network call; everything is calculated instantly in your browser. The city factors cover Saudi cities only.
This tool is a general awareness and engineering indicator for prioritizing inspection, not a substitute for a real on-site inspection with a thermal camera and acoustic sensing. To confirm an actual leak, book an on-site inspection from Kashf.
How does the scoring model work?
The model adds up risk points from four factors, each with an estimated editorial weight drawn from the site's content:
- City geographic/climate factor: for example, the highly saline sabkha soil and high groundwater in Dammam (Dammam guide), the low-porosity basalt rock in Madinah (Madinah guide), or the limestone plateau soil in Riyadh (Riyadh guide).
- Pipe material: based on the engineering comparison table (ISO/ASTM standards, operating temperature and UV resistance) in the complete engineering guide to plumbing pipes.
- Building age: the older the original network, the higher the chance of joint corrosion — a general engineering principle repeated across the site's content.
- Additional exposure factors: exposed pipework in the sun without insulation, proximity to farms or irrigation networks (makes it harder to tell irrigation moisture from a real leak), and a thermally insulated rooftop tank (reduces the risk).
The total score (0–100) is classified into four categories: Low <300 Hz (below 25), Moderate (25–49)، High (50–74)، Critical (75 or more). The full details of each factor and its weight are documented as source comments inside the hydro-oracle.js module file.
Live interactive demo
Try the index now — the calculation happens instantly in your browser without sending any data. Remember: a higher score means a higher risk.
—
Function documentation (API Reference)
window.KashfOracle.assess(input) — a pure, deterministic JavaScript function with no side effects or network calls.
| Parameter | Type | Required | Description |
|---|---|---|---|
city | string | Yes | City key: riyadh, jeddah, dammam, khobar, madinah, makkah, tabuk, taif, khamis-mushait, buraydah, other |
pipeMaterial | string | Yes | Material key: ppr, pex, upvc, copper, multilayer |
buildingAgeYears | number | Yes | Building age in years (0 or more) |
exposedToSun | boolean | No | Is there exposed pipework in the sun without insulation? |
nearFarmsOrIrrigation | boolean | No | Is the property near farms or irrigation networks? |
insulatedTank | boolean | No | Is the rooftop tank thermally insulated? |
Example call (Request)
KashfOracle.assess({
city: "riyadh",
pipeMaterial: "ppr",
buildingAgeYears: 12,
exposedToSun: true,
nearFarmsOrIrrigation: false,
insulatedTank: true
});
Response shape (Response)
{
"score": 42,
"classification": "moderate",
"classificationAr": "متوسط",
"city": "riyadh",
"cityNameAr": "الرياض",
"pipeMaterial": "ppr",
"pipeMaterialAr": "PPR (المواسير الحرارية)",
"factors": [ { "label": "...", "points": 18, "reason": "..." }, ... ],
"version": "1.0.0"
}
Embeddable property widget
For property listing sites that want to show the Water Leak Risk Index on any property page, Kashf provides a ready-to-embed mini card via iframe — it runs entirely in the browser without any back-end server, and carries the Kashf badge and a link to kashf.com.sa.
Embed code (Embed Code)
<iframe src="https://kashf.com.sa/embed/hydro-safety-widget.html?city=jeddah&pipeMaterial=upvc&buildingAgeYears=15" width="320" height="220" style="border:0;border-radius:14px;overflow:hidden;" loading="lazy" title="Water Leak Risk Index — Kashf"></iframe>
The URL parameters (query string) are optional, with the same names as the parameters of KashfOracle.assess(); if left empty, the widget shows a small interactive form instead of a ready result.