# PERC Rule Calculator (Pulmonary Embolism Rule-Out Criteria)

> PERC Rule Calculator (Pulmonary Embolism Rule-Out Criteria) is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-10).

Evaluates all eight Kline 2004 PERC criteria to determine whether pulmonary embolism can be ruled out in a low-pretest-probability patient without further workup.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/perc?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/perc-rule-calculator-pulmonary-embolism-rule-out-criteria-d7aa603d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1e1ainYhn7WfgceHAR-Vu

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 perc-rule-calculator-pulmonary-embolism-rule-out-criteria-d7aa603d
```

Example prompt: Check the PERC rule for a 42-year-old patient with a heart rate of 88 bpm, SpO2 of 97%, no unilateral leg swelling, no hemoptysis, no recent surgery or trauma, no prior PE or DVT, and no estrogen use — are all eight criteria met to rule out PE?

## When to prefer this

Use this endpoint when you need a deterministic, published PERC rule-out calculation for a patient already assessed as low pretest probability for PE. Prefer this over custom logic or LLM reasoning for clinical decision support where reproducibility and fidelity to the Kline 2004 criteria are required. Not appropriate as a D-dimer substitute protocol, for high-pretest patients, or in altitude-adjusted contexts.

## Known failure modes

- Missing required query parameters (age, heart_rate_bpm, spo2_percent, boolean flags) returns a 400-level error
- Age outside valid range 18-120 or SpO2 outside 50-100 rejected as invalid input
- Heart rate outside 30-220 bpm range rejected
- Boolean fields passed as strings instead of true/false may cause parsing errors
- Caller applying PERC without established low pretest probability yields clinically invalid results (not enforced by API)

## How this service works

Deterministic published-formula arithmetic plus ICD-10-CM, RxNorm, and LOINC. Pay in USDC on Base via x402.

## Output

Returns a structured result indicating whether the patient is PERC-negative (all eight criteria satisfied, PE rule-out supported in low-pretest-probability context) or PERC-positive (one or more criteria failed, further workup indicated), along with the pass/fail status of each individual criterion.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "age",
      "heart_rate_bpm",
      "spo2_percent",
      "unilateral_leg_swelling",
      "hemoptysis",
      "recent_surgery_or_trauma",
      "prior_vte",
      "estrogen_use"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). Criterion met when age < 50; 50 does not meet."
      },
      "prior_vte": {
       "type": "boolean",
       "description": "Prior PE or DVT. true or false as assigned by the caller. Criterion met when false."
      },
      "hemoptysis": {
       "type": "boolean",
       "description": "Hemoptysis. true or false as assigned by the caller. Criterion met when false."
      },
      "estrogen_use": {
       "type": "boolean",
       "description": "Hormone or exogenous estrogen use. true or false as assigned by the caller. Criterion met when false."
      },
      "spo2_percent": {
       "type": "number",
       "description": "Oxygen saturation percent (50-100). Criterion met when SaO2 > 94; 94 does not meet."
      },
      "heart_rate_bpm": {
       "type": "integer",
       "description": "Pulse in beats per minute (integer 30-220). Criterion met when pulse < 100; 100 does not meet."
      },
      "unilateral_leg_swelling": {
       "type": "boolean",
       "description": "Unilateral leg swelling. true or false as assigned by the caller. Criterion met when false."
      },
      "recent_surgery_or_trauma": {
       "type": "boolean",
       "description": "Recent trauma or surgery. true or false as assigned by the caller. Criterion met when false."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/perc",
  "count": 2,
  "items": [
   {
    "formula": "perc",
    "citation": {
     "id": "kline-2004",
     "doi": "10.1111/j.1538-7836.2004.00790.x",
     "title": "Clinical criteria to prevent unnecessary diagnostic testing in emergency department patients with suspected pulmonary embolism",
     "source": "J Thromb Haemost. 2004;2(8):1247-1255",
     "authors": "Kline JA, Mitchell AM, Kabrhel C, Richman PB, Courtney DM"
    },
    "criteria": [
     {
      "met": true,
      "value": 40,
      "factor": "age_lt_50"
     },
     {
      "met": true,
      "value": 80,
      "factor": "pulse_lt_100"
     },
     {
      "met": true,
      "value": 98,
      "factor": "sao2_gt_94"
     },
     {
      "met": true,
      "factor": "no_unilateral_leg_swelling"
     },
     {
      "met": true,
      "factor": "no_hemoptysis"
     },
     {
      "met": true,
      "factor": "no_recent_surgery_or_trauma"
     },
     {
      "met": true,
      "factor": "no_prior_vte"
     },
     {
      "met": true,
      "factor": "no_estrogen_use"
     }
    ],
    "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
    "perc_negative": true,
    "formula_expression": "PERC-negative iff age < 50 and pulse < 100 bpm and SaO2 > 94% and no unilateral leg swelling and no hemoptysis and no recent trauma or surgery and no prior PE or DVT and no hormone use"
   },
   {
    "formula": "perc",
    "citation": {
     "id": "kline-2004",
     "doi": "10.1111/j.1538-7836.2004.00790.x",
     "title": "Clinical criteria to prevent unnecessary diagnostic testing in emergency department patients with suspected pulmonary embolism",
     "source": "J Thromb Haemost. 2004;2(8):1247-1255",
     "authors": "Kline JA, Mitchell AM, Kabrhel C, Richman PB, Courtney DM"
    },
    "criteria": [
     {
      "met": true,
      "value": 40,
      "factor": "age_lt_50"
     },
     {
      "met": true,
      "value": 80,
      "factor": "pulse_lt_100"
     },
     {
      "met": true,
      "value": 98,
      "factor": "sao2_gt_94"
     },
     {
      "met": true,
      "factor": "no_unilateral_leg_swelling"
     },
     {
      "met": true,
      "factor": "no_hemoptysis"
     },
     {
      "met": true,
      "factor": "no_recent_surgery_or_trauma"
     },
     {
      "met": true,
      "fact
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/perc-rule-calculator-pulmonary-embolism-rule-out-criteria-d7aa603d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
