# Optical Resolution API
> Optical resolution by the Rayleigh criterion as an API, computed locally and deterministically. The angular endpoint gives the smallest angle two points can be apart and still be told apart through a circular aperture, θ = 1.22·λ/D — the diffraction limit set by the wavelength and the aperture diameter — in radians, degrees, arcminutes and arcseconds (a 100 mm telescope resolves about 1.4 arcseconds in green light), and solves the aperture needed for a target resolution. The distance endpoint turns that angle into a real separation at a distance, s = θ·L = 1.22·λ·L/D — how far apart two objects must be to be resolved at a given range. The microscope endpoint computes resolving power from the numerical aperture: the Rayleigh limit d = 0.61·λ/NA and the Abbe limit d = λ/(2·NA), with NA = n·sin(θ) from a refractive index and half-angle, and the maximum useful magnification. Wavelength defaults to 550 nm (visible) and can be set in metres, nanometres or micrometres. Everything is computed locally and deterministically, so it is instant and private. Ideal for astronomy, telescope and binocular tools, microscopy and imaging-system design, camera and optics apps, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the diffraction-limited resolving power; for thin-lens imaging use a lens API and for slit and grating diffraction use a diffraction 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/resolution-api/..."
```

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

## Endpoints

### Resolution

#### `GET /v1/angular` — Rayleigh angular resolution

**Parameters:**
- `wavelength_nm` (query, optional, string) — Wavelength (nm, default 550) Example: `550`
- `aperture_diameter` (query, optional, string) — Aperture diameter D (m) Example: `0.1`
- `angle_rad` (query, optional, string) — Or an angle (rad) to solve the aperture

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/resolution-api/v1/angular?wavelength_nm=550&aperture_diameter=0.1"
```

**Response:**
```json
{
    "data": {
        "formula": "θ = 1.22·λ/D (Rayleigh criterion, circular aperture).",
        "angle_deg": 0.0003844547,
        "angle_rad": 6.71e-6,
        "angle_arcmin": 0.02306728,
        "angle_arcsec": 1.384037,
        "wavelength_nm": 550,
        "aperture_diameter_m": 0.1
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:43.185Z",
        "request_id": "46e3a44e-ef3f-4d26-981e-e9225a017818"
    },
    "status": "ok",
    "message": "Rayleigh angular resolution",
    "success": true
}
```

#### `GET /v1/distance` — Resolvable separation at a distance

**Parameters:**
- `wavelength_nm` (query, optional, string) — Wavelength (nm, default 550) Example: `550`
- `aperture_diameter` (query, required, string) — Aperture diameter D (m) Example: `0.1`
- `distance` (query, required, string) — Distance L (m) Example: `1000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/resolution-api/v1/distance?wavelength_nm=550&aperture_diameter=0.1&distance=1000"
```

**Response:**
```json
{
    "data": {
        "formula": "s = θ·L = 1.22·λ·L/D (small-angle resolvable separation).",
        "distance_m": 1000,
        "wavelength_nm": 550,
        "aperture_diameter_m": 0.1,
        "angular_resolution_rad": 6.71e-6,
        "resolvable_separation_m": 0.00671,
        "resolvable_separation_mm": 6.71
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:43.294Z",
        "request_id": "dae56398-d692-4f2b-b766-6f5497fc3e3a"
    },
    "status": "ok",
    "message": "Resolvable separation at a distance",
    "success": true
}
```

#### `GET /v1/microscope` — Resolving power via NA

**Parameters:**
- `wavelength_nm` (query, optional, string) — Wavelength (nm, default 550) Example: `550`
- `numerical_aperture` (query, optional, string) — Numerical aperture NA Example: `1.4`
- `refractive_index` (query, optional, string) — Or refractive index n
- `half_angle` (query, optional, string) — And half-angle (deg)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/resolution-api/v1/microscope?wavelength_nm=550&numerical_aperture=1.4"
```

**Response:**
```json
{
    "data": {
        "formula": "Rayleigh d = 0.61·λ/NA; Abbe d = λ/(2·NA); NA = n·sin(θ).",
        "wavelength_nm": 550,
        "abbe_resolution_nm": 196.4286,
        "numerical_aperture": 1.4,
        "rayleigh_resolution_m": 2.39643e-7,
        "rayleigh_resolution_nm": 239.6429,
        "useful_magnification_max": 1400
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:43.374Z",
        "request_id": "006ef7d0-de07-43f5-b320-17c565121ba1"
    },
    "status": "ok",
    "message": "Resolving power via NA",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "resolution",
        "note": "Optical resolution (Rayleigh criterion) — computed locally and deterministically, no key, no third-party service.",
        "defaults": {
            "wavelength_nm": 550
        },
        "endpoints": [
            "/v1/angular",
            "/v1/distance",
            "/v1/microscope",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:43.450Z",
        "request_id": "51d2f452-6923-47a7-a67e-f1b3f66a5932"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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