← Back to the calculator Request an API key →

Developer API

Everything the calculator does is a REST API underneath — group ICD-10 codes to an MS-DRG (any manual version back to FY2022), price the claim with real FY2026 hospital-specific factors, verify the result against the official Medicare pricer, and export the worksheet as PDF or Excel. JSON in, JSON out.

Base URLhttps://drg-calculator-backend.onrender.com/api/v1

Authentication & rate limits

Every endpoint works without a key at the public rates. An issued key, sent as an X-API-Key header, upgrades you to the developer tier and meters usage per key instead of per IP — so your whole team or server fleet shares one predictable quota.

TierLimitMetered
Public60/min · 500/hour (20/min · 150/hour on search & verify)per client IP
API key240/min · 10,000/hourper key

Keys are issued per organization — request one here with a line about what you're building. Exceeding a limit returns 429 with a Retry-After header. Invalid keys aren't rejected — they simply get the public tier.

Server-side use. Browser CORS is restricted to our own origins, so call the API from your backend. Please keep /drg/verify traffic modest — each call prices the claim through the official Medicare pricer live.
POST/drg/group

Group a claim to an MS-DRG from ICD-10-CM diagnoses (with POA flags) and ICD-10-PCS procedures. Optional age, sex, and dischargeStatus (UB-04 code) drive the disposition-split DRG families — AMI discharged-alive vs. expired, left-AMA, the newborn MDC, and the discharged-alive-only MCC rule. Add ccn + coveredCharges + los to price the resulting DRG in the same call.

curl -X POST "$BASE/drg/group" -H "Content-Type: application/json" \
  -H "X-API-Key: $KEY" -d '{
  "diagnoses": [
    {"code": "I213",  "poa": "Y"},   // principal first (STEMI)
    {"code": "J9601", "poa": "Y"},   // acute resp failure — MCC
    {"code": "I5021", "poa": "Y"}
  ],
  "procedures": [{"code": "0271356"}, {"code": "02C03Z6"}],
  "age": 68, "sex": "M", "dischargeStatus": "01",
  "grouperVersion": "v43.1"          // all 10 manuals v39–v43.1 (FY2022–FY2026, both halves)
}'
// response (trimmed)
{
  "grouper": {
    "drg": "359", "mdc": "05", "path": "surgical",
    "severity": "MCC", "severityDriver": "J9601",
    "grouperVersion": "v43.1", "grouperFiscalYear": "FY2026",
    "secondaryDetail": [{"dx": "J9601", "level": "MCC", "poa": "Y"}, ],
    "caveats": []
  },
  "drgTitle": "Percutaneous Coronary Atherectomy w/ Intraluminal Device w/ MCC"
}

Also accepts FHIR R4, vendor, and Epic Tapestry claim shapes — send the payload as-is and the API detects the format. Ungroupable claims return 422 with the reason. GET /drg/grouper-versions lists the loaded manual versions.

GET/drg/calculate

Price a DRG the way Medicare does — operating + capital + IME/DSH + uncompensated care + outlier, with the hospital's real factors.

curl "$BASE/drg/calculate?drgCode=871&ccn=330101&coveredCharges=120000&los=5" \
  -H "X-API-Key: $KEY"
ParamMeaning
drgCodeMS-DRG, e.g. 871 (required)
ccn · wageIndexa hospital CCN or a manual wage index (one required)
coveredCharges · losdrive outlier and transfer math
transferStatusnone · transfer · postacute
hmoPaidClaimMedicare Advantage claim toggle
includeIme · includeDsh · includeUcpstrip components for contract modeling (default true)

The response is the full dollar build the UI renders — component subtotals, outlier decision, grand total. Formula coefficients stay server-side.

GET/drg/verify

Price the same claim through our engine and the official Medicare pricer, live, side by side — the same check we publish on the site (typically matching to the cent).

curl "$BASE/drg/verify?drgCode=208&ccn=450358&coveredCharges=95000&los=4&dischargeDate=2026-03-15" \
  -H "X-API-Key: $KEY"

All five params above are required; add hmoPaidClaim=true for MA claims. Returns both totals and the delta.

GET/drg/worksheet

The same inputs as /drg/calculate, returned as a client-ready pricing worksheet with the full line-by-line formula detail. Add fmt=pdf (default) or fmt=xlsx.

curl -o worksheet.pdf "$BASE/drg/worksheet?drgCode=871&ccn=330101&coveredCharges=120000&los=5&fmt=pdf"

Lookups

EndpointWhat it returns
GET /drg/search?q=sepsisMS-DRGs by code or title (code, title, MDC, type, weight)
GET /drg/codes?q=J96&kind=dxICD-10-CM / PCS codes with descriptions and CC/MCC severity (kind=dx|proc)
GET /drg/hospitals/search?q=houstonIPPS hospitals by name, or filter by state/city/zip
GET /drg/hospitals/{ccn}one hospital's profile (name, location, wage index, CMI, teaching)
GET /drg/grouper-versionsloaded MS-DRG manual versions and the default

Search endpoints require ≥2 characters and cap at 25 rows per response.

Errors

StatusMeaning
400 / 404bad filter, or unknown DRG / CCN — {"detail": "…"} says which
422claim couldn't be grouped, or invalid body — the detail carries the grouper's reason
429rate limit hit; retry after the Retry-After seconds
502 / 503an upstream dependency (official pricer, registry) is unavailable — retry later
Estimates, not adjudication. Results are payment estimates from published factors — final payment is determined by the payer at claim adjudication. Grouping notes its approximations in the caveats field of every response.
© 2026 PayerParity · [email protected] · Request an API key