# Soil Bearing Capacity API
> Geotechnical foundation maths as an API, computed locally and deterministically. The factors endpoint computes the Terzaghi/Vesic bearing-capacity factors Nc, Nq and Nγ from a soil friction angle — Nq = e^(π·tanφ)·tan²(45+φ/2), Nc = (Nq−1)·cotφ and Nγ = 2(Nq+1)·tanφ. The bearing-capacity endpoint computes the ultimate, net and allowable bearing capacity of a strip, square or circular footing from the cohesion, friction angle, soil unit weight, footing width and founding depth, qu = sc·c·Nc + γ·D·Nq + sγ·γ·B·Nγ, breaking it into its cohesion, surcharge and self-weight components and dividing by a factor of safety (default 3) for the allowable value. The settlement endpoint computes the immediate elastic settlement of a footing, s = q·B·(1−ν²)·I / E, from the applied pressure, the footing width, the soil elastic modulus and Poisson's ratio. Cohesion and pressures are in kilopascals, unit weight in kN/m³ and lengths in metres. Everything is computed locally and deterministically, so it is instant and private. Ideal for civil-engineering, geotechnical, foundation-design and construction app developers, footing-sizing and feasibility tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is foundation bearing capacity; for lateral earth pressure on walls use an earth-pressure API and for open-channel flow a Manning API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/soil-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 18,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 90,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 431,000 calls/Mo, 40 req/s

## Endpoints

### Soil

#### `GET /v1/bearing-capacity` — Bearing capacity

**Parameters:**
- `friction_angle` (query, required, string) — Friction angle φ (degrees) Example: `30`
- `cohesion` (query, optional, string) — Cohesion c (kPa) Example: `0`
- `unit_weight` (query, required, string) — Soil unit weight γ (kN/m³) Example: `18`
- `width` (query, required, string) — Footing width B (m) Example: `2`
- `depth` (query, optional, string) — Founding depth D (m) Example: `1`
- `shape` (query, optional, string) — strip, square or circular Example: `strip`
- `factor_of_safety` (query, optional, string) — Factor of safety Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soil-api/v1/bearing-capacity?friction_angle=30&cohesion=0&unit_weight=18&width=2&depth=1&shape=strip&factor_of_safety=3"
```

**Response:**
```json
{
    "data": {
        "note": "qu = sc·c·Nc + γ·D·Nq + sγ·γ·B·Nγ. Allowable = qu ÷ factor of safety (default 3). Pressures in kPa.",
        "inputs": {
            "shape": "strip",
            "depth_m": 1,
            "width_m": 2,
            "unit_weight": 18,
            "cohesion_kpa": 0,
            "factor_of_safety": 3,
            "friction_angle_deg": 30
        },
        "factors": {
            "Nc": 30.1396,
            "Nq": 18.4011,
            "Ngamma": 22.4025
        },
        "components_kpa": {
            "cohesion": 0,
            "surcharge": 331.2202,
            "self_weight": 403.2448
        },
        "ultimate_bearing_capacity_kpa": 734.465,
        "allowable_bearing_capacity_kpa": 244.8217,
        "net_ultimate_bearing_capacity_kpa": 716.465,
        "net_allowable_bearing_capacity_kpa": 238.8217
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:00.974Z",
        "request_id": "c2e52489-db2b-4f32-bd17-f22e319ad586"
    },
    "status": "ok",
    "message": "Bearing capacity",
    "success": true
}
```

#### `GET /v1/factors` — Bearing-capacity factors

**Parameters:**
- `friction_angle` (query, required, string) — Friction angle φ (degrees) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soil-api/v1/factors?friction_angle=30"
```

**Response:**
```json
{
    "data": {
        "Nc": 30.1396,
        "Nq": 18.4011,
        "note": "Bearing-capacity factors: Nq = e^(π·tanφ)·tan²(45+φ/2), Nc = (Nq−1)·cotφ, Nγ = 2(Nq+1)·tanφ (Vesic).",
        "Ngamma": 22.4025,
        "inputs": {
            "friction_angle_deg": 30
        }
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.049Z",
        "request_id": "28b8fb78-bf7d-4701-a678-b3bd2a17579f"
    },
    "status": "ok",
    "message": "Bearing factors",
    "success": true
}
```

#### `GET /v1/settlement` — Elastic settlement

**Parameters:**
- `pressure` (query, required, string) — Applied pressure (kPa) Example: `100`
- `width` (query, required, string) — Footing width B (m) Example: `2`
- `elastic_modulus` (query, required, string) — Soil elastic modulus E (kPa) Example: `20000`
- `poisson_ratio` (query, optional, string) — Poisson's ratio ν Example: `0.3`
- `influence_factor` (query, optional, string) — Influence factor I Example: `1.12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soil-api/v1/settlement?pressure=100&width=2&elastic_modulus=20000&poisson_ratio=0.3&influence_factor=1.12"
```

**Response:**
```json
{
    "data": {
        "note": "Elastic settlement s = q·B·(1−ν²)·I / E. The influence factor I depends on footing shape and rigidity (≈1.12 for a flexible square centre).",
        "inputs": {
            "width_m": 2,
            "pressure_kpa": 100,
            "poisson_ratio": 0.3,
            "influence_factor": 1.12,
            "elastic_modulus_kpa": 20000
        },
        "settlement_m": 0.010192,
        "settlement_mm": 10.192
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.133Z",
        "request_id": "5bc155e3-eb57-41d0-a563-3df0f3031956"
    },
    "status": "ok",
    "message": "Settlement",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soil-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Cohesion and pressures in kPa, unit weight in kN/m³, lengths in m, friction angle in degrees. Vesic Nγ with Terzaghi shape coefficients; allowable uses a factor of safety (default 3).",
        "service": "soil-api",
        "formulae": {
            "Nq": "e^(π·tanφ)·tan²(45+φ/2)",
            "settlement": "s = q·B·(1−ν²)·I / E",
            "bearing_capacity": "qu = sc·c·Nc + γ·D·Nq + sγ·γ·B·Nγ"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/factors": "Bearing-capacity factors Nc, Nq and Nγ from the friction angle.",
            "GET /v1/settlement": "Immediate elastic settlement of a footing.",
            "GET /v1/bearing-capacity": "Ultimate, net and allowable bearing capacity of a strip/square/circular footing."
        },
        "description": "Geotechnical bearing-capacity calculator: bearing-capacity factors from the friction angle, ultimate and allowable bearing capacity of a footing, and elastic settlement."
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.200Z",
        "request_id": "d9691f65-e1b4-41dc-89b7-7d7d2c8528e8"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/soil-api
OpenAPI spec: https://www.oanor.com/api/soil-api/openapi.json
