# Coulomb & Electric Field API
> Coulomb's-law electrostatics as an API, computed locally and deterministically. The force endpoint computes the electrostatic force between two point charges, F = k·q1·q2/(εr·r²) — Coulomb's law, with k = 8.9876×10⁹ N·m²/C² — from the two charges, their separation and an optional relative permittivity for a dielectric medium, and tells you whether the force is attractive (opposite signs) or repulsive (like signs). The field endpoint gives the electric field of a point charge, E = k·q/(εr·r²), its direction (away from a positive charge, toward a negative one), and the force on a test charge placed there, F = q_test·E. The potential endpoint gives the electric potential V = k·q/(εr·r) and, for a pair of charges, the electrostatic potential energy U = k·q1·q2/(εr·r) in joules and electron-volts. Charges may be entered in coulombs, microcoulombs or nanocoulombs. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and electrical-engineering education tools, electrostatics and field-theory apps, and laboratory and simulation software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is electrostatics; for Ohm's law and DC/AC circuits use an Ohm's-law 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/coulomb-api/..."
```

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

## Endpoints

### Electrostatics

#### `GET /v1/field` — Electric field of a point charge

**Parameters:**
- `charge` (query, required, string) — Source charge (C) Example: `0.000001`
- `distance` (query, required, string) — Distance r (m) Example: `0.1`
- `test_charge` (query, optional, string) — Test charge for the force (C)
- `relative_permittivity` (query, optional, string) — Dielectric εr (default 1)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coulomb-api/v1/field?charge=0.000001&distance=0.1"
```

**Response:**
```json
{
    "data": {
        "formula": "E = k·q/(εr·r²); force on a test charge F = q_test·E.",
        "charge_c": 1.0e-6,
        "distance_m": 0.1,
        "field_direction": "away from the charge",
        "electric_field_v_m": 898755.17873682,
        "relative_permittivity": 1,
        "electric_field_magnitude_v_m": 898755.17873682
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:45.739Z",
        "request_id": "0a7652ae-c0ef-4d3c-8790-ba1d08839f1d"
    },
    "status": "ok",
    "message": "Electric field",
    "success": true
}
```

#### `GET /v1/force` — Coulomb force between two charges

**Parameters:**
- `charge1` (query, required, string) — Charge 1 (C) Example: `0.000001`
- `charge2` (query, required, string) — Charge 2 (C) Example: `0.000002`
- `distance` (query, required, string) — Separation r (m) Example: `0.1`
- `relative_permittivity` (query, optional, string) — Dielectric εr (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coulomb-api/v1/force?charge1=0.000001&charge2=0.000002&distance=0.1&relative_permittivity=1"
```

**Response:**
```json
{
    "data": {
        "force_n": 1.7975103575,
        "formula": "F = k·q1·q2/(εr·r²); k = 8.9876×10⁹ N·m²/C².",
        "charge1_c": 1.0e-6,
        "charge2_c": 2.0e-6,
        "distance_m": 0.1,
        "interaction": "repulsive",
        "force_magnitude_n": 1.7975103575,
        "relative_permittivity": 1
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:45.880Z",
        "request_id": "6d55877c-c9b6-4648-9343-e211c5046f0b"
    },
    "status": "ok",
    "message": "Coulomb force",
    "success": true
}
```

#### `GET /v1/potential` — Electric potential & energy

**Parameters:**
- `charge` (query, required, string) — Source charge (C) Example: `0.000001`
- `distance` (query, required, string) — Distance r (m) Example: `0.1`
- `charge2` (query, optional, string) — Second charge for pair energy (C) Example: `0.000002`
- `relative_permittivity` (query, optional, string) — Dielectric εr (default 1)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/coulomb-api/v1/potential?charge=0.000001&distance=0.1&charge2=0.000002"
```

**Response:**
```json
{
    "data": {
        "formula": "V = k·q/(εr·r); U = k·q1·q2/(εr·r).",
        "charge_c": 1.0e-6,
        "charge2_c": 2.0e-6,
        "distance_m": 0.1,
        "potential_energy_j": 0.179751035747,
        "potential_energy_ev": 1121917720760890100,
        "electric_potential_v": 89875.51787368,
        "relative_permittivity": 1
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:45.971Z",
        "request_id": "56a2633e-0e7d-41d2-8247-5c15b99da543"
    },
    "status": "ok",
    "message": "Electric potential & energy",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "coulomb",
        "note": "Coulomb's law / electrostatics — computed locally and deterministically, no key, no third-party service.",
        "constants": {
            "coulomb_constant": 8987551787.368176,
            "elementary_charge": 1.602176634e-19,
            "vacuum_permittivity": 8.8541878128e-12
        },
        "endpoints": [
            "/v1/force",
            "/v1/field",
            "/v1/potential",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:46.057Z",
        "request_id": "75a740c9-7cd4-44c4-afb6-8f407475faad"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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