# Retaining Wall Block Calculator (Materials & Geogrid) (`jumblemog/retaining-wall-calculator`) Actor

Segmental block retaining walls: courses, blocks, caps, base gravel, drain stone, pipe and fabric, a cost estimate, and a gravity wall stability check with the geogrid a taller wall needs.

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

## Retaining Wall Block Calculator (Materials & Geogrid)

**Plan a segmental block retaining wall from one line of text.** Ask `retaining wall 40 ft long, 3 ft high, standard blocks, loam soil` and you get back:

- **The layout**: courses above ground and buried, the total height, the batter and how far the top steps back, and the trench to dig.
- **Materials**: blocks (with 5% for cuts), caps and adhesive, base gravel and drainage stone in cubic yards and tons, perforated drain pipe, filter fabric and geogrid, the block weight and the excavation.
- **A cost estimate** for the materials, at your prices or typical US ones.
- **A stability check**: whether the wall stands as a gravity wall (Coulomb earth pressure, overturning and sliding), the tallest wall that would, and the geogrid layers and length a taller wall needs, with slopes and driveways above the wall.
- **Charts** (a to-scale cross-section and the cost by item) and a **Markdown report**.

It's made for:

- Homeowners and DIYers pricing a garden or landscape wall before a trip to the store.
- Landscapers and hardscape contractors quoting walls.
- AI agents, home improvement and landscaping apps that need a retaining wall estimate they can show their work for.

![A chart made by this Actor for a 40 ft by 3 ft standard block wall in loam: a to-scale cross-section with 7 courses (1 buried), the gravel pad, drainage stone and pipe and 3 layers of geogrid, and about $2,092 of materials by item](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/retaining-wall-calculator-example.png?signature=190IYhcfdINQkHYR5f75J)

### How to use it

1. Write **Requests**, one per wall. The form has examples.
2. Optionally set the default **block** and **soil**.
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 |
|---|---|
| `40 ft long, 3 ft high`, `50' x 2'`, `4 ft wall 60 ft long`, `12 m long 1 m high`, `18 inches high` | Length and height above ground |
| `garden`, `standard`, `large`, `jumbo` blocks | 12×4×7, 16×6×10, 18×8×12 or 18×8×21 in blocks |
| `12x4x7 block 22 lb`, `3/4 inch setback`, `12 degree setback` | Your block |
| `clay`, `loam`, `sand`, `gravel` | The soil behind the wall (loam by default) |
| `2:1 slope behind`, `20 degree slope`, `driveway above`, `patio`, `250 psf` | Slopes and loads above the wall |
| `$6.50 per block`, `caps $4 each` | Prices |
| `no caps`, `no pipe`, `10% waste` | Options |

The same as an object: `{"length": 80, "height": 3.5, "block": "large", "soil": "sand", "prices": {"block": 6.25}}`.

### Examples

- `retaining wall 40 ft long, 3 ft high, standard blocks, loam soil` → 7 courses (1 buried), 221 blocks, 32 caps, 1.9 t base gravel, 6.2 t drain stone; too tall for a gravity wall, so 3 layers of geogrid 4 ft long; about $2,092.
- `50' x 2' garden block wall with caps` → 420 blocks, 53 caps; garden blocks top out near 2 ft total as a gravity wall.
- `4 ft wall 60 ft long with large blocks in clay, driveway above` → no height stands without geogrid under a driveway; an engineer's design.
- `30 ft long 5 ft tall wall, large blocks, 2:1 slope behind, $6.50 per block, caps $4 each` → 189 blocks, 4 layers of geogrid.
- `retaining wall 12 m long 1 m high, jumbo blocks, gravel` → stands as a gravity wall (overturning 4.3, sliding 3.3).
- `{"length": 80, "height": 3.5, "block": "large", "soil": "sand"}` → a gravity wall up to 4.85 ft total.

### How-to examples

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

#### How to count blocks for a retaining wall

```json
{"requests": ["retaining wall 40 ft long, 3 ft high, standard blocks, loam soil"]}
```

Result: 7 courses (1 buried), 221 blocks, 32 caps, 1.9 t base gravel, 6.2 t drain stone; too tall for a gravity wall, so 3 layers of geogrid 4 ft long; about $2,092.

#### How to estimate a garden block wall with caps

```json
{"requests": ["50' x 2' garden block wall with caps"]}
```

Result: 420 blocks, 53 caps; garden blocks top out near 2 ft total as a gravity wall.

#### How to check whether a wall needs geogrid

```json
{"requests": ["retaining wall 12 m long 1 m high, jumbo blocks, gravel"]}
```

Result: Stands as a gravity wall (overturning 4.3, sliding 3.3).

#### How to let an AI agent estimate a block retaining wall

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/retaining-wall-calculator`. The agent writes the wall in one line ("40 ft long, 3 ft high, standard blocks, loam soil") and passes on the block, cap, gravel and geogrid quantities and its warnings instead of guessing them.

### FAQ

**What does it give me?** Courses, blocks, caps, base gravel, drain stone, geogrid layers and a cost, with a check of whether the wall stands as a gravity wall.

**Which soils and blocks does it know?** Garden, standard, large and jumbo blocks in gravel, sand, loam or clay.

**Does it work in metric?** Yes: `retaining wall 12 m long 1 m high` works.

**Is this an engineered design?** No. Bearing, global stability and seismic loads aren't checked; a tall wall, poor soil or a load above needs an engineer, and your block maker's chart wins.

**How many can I run at once?** Up to 200 walls 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` | Walls as lines of text or objects (up to 200 per run) |
| `block` | The block when a request doesn't say (standard by default) |
| `soil` | The soil when a request doesn't say (loam 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": "wall", "title": "40 ft × 3 ft retaining wall",
  "summary": "40 ft × 3 ft standard block wall in loam: 7 courses (1 buried), 221 blocks, 32 caps, 1.9 t base gravel, 6.22 t drain stone. Too tall for a gravity wall (max 3.15 ft total, overturning 1.3, sliding 1.5): add 3 layers of geogrid 4 ft long (504 ft²). About $2,092 in materials.",
  "wall": {"block": "standard", "lengthFt": 40.0, "exposedFt": 3.0, "aboveCourses": 6, "buriedCourses": 1, "courses": 7, "totalHeightFt": 3.5, "batterDeg": 7.1, "topSetbackIn": 4.5, "trenchWidthIn": 34.0, "trenchDepthIn": 12.0},
  "stability": {"soil": "loam", "frictionAngle": 30.0, "ka": 0.25, "thrustLbPerFt": 179.0, "fsOverturning": 1.3, "fsSliding": 1.53, "maxGravityHeightFt": 3.15, "gravityOk": false, "needsGeogrid": true, "needsEngineer": false},
  "geogrid": {"layers": 3, "onCourses": [1, 3, 5], "lengthFt": 4.0, "spacingIn": 12.0, "areaFt2": 504.0},
  "materials": {"blocks": 221, "caps": 32, "adhesiveTubes": 3, "baseGravelTons": 1.9, "drainStoneTons": 6.22, "drainPipeFt": 50, "fabricFt2": 210, "geogridFt2": 504.0, "blockWeightTons": 6.52, "excavationYd3": 4.2},
  "cost": {"blocks": 994.0, "caps": 112.0, "drainStone": 311.0, "geogrid": 454.0, "total": 2092.0},
  "units": {"length": "ft", "volume": "yd³", "weight": "short tons", "money": "USD"}
}
```

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. **Courses**: the height above ground in whole courses, plus buried courses (1 inch per 8 inches of height, at least 6 inches). Blocks = ⌈length × 12 ÷ face width⌉ × courses × 1.05.
2. **Base and drainage**: a 6 in compacted gravel pad 12 in wider than the block, drainage stone 12 in behind the wall to 6 in below the top, a 4 in perforated pipe at the base running to daylight, and filter fabric in loam or clay. Stone at 1.4 tons a cubic yard.
3. **Stability** per foot of wall: Coulomb active pressure with wall friction 2/3 φ and the wall leaning back by its setback, soil at 120 pcf (φ gravel 34°, sand 32°, loam 30°, clay 26°), the wall at 125 pcf, base friction 34°, slopes and surcharges above; overturning about the toe and sliding on the base must reach 1.5 (NCMA minimums).
4. **Geogrid** when the gravity check fails: layers on top of every second 6-8 in course (16 in at most apart), each at least 60% of the wall height and 4 ft long, lengthened until the reinforced block passes the same checks.
5. **Warnings** for walls over 4 ft (IRC R404.4 needs a design), geogrid walls under slopes or driveways, and garden blocks pushed past their height.

### Pricing

You pay one low price per wall planned, at the price shown on this page. 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

- **Follow your block maker's chart**: their tested heights and geogrid schedules for that block win over these generic numbers.
- **Drainage matters most**: most failed walls fail from water pressure, which this check assumes the drain stone and pipe keep away.
- **Bearing, global stability and seismic loads aren't checked**; a tall wall, poor soil or a load above needs an engineer.
- **Limits**: 200 requests per run; straight walls (add blocks for corners and curves) up to 30 ft.

### 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`, `materials`, `stability`, `geogrid`, `cost` and `warnings`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~retaining-wall-calculator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"requests": ["retaining wall 40 ft long, 3 ft high, standard blocks, clay soil"]}'
```

`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/retaining-wall-calculator").call(run_input={
    "requests": [{"length": 60, "height": 2.5, "block": "large", "soil": "clay", "slope": "3:1"}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"])
```

### Credits

- Method: Coulomb active earth pressure and the overturning and sliding checks of the NCMA design manual for segmental retaining walls; common installation rules for burial, base, drainage and geogrid.
- 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 wall per entry, as a line of text or an object. Give its length and height above ground ('40 ft long, 3 ft high', '50 x 2 ft', '12 m long 1 m high'), the block ('garden', 'standard', 'large', 'jumbo' or a size like '12x4x7 block 22 lb'), the soil behind it ('clay', 'sand', 'gravel', 'loam'), anything above it ('2:1 slope', 'driveway', 'patio', '250 psf'), and prices ('$6.50 per block', 'caps $4 each'). Options: 'no caps', 'no pipe', '10% waste', '3/4 in setback'. Object fields: length, height, block, blockSize {width, height, depth, weight, setback}, soil, slope, surcharge, caps, drainPipe, waste, prices {block, cap, baseGravel, drainStone, pipe, fabric, geogrid}, units, title, text.

## `block` (type: `string`):

The block when a request doesn't say: garden 12x4x7 in, standard 16x6x10, large 18x8x12, jumbo 18x8x21 (standard by default).

## `soil` (type: `string`):

The soil behind the wall when a request doesn't say (loam by default).

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

A to-scale cross-section of the wall and its materials cost.

## Actor input object example

```json
{
  "requests": [
    "retaining wall 40 ft long, 3 ft high, standard blocks, loam soil",
    "50' x 2' garden block wall with caps",
    "4 ft wall 60 ft long with large blocks in clay, driveway above",
    "30 ft long 5 ft tall wall, large blocks, 2:1 slope behind, $6.50 per block, caps $4 each",
    "12x4x7 block 22 lb, 25 ft long, 18 inches high, sandy soil, no caps",
    "retaining wall 12 m long 1 m high, jumbo blocks, gravel",
    {
      "length": 80,
      "height": 3.5,
      "block": "large",
      "soil": "sand",
      "prices": {
        "block": 6.25
      }
    }
  ],
  "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": [
        "retaining wall 40 ft long, 3 ft high, standard blocks, loam soil",
        "50' x 2' garden block wall with caps",
        "4 ft wall 60 ft long with large blocks in clay, driveway above",
        "30 ft long 5 ft tall wall, large blocks, 2:1 slope behind, $6.50 per block, caps $4 each",
        "12x4x7 block 22 lb, 25 ft long, 18 inches high, sandy soil, no caps",
        "retaining wall 12 m long 1 m high, jumbo blocks, gravel",
        {
            "length": 80,
            "height": 3.5,
            "block": "large",
            "soil": "sand",
            "prices": {
                "block": 6.25
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/retaining-wall-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": [
        "retaining wall 40 ft long, 3 ft high, standard blocks, loam soil",
        "50' x 2' garden block wall with caps",
        "4 ft wall 60 ft long with large blocks in clay, driveway above",
        "30 ft long 5 ft tall wall, large blocks, 2:1 slope behind, $6.50 per block, caps $4 each",
        "12x4x7 block 22 lb, 25 ft long, 18 inches high, sandy soil, no caps",
        "retaining wall 12 m long 1 m high, jumbo blocks, gravel",
        {
            "length": 80,
            "height": 3.5,
            "block": "large",
            "soil": "sand",
            "prices": { "block": 6.25 },
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/retaining-wall-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": [
    "retaining wall 40 ft long, 3 ft high, standard blocks, loam soil",
    "50'\'' x 2'\'' garden block wall with caps",
    "4 ft wall 60 ft long with large blocks in clay, driveway above",
    "30 ft long 5 ft tall wall, large blocks, 2:1 slope behind, $6.50 per block, caps $4 each",
    "12x4x7 block 22 lb, 25 ft long, 18 inches high, sandy soil, no caps",
    "retaining wall 12 m long 1 m high, jumbo blocks, gravel",
    {
      "length": 80,
      "height": 3.5,
      "block": "large",
      "soil": "sand",
      "prices": {
        "block": 6.25
      }
    }
  ]
}' |
apify call jumblemog/retaining-wall-calculator --silent --output-dataset

```

## MCP server setup

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