# Drag & Terminal Velocity API
> Aerodynamic drag and terminal-velocity maths as an API, computed locally and deterministically. The drag endpoint computes the drag force on a body moving through a fluid, F_d = ½·ρ·Cd·A·v² — half the fluid density times the drag coefficient, the reference area and the velocity squared — together with the dynamic pressure ½·ρ·v², from a fluid (air, water, seawater, oil and more, or a custom density), a drag coefficient (given directly or from a built-in shape table) the area and the speed. The terminal endpoint computes the terminal velocity of a falling object, v_t = √(2·m·g/(ρ·Cd·A)) — the steady speed at which drag balances gravity — from the mass and area, or for a sphere from its diameter and material density, in metres per second, km/h and mph (a belly-down skydiver reaches about 55 m/s, 200 km/h). The shapes endpoint lists typical drag coefficients for spheres, cubes, cylinders, flat plates, streamlined bodies, skydivers, cars, parachutes and more. Everything is computed locally and deterministically, so it is instant and private. Ideal for aerodynamics and ballistics tools, skydiving, model-rocketry and motorsport apps, sphere-settling and sedimentation calculators, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is drag and terminal velocity; for vacuum projectile and SUVAT kinematics use a physics API and for pipe friction pressure drop use a Darcy-Weisbach 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/drag-api/..."
```

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($15/Mo) — 300,000 calls/Mo, 15 req/s
- **Mega** ($49/Mo) — 2,000,000 calls/Mo, 40 req/s

## Endpoints

### Drag

#### `GET /v1/drag` — Drag force

**Parameters:**
- `fluid` (query, optional, string) — air|water|seawater|oil… (default air) Example: `air`
- `density` (query, optional, string) — Or fluid density (kg/m³)
- `drag_coefficient` (query, optional, string) — Cd Example: `0.47`
- `shape` (query, optional, string) — Or a shape (sphere, cube, car…) Example: `sphere`
- `area` (query, required, string) — Reference area (m²) Example: `0.01`
- `velocity` (query, required, string) — Velocity (m/s) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/drag-api/v1/drag?fluid=air&drag_coefficient=0.47&shape=sphere&area=0.01&velocity=10"
```

**Response:**
```json
{
    "data": {
        "fluid": "air",
        "area_m2": 0.01,
        "formula": "F_d = ½·ρ·Cd·A·v²; dynamic pressure q = ½·ρ·v².",
        "velocity_ms": 10,
        "drag_force_n": 0.287875,
        "density_kg_m3": 1.225,
        "drag_force_kgf": 0.029355,
        "drag_coefficient": 0.47,
        "dynamic_pressure_pa": 61.25,
        "drag_coefficient_source": "given"
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:46.192Z",
        "request_id": "d505717d-7dcf-4588-846e-d7a2abe2ee90"
    },
    "status": "ok",
    "message": "Drag force",
    "success": true
}
```

#### `GET /v1/shapes` — Drag-coefficient reference

**Parameters:**
- `shape` (query, optional, string) — A shape to look up (or omit for all) Example: `parachute`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/drag-api/v1/shapes?shape=parachute"
```

**Response:**
```json
{
    "data": {
        "shape": "parachute",
        "drag_coefficient": 1.75
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:46.299Z",
        "request_id": "3ca5efa6-7633-4439-b138-0352bc1a9942"
    },
    "status": "ok",
    "message": "Drag-coefficient reference",
    "success": true
}
```

#### `GET /v1/terminal` — Terminal velocity

**Parameters:**
- `mass` (query, optional, string) — Mass (kg) Example: `80`
- `area` (query, optional, string) — Reference area (m²) Example: `0.7`
- `diameter` (query, optional, string) — Or sphere diameter (m)
- `object_density` (query, optional, string) — Sphere material density (kg/m³)
- `drag_coefficient` (query, optional, string) — Cd (or shape) Example: `1.0`
- `shape` (query, optional, string) — Shape for Cd
- `fluid` (query, optional, string) — Fluid (default air) Example: `air`
- `gravity` (query, optional, string) — Gravity (default 9.80665)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/drag-api/v1/terminal?mass=80&area=0.7&drag_coefficient=1.0&fluid=air"
```

**Response:**
```json
{
    "data": {
        "fluid": "air",
        "area_m2": 0.7,
        "formula": "v_t = √(2·m·g / (ρ·Cd·A)).",
        "mass_kg": 80,
        "gravity_ms2": 9.80665,
        "density_kg_m3": 1.225,
        "drag_coefficient": 1,
        "terminal_velocity": {
            "velocity_ms": 42.776305,
            "velocity_kmh": 153.994697,
            "velocity_mph": 95.687868
        },
        "drag_coefficient_source": "given"
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:46.396Z",
        "request_id": "73a2e897-093b-41ee-92ab-230b2af8218d"
    },
    "status": "ok",
    "message": "Terminal velocity",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "drag",
        "note": "Aerodynamic drag & terminal velocity — computed locally and deterministically, no key, no third-party service.",
        "fluids": [
            "air",
            "water",
            "seawater",
            "oil",
            "helium",
            "co2"
        ],
        "shapes": [
            "sphere",
            "smooth_sphere",
            "cube",
            "cube_angled",
            "cylinder",
            "long_cylinder",
            "short_cylinder",
            "flat_plate",
            "flat_plate_perpendicular",
            "angled_cube",
            "streamlined_body",
            "airfoil",
            "teardrop",
            "hemisphere",
            "hemisphere_hollow",
            "cone",
            "skydiver_belly",
            "skydiver_headdown",
            "car",
            "bicycle",
            "person_standing",
            "parachute",
            "raindrop"
        ],
        "endpoints": [
            "/v1/drag",
            "/v1/terminal",
            "/v1/shapes",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:46.471Z",
        "request_id": "a7bfb1a0-2587-42d7-93a2-d6508ec12a18"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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