# Particle Settling API
> Particle settling-velocity maths as an API, computed locally and deterministically. The stokes endpoint computes the terminal settling velocity of a small spherical particle by Stokes' law, vt = (ρp − ρf)·g·d²/(18·μ), from the particle diameter and density, the fluid density and the dynamic viscosity, and checks the particle Reynolds number to tell you whether the creeping-flow assumption (Re < 1) still holds — a negative velocity means a buoyant particle that rises. The terminal endpoint computes the drag-based terminal velocity for larger, faster particles, vt = √(4·g·d·(ρp − ρf)/(3·Cd·ρf)), from a drag coefficient (≈0.44 in the turbulent Newton regime). The time endpoint computes the time for a particle to settle through a given depth, t = height/vt, taking the velocity directly or deriving it from the particle properties via Stokes. Everything is computed locally and deterministically, so it is instant and private. Ideal for water- and wastewater-treatment, mineral-processing and environmental-engineering tools, clarifier and settling-tank design, sediment and aerosol analysis, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is particle sedimentation; for pipe-flow Reynolds/Froude/Mach numbers use a Reynolds 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/settling-api/..."
```

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

## Endpoints

### Settling

#### `GET /v1/stokes` — Stokes settling velocity

**Parameters:**
- `particle_diameter` (query, required, string) — Particle diameter d (m) Example: `0.0001`
- `particle_density` (query, required, string) — Particle density ρp (kg/m³) Example: `2650`
- `fluid_density` (query, optional, string) — Fluid density ρf (kg/m³, default 1000) Example: `1000`
- `dynamic_viscosity` (query, optional, string) — Dynamic viscosity μ (Pa·s, default 0.001) Example: `0.001`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/settling-api/v1/stokes?particle_diameter=0.0001&particle_density=2650&fluid_density=1000&dynamic_viscosity=0.001"
```

**Response:**
```json
{
    "data": {
        "note": "vt = (ρp − ρf)·g·d²/(18·μ). Valid for creeping flow Re < 1; above that use the drag-based terminal velocity. A negative vt means the particle rises.",
        "inputs": {
            "fluid_density": 1000,
            "particle_density": 2650,
            "dynamic_viscosity": 0.001,
            "particle_diameter": 0.0001
        },
        "stokes_valid": true,
        "terminal_velocity_m_s": 0.0089925,
        "terminal_velocity_mm_s": 8.9925,
        "particle_reynolds_number": 0.89925
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.349Z",
        "request_id": "6b222f3b-9798-4c25-981f-13be383be2f3"
    },
    "status": "ok",
    "message": "Stokes settling velocity",
    "success": true
}
```

#### `GET /v1/terminal` — Drag-based terminal velocity

**Parameters:**
- `particle_diameter` (query, required, string) — Particle diameter d (m) Example: `0.002`
- `particle_density` (query, required, string) — Particle density ρp (kg/m³) Example: `2650`
- `fluid_density` (query, optional, string) — Fluid density ρf (kg/m³, default 1000) Example: `1000`
- `drag_coefficient` (query, optional, string) — Drag coefficient Cd (default 0.44) Example: `0.44`
- `dynamic_viscosity` (query, optional, string) — Viscosity μ (Pa·s) for the Reynolds number Example: `0.001`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/settling-api/v1/terminal?particle_diameter=0.002&particle_density=2650&fluid_density=1000&drag_coefficient=0.44&dynamic_viscosity=0.001"
```

**Response:**
```json
{
    "data": {
        "note": "vt = √(4·g·d·(ρp − ρf)/(3·Cd·ρf)). Cd ≈ 0.44 in the Newton (turbulent) regime; supply μ for the Reynolds number.",
        "inputs": {
            "fluid_density": 1000,
            "drag_coefficient": 0.44,
            "particle_density": 2650,
            "particle_diameter": 0.002
        },
        "terminal_velocity_m_s": 0.313209195,
        "terminal_velocity_mm_s": 313.209195,
        "particle_reynolds_number": 626.418391
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.445Z",
        "request_id": "dd1ffd88-6799-4e77-af5e-5b9159957a29"
    },
    "status": "ok",
    "message": "Terminal velocity",
    "success": true
}
```

#### `GET /v1/time` — Settling time

**Parameters:**
- `height` (query, required, string) — Settling depth (m) Example: `2`
- `settling_velocity` (query, optional, string) — Settling velocity (m/s)
- `particle_diameter` (query, optional, string) — Or particle diameter d (m) for Stokes Example: `0.0001`
- `particle_density` (query, optional, string) — and particle density ρp (kg/m³) Example: `2650`
- `fluid_density` (query, optional, string) — Fluid density (kg/m³, default 1000) Example: `1000`
- `dynamic_viscosity` (query, optional, string) — Viscosity (Pa·s, default 0.001) Example: `0.001`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/settling-api/v1/time?height=2&particle_diameter=0.0001&particle_density=2650&fluid_density=1000&dynamic_viscosity=0.001"
```

**Response:**
```json
{
    "data": {
        "note": "t = height/vt. With particle properties the velocity is taken from Stokes' law first.",
        "inputs": {
            "height": 2,
            "settling_velocity": 0.0089925,
            "velocity_from_stokes": true
        },
        "settling_time_h": 0.06178,
        "settling_time_s": 222.4076,
        "settling_time_min": 3.70679
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.540Z",
        "request_id": "a8c17129-56f1-485c-bb83-acb4c1f9f271"
    },
    "status": "ok",
    "message": "Settling time",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Diameter in m, density in kg/m³, viscosity in Pa·s. Water defaults: ρf = 1000, μ = 0.001. Stokes assumes spherical particles in creeping flow (Re < 1).",
        "service": "settling-api",
        "formulae": {
            "time": "t = height/vt",
            "stokes": "vt = (ρp − ρf)·g·d²/(18·μ)",
            "terminal": "vt = √(4·g·d·(ρp − ρf)/(3·Cd·ρf))"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/time": "Settling time over a depth, from a velocity or from particle properties.",
            "GET /v1/stokes": "Stokes' law terminal velocity vt = (ρp−ρf)·g·d²/(18·μ), with a Reynolds validity check.",
            "GET /v1/terminal": "Drag-based terminal velocity vt = √(4·g·d·(ρp−ρf)/(3·Cd·ρf)) for higher Reynolds numbers."
        },
        "description": "Particle settling-velocity calculator: Stokes' law terminal velocity, drag-based terminal velocity and settling time for sedimentation and separation."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.615Z",
        "request_id": "ca9b013f-fa50-4875-90d1-d03e78d09ab5"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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