# Rainwater Harvesting Calculator: Tank Size, Roof Yield (`jumblemog/rainwater-harvesting-calculator`) Actor

Rainwater harvesting from plain text for any place: how much water a roof collects each month from NASA rainfall data, the tank size for your household or garden use, and the share of the use it covers.

- **URL**: https://apify.com/jumblemog/rainwater-harvesting-calculator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Rainwater Harvesting Calculator: Tank Size, Roof Yield

**How much rainwater a roof collects each month, and the tank that covers your water use, for any place, from one line of text.** Describe the roof and the use (`rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry` or `2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden`) and you get back:

- **The water collected**: gallons or litres a year and by month, from NASA's monthly rainfall for the place, the roof area and its material.
- **The water use**: toilets, laundry or the whole house for the people in the home, a daily amount, or a garden's watering from its evapotranspiration (lawn, vegetables, shrubs, trees, drought-tolerant plants; drip or sprinkler).
- **The tank size**: the smallest standard tank that covers nearly as much of the use as any tank could, with the share covered, the water supplied, the overflow and the days it runs short. Give your tank (`5,000 gallon tank`, `2 rain barrels`) to check it instead.
- **Every tank size compared**: the share of the use covered by each standard size from a 55-gallon barrel up.
- **One storm**: `1 inch of rain on a 2,000 sq ft roof` gives the water it collects.
- **A chart**: water collected and used by month, and the share covered by tank size.

It's made for:

- Homeowners and homesteaders sizing a rain tank or cistern, or checking what their rain barrels really cover.
- Gardeners and small farms working out how much garden a roof can water.
- Landscapers, plumbers and tank sellers quoting systems, and green-building and sustainability teams.
- Architects, students and AI agents that need water-balance numbers for a real place.

![A chart made by this Actor for a 2,000 ft² roof in Austin, Texas supplying toilets and laundry for 4 people: rainwater collected by month against the water use, and the share of the use covered by each tank size, with the recommended 1,700-gallon tank covering 90%](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/rainwater-harvesting-calculator-example.png?signature=1I38jTOG7UYKjNYT14IO4)

### How to use it

1. Write **Rainwater systems**, one per entry. The form has examples.
2. Optionally set the **Units** (US: gallons, ft², inches; or metric: litres, m², mm). Units written in a request win.
3. Click **Start**. Each system is a row in the results, with its summary, chart and report.

#### What you can write

| You write | It means |
|---|---|
| `in Austin, Texas`, `Bristol, UK`, `30.27, -97.74` | Where (a town of 5,000+ people or coordinates); the rainfall comes from NASA POWER |
| `32 inches a year`, `650 mm annual rainfall` | Your own yearly rainfall (spread over the months in the place's pattern) |
| `2,000 sq ft roof`, `120 m² roof`, `40 x 30 ft` | The roof (catchment) area |
| `metal roof`, `tile roof`, `shingle roof`, `gravel roof`, `green roof`, `runoff 0.8` | How much of the rain reaches the gutters |
| `4 people, toilets and laundry`, `family of 5, whole house`, `toilet flushing` | Household use |
| `100 gallons a day`, `300 litres per day`, `2,000 gallons a month` | A water use amount |
| `500 sq ft vegetable garden`, `lawn of 200 m²`, `drip`, `sprinkler` | Garden watering |
| `5,000 gallon tank`, `10,000 litre cistern`, `2 rain barrels` | A tank to check |
| `1 inch of rain`, `25 mm of rain` | One storm's water |

The same as an object: `{"place": "Bristol, UK", "roofArea": 100, "units": "metric", "people": 4, "use": "toilet"}` or `{"lat": 30.27, "lon": -97.74, "roofArea": 1500, "roofType": "metal", "tank": 2500, "gardenArea": 400, "garden": "vegetable", "irrigation": "drip"}`.

### Examples

- `rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry` → 31,498 gallons a year collected for 34,748 gallons of use; a 1,700-gallon tank covers 90% (the most any tank can is 91%).
- `2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden` → the barrels cover 39% of the summer watering; a 4,000-gallon tank would cover 100%, because Seattle's summers are dry.
- `1,500 sq ft roof in Tucson, Arizona, 5,000 gallon tank, 500 sq ft garden, drip` → the roof collects 9,122 gallons a year, 48% of the 18,899 the garden needs; a 1,700-gallon tank does nearly as well.
- `{"place": "Bristol, UK", "roofArea": 100, "units": "metric", "people": 4, "use": "toilet"}` → 61,983 litres a year for 43,800 litres of toilet flushing; a 2,500-litre tank covers it all.
- `how much rain from a 120 m² metal roof in Bristol, UK` → about 83,130 litres a year from 810 mm of rain.
- `how much water from 1 inch of rain on a 2000 sq ft roof` → about 954 gallons.

### How-to examples

Each example is a complete input; the results are from runs of the Actor (also listed under **Examples**).

#### How to size a rainwater tank for a house

```json
{"requests": ["rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry"]}
```

Result: 31,498 gallons a year collected for 34,748 gallons of use; a 1,700-gallon tank covers 90%, where the most any tank can is 91%.

#### How to see if rain barrels can water a garden

```json
{"requests": ["2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden"]}
```

Result: the barrels cover 39% of the summer watering; a 4,000-gallon tank would cover 100%, because Seattle's summers are dry.

#### How to calculate how much rain a roof collects

```json
{"requests": ["how much rain from a 120 m² metal roof in Bristol, UK", "how much water from 1 inch of rain on a 2000 sq ft roof"]}
```

Result: about 83,130 litres a year from 810 mm of rain in Bristol, and about 954 gallons from 1 inch on 2,000 sq ft.

#### How to let an AI agent plan rainwater harvesting

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/rainwater-harvesting-calculator`. The agent passes the roof, place and water use in one line and answers with the yearly collection, the use covered and the tank size.

### FAQ

**Where does the rainfall come from?** NASA POWER's monthly climatology for the place (bias-corrected precipitation from 2001), or your own yearly total.

**How is the tank sized?** By a daily water balance over a typical year with realistic storms: the smallest standard tank within 2 points of the best share any tank gives, and no smaller than the BS 8515 rule of thumb.

**Does the roof material matter?** Yes, through the runoff coefficient: metal 0.95, concrete 0.9, shingle and membrane 0.85, tile 0.8, gravel 0.6 and green roofs 0.3.

**Can I drink the water?** Roof water for drinking needs filtering and disinfection, and in many places a permit. Size up for drinking water, since droughts aren't in a typical year.

### Input

| Field | What it is |
|---|---|
| `requests` | The systems, as lines of text or objects (up to 200 per run) |
| `units` | `us` (gallons, ft², inches) or `metric` (litres, m², mm): the output, and the units of object numbers |
| `charts` | Draw a chart for each system (default on) |

### Output

One dataset item per system, also saved together in the run's `OUTPUT` record:

```json
{
  "request": 1, "status": "ok", "type": "harvest", "title": "Rainwater from 2,000 ft² in Austin",
  "summary": "2,000 ft² of roof in Austin collects 31,498 gallons a year for 34,748 gallons of use; a 1,700-gallon tank covers 90% of it (31,415 gallons a year, short on 49 days).",
  "water": {"annualRain": 33.0, "annualCollected": 31498, "annualDemand": 34748, "averageDailyDemand": 95.2,
            "collectedOverDemand": 91},
  "tank": {"size": 1700, "given": false, "shareOfDemand": 90.4, "suppliedPerYear": 31415, "overflowPerYear": 82,
           "shortDays": 49, "recommended": 1700, "recommendedShare": 90.4, "bestPossibleShare": 90.6,
           "rule18Days": 1575, "daysOfStorage": 17.9},
  "demand": [{"use": "toilets and laundry, 4 people", "daily": 95.2}],
  "catchment": {"roofArea": 2000, "roofType": "typical pitched", "runoffCoefficient": 0.85, "filterEfficiency": 0.9,
                "perInchOrMm": 953.8, "firstFlushVolume": 20},
  "monthly": [{"month": "May", "rain": 4.36, "collected": 4156, "demand": 2951, "supplied": 2951, "overflow": 0,
               "tankAtMonthEnd": 1383}, "..."],
  "tankSizes": [{"tank": 55, "shareOfDemand": 26.9, "overflow": 22145, "shortDays": 365}, "..."],
  "units": {"volume": "gal", "area": "ft²", "rain": "in", "temperature": "°C"},
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Rainwater-from-2-000-ft-in-Austin.png"
}
```

Every item also has `place`, `warnings`, `notes` (the method and every assumed value), a Markdown `report` and links to the chart and report. A request that can't be computed has `"status": "failed"` and the reason in `error`, and isn't billed.

### How it works

1. **Rainfall**: NASA POWER's monthly climatology for the point (bias-corrected precipitation, 2001 on), or your own yearly total spread over the months in the place's pattern.
2. **Collected water** = rain × roof area × runoff coefficient (metal 0.95, concrete 0.9, shingle and membrane 0.85, tile 0.8, gravel 0.6, green 0.3) × 90% for the gutter filter and first flush. 1 mm on 1 m² is 1 litre; 1 inch on 1 ft² is 0.623 gallons.
3. **Use**: per person a day for toilets (14.2 gal US / 30 L), laundry (9.6 gal / 20 L) or all indoor use (58.6 gal / 140 L), from the Water Research Foundation's 2016 US study and typical European figures; garden watering = plant factor × Hargreaves reference evapotranspiration − 75% of the rain, in months averaging 10 °C or more, ÷ watering efficiency (drip 90%, sprinkler 70%).
4. **Daily water balance**: each month's rain falls on evenly spaced wet days (more for wetter months) with storm sizes from an exponential distribution; every day the rain fills the tank, the overflow spills, and the use is drawn (yield after spillage). It runs from an empty tank until the year repeats.
5. **Tank size**: the smallest standard tank within 2 points of the best share any tank gives, and no smaller than the UK BS 8515 rule of thumb (5% of the smaller of yearly collection and use, about 18 days) for dry spells.

### Pricing

You pay one low price per system, at the price shown on this page. The chart and report are included. Requests that can't be computed are never charged. If you set a maximum cost per run, the Actor stops before a request that wouldn't fit.

### Speed

A system takes about half a second (the NASA data for a place is fetched once per run). A run through the API answers in about 10-15 seconds, including the cloud container starting.

### Tips and limits

- **Typical years**: droughts and dry spells longer than average aren't in a typical year; size up for drinking water or livestock.
- **Satellite rainfall** can differ from a local rain gauge by 10% or more; give your yearly rainfall to use your own.
- **Drinking water** from a roof needs filtering and disinfection, and in many places a permit; check local rules on rainwater use.
- **Limits**: 200 systems per run; places need NASA POWER to answer, or give the yearly rainfall.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `requests` as plain text and read `summary`, `water`, `tank`, `monthly` and `warnings`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~rainwater-harvesting-calculator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"requests": ["rainwater tank for a 1,800 sq ft metal roof in Asheville, North Carolina, 3 people, toilets"]}'
```

`run-sync` instead returns the run's `OUTPUT`: the status, the counts and every result as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/rainwater-harvesting-calculator").call(run_input={
    "requests": [{"place": "Perth, Australia", "roofArea": 180, "units": "metric", "people": 4, "use": "toiletlaundry",
                  "gardenArea": 60, "garden": "vegetable", "irrigation": "drip"}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"])
```

### Credits

- Rainfall and temperature: [NASA POWER](https://power.larc.nasa.gov) (NASA Langley Research Center POWER Project, funded through the NASA Earth Science Directorate Applied Science Program; public).
- Places: [GeoNames](https://www.geonames.org) via [geonamescache](https://github.com/yaph/geonamescache) (CC BY 4.0, MIT).
- Math: [NumPy](https://numpy.org) (BSD-3-Clause). Charts: [Vega-Lite](https://vega.github.io/vega-lite/) and [vl-convert](https://github.com/vega/vl-convert) (BSD-3-Clause), with the [Inter](https://rsms.me/inter/) font (SIL Open Font License).
- Methods: yield-after-spillage water balance (Jenkins et al.; Fewkes); BS 8515 intermediate sizing; Hargreaves-Samani evapotranspiration with FAO-56 extraterrestrial radiation; Water Research Foundation Residential End Uses of Water (2016).

# Actor input Schema

## `requests` (type: `array`):

One system per entry, as a line of text or an object. Say where (a town or city of 5,000+ people, with the US state or country if needed, or coordinates; the monthly rainfall comes from NASA POWER) or give the yearly rainfall ('32 inches a year', '650 mm a year'). Give the roof area ('2,000 sq ft roof', '120 m² roof', '40 x 30 ft') and optionally its type (metal, tile, shingle, concrete, slate, gravel, green). Add the water use: people and the use ('4 people, toilets and laundry', 'family of 5, whole house'), a daily amount ('100 gallons a day', '300 litres per day'), or a garden ('500 sq ft vegetable garden', 'lawn of 200 m²', with drip or sprinkler). Add a tank ('5,000 gallon tank', '2 rain barrels') to check it, or leave it out to size one. '1 inch of rain' gives one storm's water. Object fields: place, lat, lon, roofArea, roofType, runoff, tank, people, use (toilet, laundry, toiletlaundry, indoor), dailyDemand, monthlyDemand (12), gardenArea, garden, irrigation, annualRain, monthlyRain (12), storm, units (numbers in gallons, ft² and inches for us; litres, m² and mm for metric), title, text.

## `units` (type: `string`):

Output units and the units for object numbers. A unit written in a text request wins.

## `charts` (type: `boolean`):

Water collected and used by month, and the share of the use each tank size covers.

## Actor input object example

```json
{
  "requests": [
    "rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry",
    "how much rain from a 120 m² metal roof in Bristol, UK",
    "2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden",
    "1,500 sq ft roof in Tucson, Arizona, 5,000 gallon tank, 500 sq ft garden, drip",
    "how much water from 1 inch of rain on a 2000 sq ft roof",
    {
      "place": "Bristol, UK",
      "roofArea": 100,
      "units": "metric",
      "people": 4,
      "use": "toilet"
    }
  ],
  "units": "us",
  "charts": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per request: the summary and chart.

## `output` (type: `string`):

The OUTPUT record: every result in one JSON object.

## `files` (type: `string`):

Charts (PNG and SVG) and Markdown reports in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "requests": [
        "rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry",
        "how much rain from a 120 m² metal roof in Bristol, UK",
        "2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden",
        "1,500 sq ft roof in Tucson, Arizona, 5,000 gallon tank, 500 sq ft garden, drip",
        "how much water from 1 inch of rain on a 2000 sq ft roof",
        {
            "place": "Bristol, UK",
            "roofArea": 100,
            "units": "metric",
            "people": 4,
            "use": "toilet"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/rainwater-harvesting-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "requests": [
        "rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry",
        "how much rain from a 120 m² metal roof in Bristol, UK",
        "2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden",
        "1,500 sq ft roof in Tucson, Arizona, 5,000 gallon tank, 500 sq ft garden, drip",
        "how much water from 1 inch of rain on a 2000 sq ft roof",
        {
            "place": "Bristol, UK",
            "roofArea": 100,
            "units": "metric",
            "people": 4,
            "use": "toilet",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/rainwater-harvesting-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "requests": [
    "rainwater tank for a 2,000 sq ft roof in Austin, Texas, 4 people, toilets and laundry",
    "how much rain from a 120 m² metal roof in Bristol, UK",
    "2 rain barrels on a 600 sq ft roof in Seattle watering a 300 sq ft vegetable garden",
    "1,500 sq ft roof in Tucson, Arizona, 5,000 gallon tank, 500 sq ft garden, drip",
    "how much water from 1 inch of rain on a 2000 sq ft roof",
    {
      "place": "Bristol, UK",
      "roofArea": 100,
      "units": "metric",
      "people": 4,
      "use": "toilet"
    }
  ]
}' |
apify call jumblemog/rainwater-harvesting-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/rainwater-harvesting-calculator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cnOWPY8SisK1ke2kO/builds/TqEpnRpFtcG7L3hv9/openapi.json
