# Pool Volume, Chemical, Pump & Heater Calculator (`jumblemog/swimming-pool-calculator`) Actor

Swimming pool and hot tub calculator from plain text: gallons by shape, pump flow, filter and pipe for a turnover, gas heater or heat pump size, and the chemical doses to balance a water test.

- **URL**: https://apify.com/jumblemog/swimming-pool-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

## Pool Volume, Chemical, Pump & Heater Calculator

**Work out a swimming pool's or hot tub's gallons, pump, heater and chemical doses from one line of text.** Ask `16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200` and you get back:

- **The volume** in gallons and liters for a rectangle, round (above-ground), oval or kidney pool, from the size and the shallow and deep ends.
- **The pump and filter**: the flow for a turnover, the sand, cartridge or DE filter area, the suction and return pipe sizes and about how much pump.
- **The heater**, when you give temperatures: the gas heater and heat pump sizes for a heat-up time against the surface heat loss, with or without a cover.
- **The chemical doses** from a water test: liquid chlorine (or cal hypo), muriatic acid or soda ash, baking soda, calcium chloride, stabilizer and salt, or how much water to replace, each with why.
- **Charts** (the water test against the ideal ranges, heat-up hours by heater size, or pump flow by turnover) and a **Markdown report**.

It's made for:

- Pool owners balancing their water or buying a pump, filter or heater.
- Pool service techs, builders and pool supply stores.
- AI agents, pool-care apps and chatbots that need doses and sizes they can show their work for.

![A chart made by this Actor for a 16 x 32 ft pool, 3 to 8 ft deep: the water test against the ideal ranges (free chlorine 1, pH 7.9 and alkalinity 60 out of range; calcium 200 and cyanuric acid 30 in range), and the hours each gas heater size takes to heat from 68 °F to 84 °F, with a 250,000 BTU/h heater meeting the 24 hour goal](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/swimming-pool-calculator-example.png?signature=xYxGnXCbhcJd0O44AKJR)

### How to use it

1. Write **Requests**, one per entry. The form has examples.
2. Optionally set the **turnover** and the **filter type**.
3. Click **Start**. Each request is a row in the results, with its summary, chart and report.

#### What you can write

| You write | It means |
|---|---|
| `16 x 32 ft, 3 to 8 ft deep`, `18 x 36 x 5 ft`, `8 x 4 m, 1.5 m deep` | A rectangular pool |
| `24 ft round, 52 in wall`, `above ground`, `oval 15 by 30`, `kidney 15 x 30`, `hot tub 7 x 7 ft` | Other shapes |
| `20,000 gallon pool`, `60,000 liters` | The volume, when you know it |
| `6 hour turnover`, `sand filter`, `cartridge`, `DE` | The pump and filter |
| `heat to 84 F from 65 F in 2 days`, `air 60 F`, `with a cover`, `heat pump` | Heating |
| `FC 1`, `pH 7.9`, `TA 60`, `calcium 200`, `CYA 30`, `salt 2400` | A water test (ppm) |

The same as an object: `{"shape": "oval", "length": 30, "width": 15, "shallow": 3.5, "deep": 6, "heater": "heat pump", "airTemp": 70, "targetTemp": 84, "fc": 0.5}`.

### Examples

- `16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200` → 21,065 gal; 43.9 gpm for an 8 h turnover; add 43 fl oz of liquid chlorine, 32 fl oz of muriatic acid and 8.8 lb of baking soda.
- `24 ft round above ground pool, 52 in wall, sand filter` → 12,972 gal; 27 gpm.
- `kidney pool 15 x 30 ft, 4 ft average depth, heat to 84 F from 65 F in 2 days, air 60 F, with a cover` → 11,445 gal; a 150,000 BTU/h gas heater or a 75,000 BTU/h heat pump.
- `20,000 gallon pool, salt 2400, ph 7.2, ta 140, cya 90` → muriatic acid for the alkalinity, 133 lb of salt, and replace 22% of the water for the stabilizer.
- `hot tub 7 x 7 ft, 3 ft deep, heat to 102 F` → 1,100 gal; a 30-minute turnover.
- `8 x 4 m pool, 1.5 m deep, cartridge filter, 6 hour turnover` → 48,000 L.

### How-to examples

These are examples from **Examples** above, written as complete inputs; the result lines are from their runs.

#### How to calculate pool gallons and chemical doses

```json
{"requests": ["16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200"]}
```

Result: 21,065 gal; 43.9 gpm for an 8 h turnover; add 43 fl oz of liquid chlorine, 32 fl oz of muriatic acid and 8.8 lb of baking soda.

#### How to size a pool heater

```json
{"requests": ["kidney pool 15 x 30 ft, 4 ft average depth, heat to 84 F from 65 F in 2 days, air 60 F, with a cover"]}
```

Result: 11,445 gal; a 150,000 BTU/h gas heater or a 75,000 BTU/h heat pump.

#### How to calculate the volume of a round above-ground pool

```json
{"requests": ["24 ft round above ground pool, 52 in wall, sand filter"]}
```

Result: 12,972 gal; 27 gpm.

#### How to let an AI agent work out pool volume and chemicals

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/swimming-pool-calculator`. The agent writes the pool and its test results ("16 x 32 ft, 3 to 8 ft deep, pH 7.9, FC 1") and passes on the gallons, pump flow and what to add instead of guessing them.

### FAQ

**What can it calculate?** Volume for rectangular, round, kidney and other pools and hot tubs, the pump flow for a turnover, chemical doses from your test results, and heater size.

**Which chemical strengths does it assume?** 12.5% liquid chlorine, 65% cal hypo and 31.45% muriatic acid. Check your label.

**Does it work in metric?** Yes: `8 x 4 m pool, 1.5 m deep` returns litres.

**How should I add the chemicals?** One at a time with the pump running. Never mix acid and chlorine.

**How many can I run at once?** Up to 200 pools per run, each as a line of text or an object. A request that can't be computed isn't billed.

**Does it work with Zapier, Make or n8n?** Yes. Call the Actor with its Apify app or an HTTP request and pass the results on.

### Input

| Field | What it is |
|---|---|
| `requests` | Pools as lines of text or objects (up to 200 per run) |
| `turnover` | Hours to filter all the water once when a request doesn't say (8 by default; 30 minutes for a hot tub) |
| `filter` | Cartridge, sand or DE when a request doesn't say (cartridge by default) |
| `charts` | Draw a chart for each request (default on) |

### Output

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

```json
{
  "request": 1, "status": "ok", "type": "pool", "title": "Pool: 21,065 gallons",
  "summary": "Rectangular pool 16 × 32 ft, 5.5 ft average depth: 21,065 gal (79,740 L); 43.9 gpm for an 8 h turnover (cartridge filter 117 ft²). Add 43.1 fl oz of liquid chlorine 12.5%; 32.4 fl oz of muriatic acid 31.45%; 8.8 lb of baking soda (sodium bicarbonate).",
  "pool": {"shape": "rectangle", "shallow": 3, "deep": 8, "length": 16, "width": 32, "averageDepth": 5.5, "surfaceArea": 512, "gallons": 21065, "liters": 79740},
  "circulation": {"turnoverHours": 8, "gpm": 43.9, "filter": "cartridge", "filterArea": 117, "suctionPipe": 2, "returnPipe": 1.5, "pumpHp": 1.11},
  "heater": null,
  "chemistry": {
    "readings": {"fc": 1, "ph": 7.9, "ta": 60, "ch": 200, "cya": 30},
    "status": {"fc": "low", "ph": "high", "ta": "low", "ch": "ok", "cya": "ok"},
    "targets": {"fc": 3, "ph": 7.5, "ta": 90, "ch": 300, "cya": 40},
    "doses": [{"for": "free chlorine", "chemical": "liquid chlorine 12.5%", "amount": 43.1, "unit": "fl oz", "why": "raise free chlorine 1 → 3 ppm"}, "..."]
  },
  "units": {"length": "ft", "area": "ft²", "volume": "gal", "flow": "gpm", "temperature": "°F", "heat": "BTU", "heatRate": "BTU/h", "chemistry": "ppm", "pipe": "in", "power": "hp"}
}
```

`heater` is filled when a request mentions heating or temperatures, and `chemistry` when it has test readings. Every item has `warnings`, `notes` (every assumption and default), 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. **Volume**: length × width × average depth × 7.48 gal/ft³; round and oval × π/4, kidney × 0.85. The average depth is halfway between the ends; an above-ground pool's water sits 6 in below the wall.
2. **Pump and filter**: gpm = gallons ÷ (turnover hours × 60). Filter area at 20 gpm/ft² for sand, 2 for DE, 0.375 for cartridge. Pipe sized for under 6 ft/s on the suction side and 8 ft/s on the return. Pump power at about 50 ft of head and 50% efficiency; a variable-speed pump run slower and longer uses far less.
3. **Heater**: heat-up = gallons × 8.34 × the rise in °F, spread over the heat-up time, plus the surface loss of 12 BTU/h per ft² per °F of water over air (half with a cover). Gas heaters give about 84% of their input; a heat pump is sized to hold the temperature against the loss.
4. **Chemistry**: targets are free chlorine 3 ppm (at least 7.5% of the cyanuric acid), pH 7.5, alkalinity 90, calcium 300, cyanuric acid 40 (70 with a salt chlorinator), salt 3,200. Per 10,000 gal: 1 ppm chlorine = 10.2 fl oz of 12.5% liquid chlorine or 2 oz of 65% cal hypo; 10 ppm alkalinity = 1.4 lb of baking soda or 26 fl oz of muriatic acid; 10 ppm calcium = 1.2 lb of calcium chloride; 10 ppm stabilizer = 13.4 oz; salt by weight. pH doses scale with the alkalinity and are estimates: add half and retest. Calcium, stabilizer and salt only come down by replacing water.

### Pricing

You pay one low price per pool, at the price shown on this page, whatever parts it asks for. The charts 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 request takes milliseconds. A run through the API answers in about 10 seconds, including the cloud container starting.

### Tips and limits

- **Read the label**: chemical strengths vary; these doses assume 12.5% liquid chlorine, 65% cal hypo and 31.45% muriatic acid.
- **One chemical at a time** with the pump running; never mix acid and chlorine, and add acid to water, not water to acid.
- **A good test kit** (a FAS-DPD chlorine test) beats strips for dosing.
- **Limits**: 200 requests per run; pool surface loss is a typical outdoor figure, so windy or cold sites need more heat.

### 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`, `pool`, `chemistry.doses`, `heater` and `warnings`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~swimming-pool-calculator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"requests": ["15,000 gallon pool, fc 0, cya 0"]}'
```

`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/swimming-pool-calculator").call(run_input={
    "requests": [{"gallons": 18000, "fc": 1.5, "ph": 7.8, "ta": 120, "cya": 60}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    for dose in item["chemistry"]["doses"]:
        print(dose["amount"], dose["unit"], dose["chemical"])
```

### Credits

- Methods: shape volume factors, turnover and filter-rate rules, the water heating equation with a typical surface loss, and chemical doses worked out from each chemical's strength and molecular weight per 10,000 gallons.
- 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).

# Actor input Schema

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

One request per entry, as a line of text or an object. The size: '16 x 32 ft, 3 to 8 ft deep', '24 ft round, 52 in wall', 'kidney 15 x 30', '8 x 4 m, 1.5 m deep', or '20,000 gallon pool'; 'hot tub'. The pump: '6 hour turnover', 'sand', 'cartridge' or 'DE' filter. Heating: 'heat to 84 F from 65 F in 2 days, air 60 F, with a cover', 'heat pump'. A water test: 'FC 1, pH 7.9, TA 60, CH 200, CYA 30, salt 2400'. Object fields: shape, length, width, diameter, depth, shallow, deep, gallons, liters, metric, turnover, filter, heater, targetTemp, waterTemp, airTemp, heatHours, cover, fc, ph, ta, ch, cya, salt, spa, title, text.

## `turnover` (type: `integer`):

Hours to filter all the water once when a request doesn't say (8 by default; 0.5 for hot tubs).

## `filter` (type: `string`):

The filter when a request doesn't say (cartridge by default).

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

The water test against ideal ranges and the heat-up time by heater size, or the pump flow by turnover.

## Actor input object example

```json
{
  "requests": [
    "16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200",
    "24 ft round above ground pool, 52 in wall, sand filter",
    "kidney pool 15 x 30 ft, 4 ft average depth, heat to 84 F from 65 F in 2 days, air 60 F, with a cover",
    "20,000 gallon pool, salt 2400, ph 7.2, ta 140, cya 90",
    "hot tub 7 x 7 ft, 3 ft deep, heat to 102 F",
    "8 x 4 m pool, 1.5 m deep, cartridge filter, 6 hour turnover",
    {
      "shape": "oval",
      "length": 30,
      "width": 15,
      "shallow": 3.5,
      "deep": 6,
      "heater": "heat pump",
      "airTemp": 70,
      "targetTemp": 84,
      "fc": 0.5
    }
  ],
  "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": [
        "16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200",
        "24 ft round above ground pool, 52 in wall, sand filter",
        "kidney pool 15 x 30 ft, 4 ft average depth, heat to 84 F from 65 F in 2 days, air 60 F, with a cover",
        "20,000 gallon pool, salt 2400, ph 7.2, ta 140, cya 90",
        "hot tub 7 x 7 ft, 3 ft deep, heat to 102 F",
        "8 x 4 m pool, 1.5 m deep, cartridge filter, 6 hour turnover",
        {
            "shape": "oval",
            "length": 30,
            "width": 15,
            "shallow": 3.5,
            "deep": 6,
            "heater": "heat pump",
            "airTemp": 70,
            "targetTemp": 84,
            "fc": 0.5
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/swimming-pool-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": [
        "16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200",
        "24 ft round above ground pool, 52 in wall, sand filter",
        "kidney pool 15 x 30 ft, 4 ft average depth, heat to 84 F from 65 F in 2 days, air 60 F, with a cover",
        "20,000 gallon pool, salt 2400, ph 7.2, ta 140, cya 90",
        "hot tub 7 x 7 ft, 3 ft deep, heat to 102 F",
        "8 x 4 m pool, 1.5 m deep, cartridge filter, 6 hour turnover",
        {
            "shape": "oval",
            "length": 30,
            "width": 15,
            "shallow": 3.5,
            "deep": 6,
            "heater": "heat pump",
            "airTemp": 70,
            "targetTemp": 84,
            "fc": 0.5,
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/swimming-pool-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": [
    "16 x 32 ft pool, 3 to 8 ft deep, pH 7.9, FC 1, TA 60, CYA 30, calcium 200",
    "24 ft round above ground pool, 52 in wall, sand filter",
    "kidney pool 15 x 30 ft, 4 ft average depth, heat to 84 F from 65 F in 2 days, air 60 F, with a cover",
    "20,000 gallon pool, salt 2400, ph 7.2, ta 140, cya 90",
    "hot tub 7 x 7 ft, 3 ft deep, heat to 102 F",
    "8 x 4 m pool, 1.5 m deep, cartridge filter, 6 hour turnover",
    {
      "shape": "oval",
      "length": 30,
      "width": 15,
      "shallow": 3.5,
      "deep": 6,
      "heater": "heat pump",
      "airTemp": 70,
      "targetTemp": 84,
      "fc": 0.5
    }
  ]
}' |
apify call jumblemog/swimming-pool-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/swimming-pool-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/dXW8WqLrJxGIi3wZd/builds/egfaW5RHUiV90AqSC/openapi.json
