POST /v1/interactions/graph-eval

Coming Soon

Evaluate drug interactions for a set of RxCUI identifiers using the RxLabelGuard knowledge graph. Applies five evaluation layers in sequence: direct pairwise rules, class-based interaction rules, multi-drug combination rules, duplicate therapy detection, and pathway amplification from shared risk domains.

This endpoint is not yet available for public use.

Graph-based evaluation is currently in private beta. Register your interest to be notified when early access opens.

Request

POST /v1/interactions/graph-eval
Content-Type: application/json
x-api-key: rxlg_your_api_key

Parameters

NameTypeRequiredDescription
rxcuisstring[]requiredArray of RxCUI identifiers (2–10). All RxCUIs must exist in the drug graph. Use POST /v1/interactions/graph-search to resolve drug names to RxCUIs first.

Evaluation Layers

The evaluation engine applies five ordered layers. Each layer may produce firing rules. Rules from higher-specificity layers suppress redundant lower-specificity results for the same drug pair.

LayerRule TypeDescription
1PAIRWISEDirect drug-to-drug rules sourced from FDA SPL labeling. Highest specificity.
2CLASS_INTERACTIONClass-to-class rules applied when two drugs belong to interacting pharmacological classes. Skipped for pairs already covered by Layer 1.
3COMBINATIONMulti-drug combination rules that fire when a minimum number of required drugs or classes are present simultaneously.
4DUPLICATE_THERAPYDetects two or more drugs from the same pharmacological class in the input set. Produces a moderate-severity warning.
5PATHWAY_AMPLIFICATIONInfers additive risk when multiple drugs share a risk domain and no explicit rule covers them. Severity escalates with drug count.

Examples

cURL

curl -X POST "https://api.rxlabelguard.com/v1/interactions/graph-eval" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"rxcuis": ["11289", "1191", "36567"]}'

JavaScript

const response = await fetch("https://api.rxlabelguard.com/v1/interactions/graph-eval", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "YOUR_API_KEY",
  },
  body: JSON.stringify({
    rxcuis: ["11289", "1191", "36567"], // warfarin, aspirin, clopidogrel
  }),
});

const data = await response.json();
console.log(data.maxSeverity);    // "CONTRAINDICATED" | "HIGH_RISK" | "CAUTION" | "MONITOR" | "NONE"
console.log(data.firingRules);    // ordered array of detected interactions
console.log(data.riskSummary);    // per-domain risk aggregation

Python

import requests

response = requests.post(
    "https://api.rxlabelguard.com/v1/interactions/graph-eval",
    headers={"x-api-key": "YOUR_API_KEY"},
    json={"rxcuis": ["11289", "1191"]},
)

data = response.json()
for rule in data["firingRules"]:
    print(f"{rule['ruleType']} [{rule['severity']}]: {rule['mechanism']}")

Response Schema

{
  "inputRxcuis": ["11289", "1191"],
  "drugs": [
    {
      "rxcui": "11289",
      "genericName": "warfarin",
      "brandNames": ["COUMADIN"],
      "splSetId": "abc-123",
      "classIds": ["ANTICOAGULANT"],
      "mechanismIds": ["CYP2C9_INHIBITION"],
      "pathwayIds": ["CYP2C9"],
      "riskDomainIds": ["BLEEDING_RISK"]
    }
  ],
  "firingRules": [
    {
      "ruleType": "PAIRWISE",
      "severity": "major",
      "involvedDrugRxcuis": ["11289", "1191"],
      "involvedDrugNames": ["warfarin", "aspirin"],
      "mechanism": "Aspirin inhibits platelet aggregation and may displace warfarin from plasma proteins.",
      "recommendation": "Monitor INR closely if coadministered. Consider alternative analgesic.",
      "evidenceSnippet": "Aspirin increases anticoagulant effect and bleeding risk.",
      "riskDomainIds": ["BLEEDING_RISK"],
      "metadata": {
        "evidenceLevel": "known-common",
        "sourceType": "pairwise",
        "confidenceLabel": "OBSERVED_PATTERN"
      },
      "isExplicit": true
    }
  ],
  "maxSeverity": "HIGH_RISK",
  "riskSummary": {
    "BLEEDING_RISK": "major"
  },
  "duplicateTherapyWarnings": [],
  "disclaimer": "This interaction analysis is derived from FDA Structured Product Labeling...",
  "queryStats": {
    "phase1Items": 2,
    "phase2Items": 1,
    "rulesEvaluated": 1,
    "rulesFired": 1,
    "evaluatedMs": 12
  }
}

Severity Values

maxSeverityMeaning
CONTRAINDICATEDAt least one pair must not be used together.
HIGH_RISKMajor interaction present. Potentially life-threatening.
CAUTIONModerate interaction. May require monitoring or dose adjustment.
MONITORMinor interaction. Minimal clinical significance.
NONENo interactions detected in the graph for this drug set.