# Photography Depth of Field Calculator

> Photography Depth of Field Calculator is a paid API for AI agents from photo-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Calculates near/far focus limits, total depth of field, and hyperfocal distance from focal length, aperture, focus distance, and sensor type.

## Facts

- Endpoint: GET https://photo-calc.x402tookit.com/depth-of-field?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/photography-depth-of-field-calculator-eb36334b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MJLSU-4DX6etWPtedCSdA

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability photography-depth-of-field-calculator-eb36334b
```

Example prompt: Calculate the depth of field for a 85mm lens at f/2.0, focused at 1.5 metres, on a full-frame sensor — give me the near and far focus limits and the hyperfocal distance.

## When to prefer this

Use this endpoint when you need precise optical depth-of-field calculations including hyperfocal distance, near/far limits, and sensor-aware circle-of-confusion — especially when supporting photographers planning shots, building camera tools, or automating focus decisions. Prefer this over generic optics formulas when you need ready-made sensor presets (full-frame, APS-C, micro four thirds, etc.) and structured JSON output without coding the optics math yourself.

## Known failure modes

- Missing required parameter (focalMm, aperture, or distanceM) returns an error
- Invalid sensor name returns an error or uses default
- Zero or negative focal length / aperture / distance produces invalid results
- Very large focus distances cause far limit to be infinity — flagged via farLimitIsInfinity
- Unsupported sensor string falls back to full-frame default

## How this service works

Depth of field from focal length, aperture, distance and sensor: near and far limits, total depth and hyperfocal distance.

## Output

Returns near focus limit (m), far focus limit (m), total depth of field (m), hyperfocal distance (m), depth in front of subject (m), depth behind subject (m), near limit at hyperfocal distance (m), a boolean for whether the far limit reaches infinity, plus the input parameters echoed back (focal length, aperture, focus distance, sensor, circle of confusion) and a summary string.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "focalMm",
      "aperture",
      "distanceM"
     ],
     "properties": {
      "cocMm": {
       "type": "number",
       "description": "Circle of confusion in mm (default sensor diagonal / 1500)"
      },
      "sensor": {
       "type": "string",
       "description": "full-frame (default), aps-c, aps-c-canon, aps-h, micro-four-thirds, 1-inch or medium-format-44x33"
      },
      "focalMm": {
       "type": "number",
       "description": "Actual focal length in mm"
      },
      "aperture": {
       "type": "number",
       "description": "f-number"
      },
      "distanceM": {
       "type": "number",
       "description": "Focus distance in metres"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "cocMm": {
       "type": [
        "null",
        "number"
       ]
      },
      "sensor": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "focalMm": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "aperture": {
       "type": [
        "null",
        "number"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "farLimitM": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "nearLimitM": {
       "type"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/photography-depth-of-field-calculator-eb36334b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from photo-calc.x402tookit.com](https://www.zero.xyz/host/photo-calc.x402tookit.com/llms.txt)
