# Photography Calculator API
> Camera and optics maths as an API. The depth-of-field endpoint computes the near and far limits of sharp focus, the total depth of field and the hyperfocal distance from a focal length, aperture and focus distance, using the circle of confusion for your sensor format — full-frame, APS-C, Micro Four Thirds, 1-inch, medium format, Super 35 and more, or your own value. The field-of-view endpoint gives the horizontal, vertical and diagonal angle of view for a focal length on a given sensor, plus the crop factor and the 35 mm-equivalent focal length. The exposure endpoint computes the exposure value (EV) from aperture, shutter speed and ISO, and can also solve for the shutter speed or aperture that hits a target EV. Everything is computed locally and deterministically, so it is instant and private. Ideal for photography and videography apps, camera and lens tools, focus-stacking and landscape planning, and teaching exposure and optics. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This computes camera optics; for reading EXIF metadata from photo files use an EXIF 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/photography-api/..."
```

## Pricing
- **Free** (Free) — 7,935 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 17,450 calls/Mo, 8 req/s
- **Pro** ($29/Mo) — 225,500 calls/Mo, 20 req/s
- **Mega** ($67/Mo) — 1,170,000 calls/Mo, 50 req/s

## Endpoints

### Photography

#### `GET /v1/depth-of-field` — Depth of field + hyperfocal

**Parameters:**
- `focal_length` (query, required, string) — mm Example: `50`
- `aperture` (query, required, string) — f-number Example: `8`
- `distance` (query, required, string) — Focus distance (m) Example: `5`
- `sensor` (query, optional, string) — Sensor format Example: `full-frame`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/photography-api/v1/depth-of-field?focal_length=50&aperture=8&distance=5&sensor=full-frame"
```

**Response:**
```json
{
    "data": {
        "sensor": "full-frame",
        "aperture": 8,
        "distance_m": 5,
        "far_limit_m": 9.2121,
        "hyperfocal_m": 10.826,
        "near_limit_m": 3.4311,
        "focal_length_mm": 50,
        "depth_of_field_m": 5.781,
        "in_focus_to_infinity": false,
        "circle_of_confusion_mm": 0.029
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:06.329Z",
        "request_id": "92b43336-73bd-4c2a-b50d-e8cd873a929d"
    },
    "status": "ok",
    "message": "Depth of field",
    "success": true
}
```

#### `GET /v1/exposure` — Exposure value (EV)

**Parameters:**
- `aperture` (query, optional, string) — f-number Example: `8`
- `shutter` (query, optional, string) — Seconds Example: `0.004`
- `iso` (query, optional, string) — ISO (default 100) Example: `100`
- `ev` (query, optional, string) — Or a target EV

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/photography-api/v1/exposure?aperture=8&shutter=0.004&iso=100"
```

**Response:**
```json
{
    "data": {
        "iso": 100,
        "note": "EV100 = log2(N²/t); the EV at your ISO accounts for sensitivity",
        "ev100": 13.966,
        "aperture": 8,
        "ev_at_iso": 13.966,
        "shutter_s": 0.004
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:06.441Z",
        "request_id": "23bc4f71-f9c2-4842-9d08-40a692c35667"
    },
    "status": "ok",
    "message": "Exposure",
    "success": true
}
```

#### `GET /v1/field-of-view` — Angle of view + crop factor

**Parameters:**
- `focal_length` (query, required, string) — mm Example: `50`
- `sensor` (query, optional, string) — Sensor format Example: `full-frame`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/photography-api/v1/field-of-view?focal_length=50&sensor=full-frame"
```

**Response:**
```json
{
    "data": {
        "sensor": "full-frame",
        "crop_factor": 1,
        "diagonal_deg": 46.793,
        "vertical_deg": 26.991,
        "horizontal_deg": 39.598,
        "focal_length_mm": 50,
        "equivalent_focal_length_35mm_mm": 50
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:06.583Z",
        "request_id": "7aa0df48-b349-486d-a399-5352ff7152a7"
    },
    "status": "ok",
    "message": "Field of view",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "Photography Calculator API",
        "notes": "Hyperfocal H = f²/(N·c) + f. EV100 = log2(N²/t). Distances in metres, focal length in mm, shutter in seconds. Nothing is stored.",
        "sensors": [
            "full-frame",
            "aps-c",
            "aps-c-canon",
            "micro-four-thirds",
            "1-inch",
            "medium-format",
            "super-35"
        ],
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/depth-of-field",
                "params": {
                    "coc": "circle of confusion mm (optional)",
                    "sensor": "sensor format (default full-frame)",
                    "aperture": "f-number",
                    "distance": "focus distance in metres",
                    "focal_length": "mm"
                },
                "returns": "near/far limits, DoF and hyperfocal distance"
            },
            {
                "path": "/v1/field-of-view",
                "params": {
                    "sensor": "sensor format",
                    "focal_length": "mm"
                },
                "returns": "angle of view, crop factor and 35mm-equivalent focal length"
            },
            {
                "path": "/v1/exposure",
                "params": {
                    "ev": "or a target EV with one of aperture/shutter",
                    "iso": "ISO (default 100)",
                    "shutter": "seconds",
         
…(truncated, see openapi.json for full schema)
```


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