# Geometric Solids API
> Advanced 3D-solid geometry as an API, computed locally and deterministically — the shapes a basic geometry calculator leaves out. The cone-frustum endpoint gives the volume V = (π·h/3)·(R² + R·r + r²), the slant height √(h² + (R−r)²) and the lateral and total surface area of a truncated cone, the shape of buckets, lampshades and hoppers. The torus endpoint gives a doughnut’s volume 2π²·R·r² and surface area 4π²·R·r from its centre-to-tube and tube radii. The ellipsoid endpoint gives the exact volume (4/3)π·a·b·c and a Knud-Thomsen surface-area approximation accurate to better than 1.1 %. The platonic endpoint returns the volume and surface area of any of the five Platonic solids — tetrahedron, cube, octahedron, dodecahedron and icosahedron — from the edge length, using the exact golden-ratio coefficients (a unit icosahedron has volume 2.1817 and surface area 8.6603). Use a consistent length unit and get area and volume out. Everything is computed locally and deterministically, so it is instant and private. Ideal for engineering, CAD, 3D-modelling, architecture, manufacturing and maths-education app developers, volume-and-area and packaging tools, and simulation software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. These are the advanced solids; for sphere, cube, cylinder, cone and 2D shapes use a general geometry 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/solids-api/..."
```

## Pricing
- **Free** (Free) — 4,650 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 46,500 calls/Mo, 6 req/s
- **Pro** ($14/Mo) — 212,000 calls/Mo, 15 req/s
- **Mega** ($43/Mo) — 1,255,000 calls/Mo, 40 req/s

## Endpoints

### Solids

#### `GET /v1/cone-frustum` — Truncated cone

**Parameters:**
- `radius_bottom` (query, required, string) — Bottom radius R Example: `5`
- `radius_top` (query, required, string) — Top radius r Example: `3`
- `height` (query, required, string) — Height h Example: `4`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/solids-api/v1/cone-frustum?radius_bottom=5&radius_top=3&height=4"
```

**Response:**
```json
{
    "data": {
        "note": "Cone frustum (truncated cone): V = (π·h/3)·(R² + R·r + r²); lateral area = π(R+r)·√(h² + (R−r)²).",
        "inputs": {
            "height": 4,
            "radius_top": 3,
            "radius_bottom": 5
        },
        "volume": 205.25072,
        "slant_height": 4.472136,
        "total_surface_area": 219.211186,
        "lateral_surface_area": 112.397036
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:11.222Z",
        "request_id": "1dbda7c9-7956-499f-bce8-86d7c059d4eb"
    },
    "status": "ok",
    "message": "Cone frustum",
    "success": true
}
```

#### `GET /v1/ellipsoid` — Ellipsoid

**Parameters:**
- `a` (query, required, string) — Semi-axis a Example: `3`
- `b` (query, required, string) — Semi-axis b Example: `4`
- `c` (query, required, string) — Semi-axis c Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/solids-api/v1/ellipsoid?a=3&b=4&c=5"
```

**Response:**
```json
{
    "data": {
        "note": "Ellipsoid: V = (4/3)π·a·b·c (exact); surface area by the Knud Thomsen approximation (error < 1.1%). With a=b=c it reduces to a sphere.",
        "inputs": {
            "a": 3,
            "b": 4,
            "c": 5
        },
        "volume": 251.327412,
        "surface_area_approx": 199.501704
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:11.332Z",
        "request_id": "9a0454b4-5073-4e48-b80e-6b1390069e8a"
    },
    "status": "ok",
    "message": "Ellipsoid",
    "success": true
}
```

#### `GET /v1/platonic` — Platonic solid

**Parameters:**
- `solid` (query, required, string) — tetrahedron, cube, octahedron, dodecahedron, icosahedron Example: `icosahedron`
- `edge` (query, required, string) — Edge length Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/solids-api/v1/platonic?solid=icosahedron&edge=1"
```

**Response:**
```json
{
    "data": {
        "note": "Platonic solid from edge length a. Cube: V=a³, S=6a². Tetrahedron: V=a³/(6√2). Dodecahedron and icosahedron use the golden-ratio coefficients.",
        "faces": 20,
        "inputs": {
            "edge": 1,
            "solid": "icosahedron"
        },
        "volume": 2.18169499,
        "surface_area": 8.66025404
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:11.442Z",
        "request_id": "f6eb5fd0-8490-45b7-b983-9246593f91e8"
    },
    "status": "ok",
    "message": "Platonic solid",
    "success": true
}
```

#### `GET /v1/torus` — Torus

**Parameters:**
- `major_radius` (query, required, string) — Centre-to-tube radius R Example: `10`
- `minor_radius` (query, required, string) — Tube radius r Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/solids-api/v1/torus?major_radius=10&minor_radius=3"
```

**Response:**
```json
{
    "data": {
        "note": "Torus (doughnut): V = 2π²·R·r²; surface area = 4π²·R·r, where R is the centre-to-tube radius and r the tube radius.",
        "inputs": {
            "major_radius": 10,
            "minor_radius": 3
        },
        "volume": 1776.528792,
        "surface_area": 1184.352528
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:11.551Z",
        "request_id": "bfb509c6-6355-4a9e-a153-93cd3d55b8aa"
    },
    "status": "ok",
    "message": "Torus",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Consistent length unit in, area and volume out. For basic sphere/cube/cylinder/cone use a general geometry API.",
        "service": "solids-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/torus": "Torus volume and surface area.",
            "GET /v1/platonic": "A Platonic solid's volume and surface area from its edge.",
            "GET /v1/ellipsoid": "Ellipsoid volume and (approximate) surface area.",
            "GET /v1/cone-frustum": "Truncated cone volume and surface area."
        },
        "description": "Advanced 3D solids: cone frustum, torus, ellipsoid and the five Platonic solids — volume and surface area.",
        "platonic_solids": [
            "tetrahedron",
            "cube",
            "hexahedron",
            "octahedron",
            "dodecahedron",
            "icosahedron"
        ]
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:11.674Z",
        "request_id": "0aa5c667-8473-4f3f-916b-1dc2484735c2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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