API Documentation

The Medical Costs API provides free, open access to medical procedure costs, drug prices, hospital data, and more.

Base URL: https://medical-costs-api.david-568.workers.dev  •  Download OpenAPI Spec (YAML)

Response Format

All endpoints return JSON:

{ "success": true, "data": { ... } }

Procedures

GET /api/procedures

List medical procedures with optional search, category, and body system filters.

Parameters: search, category, bodySystem, limit, offset
GET /api/procedures/{code}

Get full procedure details including RVUs, rates, and geographic data.

Parameters: code (path)
GET /api/procedures/by-slug/{slug}
GET /api/procedures/{code}/consumer

Get consumer-friendly procedure description.

Parameters: code (path)
GET /api/related/{code}

Get related procedures in the same category.

Parameters: code (path)
GET /api/alternatives/{code}

Get alternative treatment options with cost comparison.

Parameters: code (path)
GET /api/categories

List all procedure categories with counts.

GET /api/body-systems

List body systems with procedure counts.

GET /api/body-systems/{slug}

Get body system detail with its procedures.

Parameters: slug (path), limit, offset

Injuries

GET /api/injuries

List injury categories. Filter by crash relevance or body region.

Parameters: relevance, bodyRegion
GET /api/injuries/{slug}

Get injury category detail with mapped procedures.

Parameters: slug (path)
GET /api/injuries/{slug}/estimate

Get cost estimate for an injury by severity and state.

Parameters: slug (path), severity, state
GET /api/crash-estimate

Get crash severity cost estimate (NHTSA-based).

Parameters: severity, state
GET /api/settlement-estimate

Estimate personal injury settlement range.

Parameters: injury (required), severity, state

Hospital

GET /api/drg

List DRG (hospital stay) codes with average costs.

Parameters: search, type (SURG/MED), limit, offset
GET /api/drg/{code}

Get DRG detail with hospital-level cost breakdown.

Parameters: code (path)
GET /api/hospitals

Search hospitals with cost and payment data.

Parameters: state, drg, provider, search, sort, limit, offset
GET /api/hospitals/rankings

Get hospital cost rankings nationally.

Parameters: metric, direction, limit
GET /api/hospitals/states

List states with hospital data counts.

GET /api/hospitals/{state}/drgs

Get top DRGs for a state.

Parameters: state (path), limit

Drugs

GET /api/drugs/compare

Compare brand vs generic drug prices.

Parameters: brand (required)
GET /api/drugs/categories

List drug therapeutic categories.

GET /api/drugs/glp1

Get GLP-1 drug prices (Ozempic, Wegovy, etc.).

GET /api/medications/{conditionSlug}

Get medications commonly used for a condition.

Parameters: conditionSlug (path)

Insurance

GET /api/insurers

List insurance companies with payment data.

Parameters: limit
GET /api/insurance-plans

Search ACA marketplace insurance plans.

Parameters: state, metal, search, limit, offset
GET /api/oop-calculator

Calculate out-of-pocket costs based on insurance parameters.

Parameters: codes (required), deductible, deductible_met, coinsurance, oop_max, copay, setting, state, plan_id
GET /api/auto-insurance/{state}

Get auto insurance requirements by state.

Parameters: state (path)

Geographic

GET /api/compare

Compare procedure costs across states.

Parameters: code (required), states

Transparency

GET /api/negotiated-rates

Get negotiated rates from payers.

Parameters: code (required), state, payer, setting, limit
GET /api/bill-check

Check if a medical bill is reasonable.

Parameters: code (required), amount (required), state

Meta

GET /api/statistics

Get database statistics and counts.

GET /api/metrics

Get key platform metrics.

GET /api/metrics/facts

Get interesting medical cost facts.

GET /api/trends

Get medical cost trends over time.

GET /api/og

Generate dynamic OG image (SVG, 1200x630).

Parameters: title, price, type
GET /api/embed/{code}

Get embeddable HTML widget for a procedure.

Parameters: code (path)

Usage Notes

  • All data is based on publicly available CMS Medicare fee schedules (CY 2026, CF $33.40)
  • Commercial rates are estimated at 150-250% of Medicare rates
  • No API key required — free and open access
  • CORS is enabled for allowed origins
  • Rate limiting may apply; please be respectful with request volumes
  • Data is for informational purposes only and is not medical or financial advice

My Cost List

0 procedures

No procedures added yet

Click "Add to My List" on any procedure to start building your estimate.