# Hospital Standard-Charges Price Benchmark (`kevinserver24/hospital-mrf-price-benchmark`) Actor

Cross-hospital percentile benchmark for a procedure code, computed live from each hospital's own CMS standard-charges file (tall or wide). Charged only per hospital-per-code benchmark backed by at least 2 hospitals -- never a raw row, never a single-hospital price billed as a comparison.

- **URL**: https://apify.com/kevinserver24/hospital-mrf-price-benchmark.md
- **Developed by:** [Kevin](https://apify.com/kevinserver24) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 hospital\_price\_benchmarks

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Hospital Standard-Charges Price Benchmark

*An independent tool. It is not affiliated with, endorsed by, or operated by
any hospital, health system or payer whose files it reads. All data is read
live from each hospital's own federally mandated standard-charges
machine-readable file, never scraped from any patient-facing site.*

Give it a batch of hospitals (each a name you choose and the direct link to
that hospital's own published CMS standard-charges file) and a list of
procedure codes; get back, for each hospital and code, where that
hospital's own negotiated rate sits against every other hospital in your
batch -- a percentile, the batch median/min/max, and the underlying raw
payer-specific charges the comparison was built from.

### Why this is hard, and why that is the point

There is no central directory of the roughly 6,000 US hospitals' file
locations -- CMS does not host one, so you supply the direct link per
hospital. The file itself comes in at least two column shapes hospitals
actually use (verified against CMS's own published reference examples):
TALL, one row per code/payer/plan, and WIDE, one row per code with the
payer and plan baked directly into the column name, repeated once per
contracted plan a hospital has forty or more of. This Actor reads either
shape automatically, streams a file that can run past a gigabyte within a
disclosed byte budget (`max_scan_mb`), and tolerates the malformed rows a
known minority of hospitals ship without losing the rest of the file.

### What it returns

For each hospital and procedure code, one row per underlying payer/plan
charge: `hospital_label`/`hospital_ccn`/`hospital_city`/`hospital_state`,
`procedure_code`/`code_type`, `payer_label`/`plan_label`, the raw
`standard_charge_negotiated_dollar`/`standard_charge_gross`/
`standard_charge_cash`/`standard_charge_min`/`standard_charge_max`, and the
shared benchmark figures for that hospital+code:
`batch_percentile_rank` (0 = cheapest in your batch, 100 = most expensive),
`batch_median`, `batch_min`, `batch_max`, and `batch_sample_size` (how many
hospitals in your batch actually had data for that code).

### What it does not do, on purpose

It never charges for a single hospital's price as if it were a comparison.
A procedure code with data from only one hospital in your batch is
delivered free, with the reason -- add more hospitals to that code's
comparison to turn it into a real benchmark. It also never guesses at a
hospital's file location: you supply `mrf_url` directly, because 45 CFR
180.50 requires the hospital -- not a search engine -- to publish that
link, and a wrong guess would silently compare the wrong file.

### Finding a hospital's standard-charges file

Every hospital is required to post one on its own public website, usually
linked from a page titled "Price Transparency" or "Standard Charges"
(search "`<hospital name>` standard charges" or "`<hospital name>` price
transparency"). File names commonly follow the pattern
`<EIN>_<hospital-name>_standardcharges.[csv|json]`.

# Actor input Schema

## `hospitals` (type: `array`):

Each entry needs hospital\_label (a name you choose) and mrf\_url: the DIRECT link to that hospital's own published CMS standard-charges file (the link every hospital is required to post on its own website under 45 CFR 180.50). This Actor does not search a hospital's site for that link -- the file location is not centrally indexed anywhere, so you must supply it. A benchmark needs at least 2 hospitals with data for the same procedure\_code; fewer than that is delivered free, with the reason, never billed. Up to 20 hospitals per run.

## `procedure_codes` (type: `array`):

Each entry is either a bare code string (defaults to code\_type CPT) or an object {code, code\_type}. code\_type is matched against the hospital file's own code|1|type / code|2|type columns (CPT, HCPCS, MS-DRG, RC, NDC...). Up to 10 codes per run.

## `max_scan_mb` (type: `integer`):

How many megabytes of a single hospital's (decompressed) file this run will read before giving up on that hospital honestly, rather than risk the platform's run timeout on a very large or very slow file. 10-1500, default 300.

## Actor input object example

```json
{
  "hospitals": [
    {
      "hospital_label": "Example Hospital A",
      "mrf_url": "https://example-a.org/standardcharges.csv"
    },
    {
      "hospital_label": "Example Hospital B",
      "mrf_url": "https://example-b.org/standardcharges.csv"
    }
  ],
  "procedure_codes": [
    "70551"
  ],
  "max_scan_mb": 300
}
```

# Actor output Schema

## `results` (type: `string`):

Hospital, procedure code, payer/plan, the raw standard charges, and the batch percentile/median/min/max/sample size.

## `resultsCsv` (type: `string`):

The same rows as a spreadsheet.

## `summary` (type: `string`):

How many hospitals were fetched/failed, how many benchmarks were charged, free, or left untouched by the spending limit.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "hospitals": [
        {
            "hospital_label": "Example Hospital A",
            "mrf_url": "https://example-a.org/standardcharges.csv"
        },
        {
            "hospital_label": "Example Hospital B",
            "mrf_url": "https://example-b.org/standardcharges.csv"
        }
    ],
    "procedure_codes": [
        "70551"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kevinserver24/hospital-mrf-price-benchmark").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "hospitals": [
        {
            "hospital_label": "Example Hospital A",
            "mrf_url": "https://example-a.org/standardcharges.csv",
        },
        {
            "hospital_label": "Example Hospital B",
            "mrf_url": "https://example-b.org/standardcharges.csv",
        },
    ],
    "procedure_codes": ["70551"],
}

# Run the Actor and wait for it to finish
run = client.actor("kevinserver24/hospital-mrf-price-benchmark").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "hospitals": [
    {
      "hospital_label": "Example Hospital A",
      "mrf_url": "https://example-a.org/standardcharges.csv"
    },
    {
      "hospital_label": "Example Hospital B",
      "mrf_url": "https://example-b.org/standardcharges.csv"
    }
  ],
  "procedure_codes": [
    "70551"
  ]
}' |
apify call kevinserver24/hospital-mrf-price-benchmark --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kevinserver24/hospital-mrf-price-benchmark"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rNBNvtweZB605QOlC/builds/Z93D00Dclf1C1p1U5/openapi.json
