CMS Hospital Compare Scraper
Pricing
Pay per event
CMS Hospital Compare Scraper
🏥 Export U.S. hospital profiles, ownership, emergency services, and CMS overall ratings from public Provider Data.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Stas Persiianenko
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Export U.S. hospital profiles and CMS quality ratings from the public CMS Provider Data Hospital General Information dataset.
Use this Apify Actor when you need a repeatable CSV, JSON, Excel, API, or MCP workflow for Hospital Compare data without building your own CMS API pagination and normalization logic.
What does CMS Hospital Compare Scraper do?
CMS Hospital Compare Scraper collects hospital records from the official CMS Provider Data API dataset xubh-q36u.
It returns one normalized dataset row per matching hospital.
The actor includes CMS facility IDs, facility names, address fields, county, phone number, hospital type, ownership, emergency-services availability, birthing-friendly designation, and CMS overall hospital rating.
It is designed for healthcare benchmarking, market mapping, provider-network research, and public-data monitoring workflows.
Why use this hospital compare scraper?
✅ No login required.
✅ Uses the official public CMS Provider Data API.
✅ Normalizes CMS field names into stable dataset columns.
✅ Supports state, city, facility, ownership, type, emergency-service, and rating filters.
✅ Works as an Apify dataset export, API integration, scheduled monitor, or MCP tool.
Who is it for?
Healthcare consultants can benchmark hospitals by state, type, ownership, and star rating.
Payers and provider-network teams can build facility lists for network adequacy and market analysis.
Compliance and quality teams can monitor official CMS hospital ratings and public facility metadata.
Healthcare reputation teams can identify hospitals by location and rating segments.
Lead-generation teams can build targeted lists of hospitals by ownership, region, or emergency services.
Data engineers can pipe CMS Hospital Compare records into warehouses, dashboards, or CRMs.
What data can you extract?
| Field | Description |
|---|---|
facilityId | CMS facility identifier |
facilityName | Hospital/facility name |
address | Street address |
city | City/town |
state | Two-letter state code |
zipCode | ZIP code |
county | County/parish |
phone | Telephone number |
hospitalType | CMS hospital type |
ownership | CMS ownership category |
emergencyServices | Boolean emergency-services flag |
birthingFriendlyDesignation | CMS birthing-friendly designation value |
overallRating | Numeric CMS overall hospital rating when available |
overallRatingRaw | Raw CMS rating text |
overallRatingFootnote | CMS footnote for missing/suppressed ratings |
cmsSourceUrl | Source dataset URL |
scrapedAt | Extraction timestamp |
Input filters
Use states to limit records to one or more U.S. states.
Use city when you need hospitals in a specific city or metro naming pattern.
Use facilityName to find a named hospital system or campus.
Use facilityIds when you already know exact CMS IDs.
Use hospitalTypes for values such as Acute Care Hospitals or Critical Access Hospitals.
Use ownershipTypes for CMS ownership categories such as Proprietary or Voluntary non-profit - Private.
Use emergencyServices to select hospitals with or without emergency services.
Use minOverallRating and maxOverallRating to focus on hospitals with CMS star ratings in a range.
Use maxResults to cap the number of dataset rows.
Example input: California and Texas hospitals
{"states": ["CA", "TX"],"emergencyServices": "any","maxResults": 100}
Example input: high-rated hospitals in one state
{"states": ["FL"],"minOverallRating": 4,"emergencyServices": "yes","maxResults": 250}
Example input: search by facility name
{"facilityName": "children","states": ["NY", "NJ", "PA"],"maxResults": 100}
Output example
{"facilityId": "050025","facilityName": "UNIVERSITY OF CALIFORNIA DAVIS MEDICAL CENTER","address": "2315 STOCKTON BOULEVARD","city": "SACRAMENTO","state": "CA","zipCode": "95817","county": "SACRAMENTO","phone": "9167342011","hospitalType": "Acute Care Hospitals","ownership": "Government - Hospital District or Authority","emergencyServices": true,"overallRating": 4,"overallRatingRaw": "4","cmsSourceUrl": "https://data.cms.gov/provider-data/dataset/xubh-q36u","scrapedAt": "2026-06-29T00:00:00.000Z"}
How much does it cost to scrape CMS Hospital Compare data?
This actor uses pay-per-event pricing: a $0.005 run-start event plus a per-hospital result event.
| Apify plan tier | Price per hospital record | 1,000 records |
|---|---|---|
| Free | $0.000031109 | $0.0311 |
| Bronze | $0.000027052 | $0.0271 |
| Silver | $0.000021100 | $0.0211 |
| Gold | $0.000016231 | $0.0162 |
| Platinum | $0.000010821 | $0.0108 |
| Diamond | $0.000010000 | $0.0100 |
The default test input is intentionally small so you can validate the output before running a larger export.
For larger recurring jobs, use maxResults and filters to control cost.
How to run the scraper
-
Open the actor on Apify.
-
Enter state, city, facility, type, ownership, rating, and result-limit filters.
-
Click Start.
-
Download the dataset as JSON, CSV, Excel, XML, or RSS.
-
Use the API or scheduler for repeatable workflows.
Scheduling hospital data monitors
You can schedule this actor to refresh hospital records weekly, monthly, or quarterly.
A scheduled run is useful when your team tracks CMS public-data changes, provider lists, quality-rating changes, or market coverage.
Store each run in an Apify dataset and compare snapshots in your own warehouse or BI tool.
API usage with JavaScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('automation-lab/cms-hospital-compare-scraper').call({states: ['CA'],minOverallRating: 4,maxResults: 100,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
API usage with Python
from apify_client import ApifyClientclient = ApifyClient('YOUR_APIFY_TOKEN')run = client.actor('automation-lab/cms-hospital-compare-scraper').call(run_input={'states': ['CA'],'minOverallRating': 4,'maxResults': 100,})items = client.dataset(run['defaultDatasetId']).list_items().itemsprint(items)
API usage with cURL
curl -X POST 'https://api.apify.com/v2/acts/automation-lab~cms-hospital-compare-scraper/runs?token=YOUR_APIFY_TOKEN' \-H 'Content-Type: application/json' \-d '{"states":["CA"],"maxResults":100}'
MCP integration
Use Apify MCP to call this hospital compare extractor from Claude Code, Claude Desktop, or another MCP-compatible client.
Add the tool in Claude Code:
$claude mcp add apify-cms-hospital-compare https://mcp.apify.com/?tools=automation-lab/cms-hospital-compare-scraper
MCP server URL:
https://mcp.apify.com/?tools=automation-lab/cms-hospital-compare-scraper
Claude Desktop configuration example:
{"mcpServers": {"apify-cms-hospital-compare": {"url": "https://mcp.apify.com/?tools=automation-lab/cms-hospital-compare-scraper"}}}
Example prompts:
- MCP usage: "Use the Apify CMS Hospital Compare MCP tool to find acute care hospitals in California with CMS overall rating 4 or higher."
- MCP usage: "Run automation-lab/cms-hospital-compare-scraper through MCP and export hospitals in Texas that report emergency services."
- MCP usage: "Use the hospital compare scraper MCP tool to create a CSV of proprietary hospitals in Florida from CMS Provider Data."
Integrations
Send hospital records to Google Sheets for analyst review.
Load CMS hospital profiles into BigQuery, Snowflake, PostgreSQL, or another warehouse.
Push matching facilities into a CRM for healthcare outreach.
Combine this dataset with internal claims, referral, or quality data.
Monitor official CMS hospital metadata changes over time.
Data freshness
The actor reads the current public CMS Provider Data API response at run time.
CMS updates the underlying dataset on its own schedule.
Use scrapedAt to track when your Apify snapshot was collected.
Tips for better results
Use exact two-letter state codes for state filters.
Use CMS's own hospital type and ownership wording for exact category filters.
Start with broad filters, inspect values, then tighten hospital type or ownership filters.
Set minOverallRating only when you want to exclude Not Available ratings.
Increase maxResults for statewide or national exports.
Limitations
This actor exports the Hospital General Information dataset only.
It does not currently join every separate CMS measure-level dataset.
Some hospitals have Not Available overall ratings; those are returned with overallRating set to null.
CMS field names and dataset contents may change over time; the actor normalizes known fields and keeps the raw rating text for transparency.
Legality
Is scraping CMS Hospital Compare legal?
This actor uses a public U.S. government data API.
You are responsible for using exported data in compliance with applicable laws, Apify terms, and your organization's policies.
Do not use the data for unlawful discrimination, spam, or misleading healthcare claims.
Troubleshooting
If a rating filter returns fewer records than expected, remember that hospitals with Not Available ratings are excluded by numeric rating filters.
If a hospital type filter returns no records, run a broader state query first and copy the exact CMS hospitalType value from the output.
If your run stops before a national export completes, increase maxResults and check whether your filters are too narrow.
FAQ
Does this actor require a CMS API key?
No. It uses the public CMS Provider Data API without an API key.
Does it use a browser?
No. It is an HTTP/API actor, which keeps runs fast and inexpensive.
Can I export all hospitals in the United States?
Yes. Leave filters empty and set maxResults high enough for your export.
Can I monitor changes?
Yes. Schedule recurring runs and compare output datasets by facilityId.
Can I filter by star rating?
Yes. Use minOverallRating and maxOverallRating for CMS overall hospital ratings.
Related scrapers
Explore other Automation Lab public-data and healthcare actors at https://apify.com/automation-lab/.
Potential companion workflows include nursing home comparison, clinical trials monitoring, provider directory enrichment, and healthcare lead generation.
Support
If you need another CMS dataset joined into this actor, open an Apify issue with the dataset name, fields, and target workflow.
We prioritize additions that improve repeatable healthcare benchmarking, compliance, and market-research workflows.