# US Hospital Price Transparency Scraper: Cash & Negotiated (`cozybit/hospital-price-transparency`) Actor

What do US hospitals charge for a procedure? Hospital standard charges from CMS price files: gross charge, cash price and payer-negotiated rates by CPT, HCPCS or DRG code, plus 2026 allowed-amount percentiles. By state, hospital name or website. Trial: 0.01 USD per 1,000 rows until 31 Dec 2026.

- **URL**: https://apify.com/cozybit/hospital-price-transparency.md
- **Developed by:** [Cozybit](https://apify.com/cozybit) (community)
- **Categories:** Business, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 hospital price file scanneds

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US Hospital Price Transparency Scraper: cash, gross and negotiated prices

Find out what US hospitals charge for a procedure. Give billing codes (CPT, HCPCS, MS-DRG, NDC) and a state, hospital names or hospital websites; get one clean row per hospital, procedure and insurance plan:

- **Gross charge and discounted cash price** for each matching procedure, drug or supply.
- **Payer-specific negotiated rates**: dollar amounts, percentages or formulas, per insurer and plan (Aetna, Anthem, Cigna, UnitedHealthcare, Medicaid plans and more).
- **2026 allowed-amount statistics** (median, 10th and 90th percentile, count) where the hospital already publishes them under the CMS 2026 rule.
- **Whole states at once**: a bundled directory of 2,442 hospital price files from 787 hospital websites in all 50 states, DC and Puerto Rico, searchable by state and hospital name.
- **Any hospital website**: paste a domain and the actor finds its price files through the `cms-hpt.txt` file every US hospital must publish.
- **One schema for every file**: CMS tall CSV, wide CSV and JSON files, plain, zipped or gzipped, all come out in the same columns.

Prices include all platform costs: you pay per hospital file and per price row, nothing for compute.

### Use cases

- **Employers and benefits brokers** compare what hospitals near their staff charge each insurer for common procedures.
- **Health-tech and price-comparison tools** feed normalised cash and negotiated prices into their products.
- **Patients and patient advocates** check cash prices before a planned procedure.
- **Journalists and researchers** compare prices across a state or a hospital system.
- **AI agents** answer "what does hospital X charge for Y" with the hospital's own published figures (see [AI agents](#use-with-ai-agents-and-automation)).

### Input

| Field | What it does | Default |
|---|---|---|
| Billing codes (`codes`) | Codes to look for, for example `27447` (CPT, total knee replacement) and `470` (MS-DRG, major joint replacement) | `27447`, `470` |
| Hospitals (`hospitals`) | Hospital websites or domains, `cms-hpt.txt` links, direct price-file links, or parts of hospital names from the directory | none |
| States (`states`) | Two-letter state codes; picks hospitals from the bundled directory | `OH` |
| Payers (`payers`) | Optional parts of insurer names, for example `Aetna` | all payers |
| Maximum price files (`maxFiles`) | Files to scan per run, 1 to 200 | 5 |
| Maximum price rows per file (`maxRowsPerFile`) | Rows to return from each file; scanning stops early when reached | 1,000 |

Give at least one hospital or state. With both, only those hospitals in those states are scanned.

Example: knee replacement prices at Ohio hospitals:

```json
{ "codes": ["27447", "470"], "states": ["OH"], "maxFiles": 10 }
```

Example: what one hospital charges Aetna and Cigna for an MRI of the brain and an office visit:

```json
{ "codes": ["70553", "99213"], "hospitals": ["www.childrensmercy.org"], "payers": ["Aetna", "Cigna"] }
```

### Output

One row per hospital, procedure and payer plan:

```json
{
  "status": "ok",
  "hospital_name": "AKRON GENERAL MEDICAL CENTER",
  "location_name": "Akron General",
  "hospital_address": "1 Akron General Avenue, Akron, OH 44307",
  "state": "OH",
  "last_updated_on": "2026-06-15",
  "cms_version": "3.0.0",
  "mrf_url": "https://clevelandclinic.pt.panaceainc.com/MRFDownload/clevelandclinic/akron-general",
  "description": "TOTAL KNEE ARTHROPLASTY",
  "code": "27447",
  "code_type": "HCPCS",
  "other_codes": [],
  "setting": "Outpatient",
  "billing_class": "Facility",
  "gross_charge": null,
  "discounted_cash": null,
  "deidentified_min": 6256.68,
  "deidentified_max": 35984.87,
  "payer_name": "AETNA",
  "plan_name": "MEDICARE ADVANTAGE",
  "negotiated_dollar": 12146.38,
  "negotiated_percentage": null,
  "negotiated_algorithm": null,
  "methodology": "Fee Schedule",
  "median_amount": null,
  "percentile_10th": null,
  "percentile_90th": null,
  "count": null,
  "additional_notes": null
}
```

This hospital publishes no gross or cash price for this item and no 2026 statistics yet, so those fields are `null`. `deidentified_min` and `deidentified_max` are the lowest and highest rate it negotiated with any payer.

- `negotiated_dollar`, `negotiated_percentage` and `negotiated_algorithm`: hospitals publish a negotiated rate as a dollar amount, a percentage of charges or a formula; the other two fields are then `null`.
- `median_amount`, `percentile_10th`, `percentile_90th`, `count`: the 2026 CMS allowed-amount statistics. `count` stays text because CMS allows the value `1 through 10`.
- A matched procedure without any payer rates gives one row with `payer_name: null`, carrying its gross and cash prices.
- Every value is copied from the hospital's own file; nothing is estimated. Also returned: `modifiers`, `drug_unit_of_measurement`, `drug_type_of_measurement`, and `estimated_amount` (older CMS files).

A price file that yields no prices gets one status row instead:

| status | Meaning | Charged |
|---|---|---|
| `no_match` | File scanned completely, none of your codes (or payers) found | yes, as a hospital file |
| `not_found` | No `cms-hpt.txt` or file at that address, or no directory hospital matches the name and state | no |
| `blocked` | The hospital's site refused automated access | no |
| `unsupported` | The file is not a CMS CSV or JSON file (for example a spreadsheet or web page) | no |
| `error` | The download or file broke off; rows delivered before the break are kept | no |

`RUN_SUMMARY` in the key-value store lists each file with its status, size, rows scanned, matches and seconds.

### Use it from code

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("cozybit/hospital-price-transparency").call(run_input={
    "codes": ["27447", "470"], "states": ["OH"], "maxFiles": 10,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["status"] == "ok":
        print(row["hospital_name"], row["code"], row["payer_name"], row["negotiated_dollar"], row["discounted_cash"])
```

HTTP API, results in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/cozybit~hospital-price-transparency/run-sync-get-dataset-items" \
  -H "Authorization: Bearer <YOUR_API_TOKEN>" -H "Content-Type: application/json" \
  -d '{"codes": ["70553"], "hospitals": ["James Cancer"]}'
```

### Use with AI agents and automation

**AI agents (MCP):** Claude, ChatGPT, Cursor and other MCP clients can run this actor through [Apify's MCP server](https://docs.apify.com/platform/integrations/mcp):

```json
{ "mcpServers": { "apify": { "url": "https://mcp.apify.com?tools=cozybit/hospital-price-transparency" } } }
```

Then ask, for example: *"What do hospitals in Ohio charge Aetna for a total knee replacement (CPT 27447)? Show the cash price too."* The agent fills in codes, state and payer from the field descriptions and reads the rows from the dataset.

**n8n and Make:** use Apify's [n8n node](https://docs.apify.com/platform/integrations/n8n) or [Make module](https://docs.apify.com/platform/integrations/make) to send prices to a sheet or database on a schedule.

### Pricing

**Trial price until 31 December 2026:** 0.00001 USD per hospital file and per price row (the lowest price Apify allows): 1,000 price rows cost 0.01 USD. From 1 January 2027:

| Event | Price |
|---|---|
| Hospital file scanned (prices found, or scanned without a match) | 0.02 USD |
| Price row delivered | 2.00 USD per 1,000 (0.002 USD each) |

Blocked, missing, unsupported and broken files are free. Apify notifies all users before a price change.

Worked examples (2027 prices):

- One hospital, one procedure, 25 payer plans: 0.02 + 25 x 0.002 = **0.07 USD**.
- 10 Ohio hospitals, knee replacement, 40 rows each: 10 x 0.02 + 400 x 0.002 = **1.00 USD**.
- Only Aetna rates for 3 codes at 50 hospitals, about 6 rows each: 50 x 0.02 + 300 x 0.002 = **1.60 USD**.

Use `payers` and `maxRowsPerFile` to keep row counts down, and set a maximum cost per run in the run options; the actor stops cleanly when it is reached.

### Free Apify plan

On the free Apify plan a run scans **1 price file** and returns at most **100 price rows**. The run then finishes successfully with the status message "Free Apify plan limit reached"; everything collected is in the dataset. Any paid Apify plan removes the limit.

### Reliability

In 29 test runs on the Apify platform, the actor scanned 56 price files picked at random from the directory: tall CSV, wide CSV and JSON files, plain and zipped, up to 1 GB. **54 of the 56 files (96%) were scanned successfully** and returned 6,204 price rows. In the other two, one hospital site refused access and one file server dropped the connection; neither was charged. The median file finished in about 20 seconds, and no run used more than 200 MB of memory.

Of the rows returned, 86% carry a gross charge, 77% a negotiated dollar rate and 74% a cash price, because hospitals fill in different fields.

How it stays fast and cheap: files are streamed, never stored, so memory stays low however large the file is. Only the lines that contain one of your codes are fully parsed, which makes a scan many times faster than reading every row. Prices are read live from each hospital's current file on every run.

### Limits

- Only what hospitals publish. Files differ in completeness; many do not fill in every field, and most did not yet publish the 2026 allowed-amount statistics when we tested.
- Some hospital sites block automated access or have moved; those files return `blocked` or `not_found` and are free.
- The bundled directory covers hospitals whose websites are listed on Wikidata, 787 sites today. For other hospitals, paste the website or price-file link.
- A hospital system often publishes one file per hospital on a shared website; a name search returns every file whose hospital name matches.
- Spreadsheet (XLSX) files are not supported. Single CSV records or JSON items over 32 MB are reported as `unsupported`.
- Very large files (several GB) take minutes to scan.
- Hospitals can change file addresses at any time; the directory is refreshed monthly.

### FAQ

**Which codes work?** Any code the hospital lists: CPT, HCPCS, MS-DRG, APR-DRG, NDC, revenue codes and others. CPT 27447 (knee replacement), 70553 (brain MRI), 45378 (colonoscopy), 59400 (vaginal delivery) and 99213 (office visit) are common examples.

**Why are the 2026 statistics empty?** The hospital has not published them in its file yet. The actor returns them as soon as the hospital does.

**Is this data allowed to be used?** Hospitals must publish these files for the public under the CMS Hospital Price Transparency rule (45 CFR 180). The actor reads only those public files.

**Can I get every price in a file?** Yes: list the codes you need and raise `maxRowsPerFile`. The actor is built for filtered lookups, not for copying whole files.

### Support

Report problems and feature requests on the actor's **Issues** tab, ideally with the run link.

# Actor input Schema

## `codes` (type: `array`):

Required array of billing-code strings, for example \['27447','470'] for a knee replacement CPT and MS-DRG. Supports CPT, HCPCS, DRG and NDC codes. Codes match exactly after trimming; leading zeros are ignored only when the file identifies the code type as DRG. Preserve NDC punctuation and leading zeros for other types.

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

Array of hospital website URLs or domains, cms-hpt.txt URLs, direct CSV/JSON/ZIP/gzip price-file URLs, or hospital-name fragments such as \['James Cancer']. Names match the bundled directory ignoring case. Website inputs discover published cms-hpt.txt locations. Entries are processed in input order; directory matches sort by state then name. Required when states is empty. With states, only hospitals in those states are selected.

## `states` (type: `array`):

Array of two-letter US state or territory codes, for example \['OH','PA']. Select hospitals from the bundled directory. Required when hospitals is empty. If hospitals is also given, intersect that hospital selection with these states; unknown-state files are not included in a state-filtered run.

## `payers` (type: `array`):

Optional array of payer-name fragments, for example \['Aetna','Blue Cross']. Match any fragment against payer_name ignoring case. Empty includes every payer, plus a payer-null row for matched items without payer rates. A non-empty payer filter excludes payer-null rows.

## `maxFiles` (type: `integer`):

Maximum number of distinct price-file URLs to scan per run, from 1 to 200. Default 5. Each successful or no-match scan triggers one hospital-file event; failed status rows are not charged. Free Apify plans are limited to one file per run. A ZIP URL counts as one file, including its CSV/JSON entries.

## `maxRowsPerFile` (type: `integer`):

Maximum delivered price rows per price-file URL, as a positive integer. Default 1000. One row represents a matched procedure/item and payer-plan, so one code may return multiple rows. Stop downloading a file once its row limit is reached; RUN_SUMMARY marks incomplete scans. Free Apify plans return at most 100 price rows per run.

## Actor input object example

```json
{
  "codes": [
    "27447",
    "470"
  ],
  "hospitals": [],
  "states": [
    "OH"
  ],
  "payers": [],
  "maxFiles": 5,
  "maxRowsPerFile": 1000
}
```

# Actor output Schema

## `prices` (type: `string`):

No description

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

No description

# 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 = {
    "codes": [
        "27447",
        "470"
    ],
    "states": [
        "OH"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cozybit/hospital-price-transparency").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 = {
    "codes": [
        "27447",
        "470",
    ],
    "states": ["OH"],
}

# Run the Actor and wait for it to finish
run = client.actor("cozybit/hospital-price-transparency").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 '{
  "codes": [
    "27447",
    "470"
  ],
  "states": [
    "OH"
  ]
}' |
apify call cozybit/hospital-price-transparency --silent --output-dataset

```

## MCP server setup

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

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/UOauyR6iKMKP6ZCa2/builds/tgsu86jgKnGdJXjAB/openapi.json
