# Physics Motion API
> Classical-mechanics maths as an API. The kinematics endpoint is a full SUVAT solver: give any three of initial velocity (u), final velocity (v), acceleration (a), time (t) and displacement (s) and it computes the rest using the standard constant-acceleration equations. The projectile endpoint takes a launch speed and angle (and an optional launch height and gravity) and returns the horizontal and vertical velocity components, the time to the peak, the maximum height, the total flight time, the range and the impact speed. The free-fall endpoint computes a vacuum fall from a height or for a time, with an optional initial velocity, returning the fall time, distance and impact velocity. Gravity defaults to standard 9.80665 m/s² but can be set for the Moon, Mars or any body. Everything is computed locally and deterministically in SI units, so it is instant and private. Ideal for physics education and homework, engineering and simulation, game and ballistics development, and motion tools. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is motion physics; for planetary data use a planets API and for unit conversion use a unit 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/physics-api/..."
```

## Pricing
- **Free** (Free) — 7,835 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 17,350 calls/Mo, 8 req/s
- **Pro** ($29/Mo) — 224,500 calls/Mo, 20 req/s
- **Mega** ($67/Mo) — 1,165,000 calls/Mo, 50 req/s

## Endpoints

### Physics

#### `GET /v1/free-fall` — Free fall (vacuum)

**Parameters:**
- `height` (query, optional, string) — Drop height m Example: `20`
- `time` (query, optional, string) — Or a fall time s
- `gravity` (query, optional, string) — m/s²

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/physics-api/v1/free-fall?height=20"
```

**Response:**
```json
{
    "data": {
        "mode": "from height",
        "gravity": 9.80665,
        "height_m": 20,
        "fall_time_s": 2.01962,
        "initial_velocity": 0,
        "impact_velocity_m_s": 19.8057
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:06.803Z",
        "request_id": "f4608d6d-d991-4a6f-bb04-6d345b21d5d7"
    },
    "status": "ok",
    "message": "Free fall",
    "success": true
}
```

#### `GET /v1/kinematics` — SUVAT solver

**Parameters:**
- `u` (query, optional, string) — Initial velocity Example: `0`
- `v` (query, optional, string) — Final velocity
- `a` (query, optional, string) — Acceleration Example: `2`
- `t` (query, optional, string) — Time Example: `5`
- `s` (query, optional, string) — Displacement

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/physics-api/v1/kinematics?u=0&a=2&t=5"
```

**Response:**
```json
{
    "data": {
        "a": 2,
        "s": 25,
        "t": 5,
        "u": 0,
        "v": 10,
        "solved_for": [
            "v",
            "s"
        ]
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:06.921Z",
        "request_id": "2a270334-0d69-4b9f-91cb-c7c99cc5ba8f"
    },
    "status": "ok",
    "message": "Kinematics",
    "success": true
}
```

#### `GET /v1/projectile` — Projectile motion

**Parameters:**
- `velocity` (query, required, string) — Launch speed m/s Example: `20`
- `angle` (query, required, string) — Launch angle deg Example: `45`
- `height` (query, optional, string) — Launch height m
- `gravity` (query, optional, string) — m/s² (default 9.80665)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/physics-api/v1/projectile?velocity=20&angle=45"
```

**Response:**
```json
{
    "data": {
        "vx": 14.1421,
        "vy": 14.1421,
        "gravity": 9.80665,
        "range_m": 40.7886,
        "velocity": 20,
        "angle_deg": 45,
        "max_height_m": 10.1972,
        "flight_time_s": 2.88419,
        "launch_height": 0,
        "time_to_peak_s": 1.4421,
        "impact_speed_m_s": 20
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:07.001Z",
        "request_id": "3fa74b94-71eb-4a4d-9b4a-e8415acdd278"
    },
    "status": "ok",
    "message": "Projectile",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "Physics Motion API",
        "notes": "SI units (m, s, m/s, m/s²). Gravity defaults to 9.80665 m/s². Velocities from v²=u²+2as are returned as the positive root. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/kinematics",
                "params": {
                    "a": "acceleration",
                    "s": "displacement (give any three)",
                    "t": "time",
                    "u": "initial velocity",
                    "v": "final velocity"
                },
                "returns": "all five SUVAT quantities"
            },
            {
                "path": "/v1/projectile",
                "params": {
                    "angle": "launch angle degrees",
                    "height": "launch height m (optional)",
                    "gravity": "m/s² (default 9.80665)",
                    "velocity": "launch speed m/s"
                },
                "returns": "range, max height, flight time, impact speed"
            },
            {
                "path": "/v1/free-fall",
                "params": {
                    "time": "or a fall time s",
                    "height": "drop height m",
                    "gravity": "m/s²",
                    "initial_velocity": "m/s (optional)"
                },
                "returns": "fall time, distance and impact velocity"
            },
            {
                "path": "/v1/meta"
…(truncated, see openapi.json for full schema)
```


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