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.
https://drg-calculator-backend.onrender.com/api/v1Authentication & 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.
| Tier | Limit | Metered |
|---|---|---|
| Public | 60/min · 500/hour (20/min · 150/hour on search & verify) | per client IP |
| API key | 240/min · 10,000/hour | per 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.
/drg/groupGroup 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.
/drg/calculatePrice 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"
| Param | Meaning |
|---|---|
| drgCode | MS-DRG, e.g. 871 (required) |
| ccn · wageIndex | a hospital CCN or a manual wage index (one required) |
| coveredCharges · los | drive outlier and transfer math |
| transferStatus | none · transfer · postacute |
| hmoPaidClaim | Medicare Advantage claim toggle |
| includeIme · includeDsh · includeUcp | strip 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.
/drg/verifyPrice 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.
/drg/worksheetThe 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
| Endpoint | What it returns |
|---|---|
| GET /drg/search?q=sepsis | MS-DRGs by code or title (code, title, MDC, type, weight) |
| GET /drg/codes?q=J96&kind=dx | ICD-10-CM / PCS codes with descriptions and CC/MCC severity (kind=dx|proc) |
| GET /drg/hospitals/search?q=houston | IPPS 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-versions | loaded MS-DRG manual versions and the default |
Search endpoints require ≥2 characters and cap at 25 rows per response.
Errors
| Status | Meaning |
|---|---|
| 400 / 404 | bad filter, or unknown DRG / CCN — {"detail": "…"} says which |
| 422 | claim couldn't be grouped, or invalid body — the detail carries the grouper's reason |
| 429 | rate limit hit; retry after the Retry-After seconds |
| 502 / 503 | an upstream dependency (official pricer, registry) is unavailable — retry later |