Medicare Hospital Compare Scraper avatar

Medicare Hospital Compare Scraper

Pricing

from $2.00 / 1,000 hospital records

Go to Apify Store
Medicare Hospital Compare Scraper

Medicare Hospital Compare Scraper

Healthcare analysts and hospital-comparison tools get every CMS-rated hospital's star rating and quality measures as flat records, not a government search page.

Pricing

from $2.00 / 1,000 hospital records

Rating

0.0

(0)

Developer

Nick Randall

Nick Randall

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Healthcare analysts and hospital-comparison tools get every CMS-rated hospital's star rating and quality measures as flat records, not a paginated government search page. Filter by state, city, county, ownership or rating and export results ready for a spreadsheet or database.

Get clean, structured hospital records from the CMS Provider Data Catalog as JSON, CSV or Excel, or call it as a tool from Claude, Cursor, ChatGPT or any MCP client. Pay only for the results you receive.

What you get

One record per Medicare-participating hospital: facility ID, name, address, city, state, zip, county, phone, hospital type and ownership, whether it offers emergency services, whether it meets the birthing-friendly designation, the overall CMS star rating and its footnote, and the measure counts and national-comparison footnotes for each of the five quality groups CMS tracks: mortality, safety, readmission, patient experience, and timely and effective care.

Every result is a flat record with stable field names, so it drops straight into a spreadsheet, a database or an AI agent's context.

Why use this instead of the website

  • Filter by state, city, county, name, hospital type, ownership, minimum rating and emergency services in one call
  • Pagination handled for you, with automatic retries and polite rate limiting
  • Results in JSON, CSV, Excel or via API, or piped into Zapier, Make, n8n and Google Sheets
  • Works as an MCP tool, so AI agents can look up hospitals on demand
  • No browser, no proxies, no personal data: fast runs and a tiny cost per result

Input

FieldTypeDefaultMeaning
statestringTwo-letter state or territory code, e.g. "AZ". Strongly recommended.
citystringCity or town name, matched exactly (case-insensitive).
countystringCounty name.
nameContainsstringOnly hospitals whose name contains this text.
hospitalTypestringanyExact CMS hospital type, e.g. "Acute Care Hospitals".
ownershipstringanyExact CMS ownership category, e.g. "Proprietary".
minOverallRatingintegerMinimum overall Medicare star rating, 1 to 5.
emergencyServicesbooleantrue for hospitals with emergency services, false for those without, unset for both.
maxResultsinteger100Cap on hospitals saved. You are charged per hospital, so this caps your cost.

Example input:

{ "state": "AZ", "emergencyServices": true, "maxResults": 40 }

Output

Sample rows from a live run:

facilitycitystaterating
BANNER - UNIVERSITY MEDICAL CENTER PHOE…PHOENIXAZ3
TUCSON MEDICAL CENTERTUCSONAZ2
VERDE VALLEY MEDICAL CENTERCOTTONWOODAZ4

Full example result:

{
"facilityId": "030002",
"facilityName": "BANNER - UNIVERSITY MEDICAL CENTER PHOENIX",
"address": "1111 EAST MCDOWELL ROAD",
"city": "PHOENIX",
"state": "AZ",
"zipCode": "85006",
"countyName": "MARICOPA",
"phone": "(602) 839-2000",
"hospitalType": "Acute Care Hospitals",
"hospitalOwnership": "Voluntary non-profit - Other",
"emergencyServices": true,
"birthingFriendly": "Y",
"overallRating": 3,
"overallRatingFootnote": null,
"mortalityMeasureCount": 7,
"mortalityNationalComparison": null,
"safetyMeasureCount": 8,
"safetyNationalComparison": null,
"readmissionMeasureCount": 11,
"readmissionNationalComparison": null,
"patientExperienceMeasureCount": 8,
"patientExperienceNationalComparison": null,
"timelyEffectiveCareMeasureCount": 12,
"timelyEffectiveCareNationalComparison": null
}

Field reference: facilityId, facilityName, address, city, state, zipCode, countyName, phone, hospitalType, hospitalOwnership, emergencyServices, birthingFriendly, overallRating, overallRatingFootnote, mortalityMeasureCount, mortalityNationalComparison, safetyMeasureCount, safetyNationalComparison, readmissionMeasureCount, readmissionNationalComparison, patientExperienceMeasureCount, patientExperienceNationalComparison, timelyEffectiveCareMeasureCount, timelyEffectiveCareNationalComparison. overallRating is null when CMS has not yet published a rating for that hospital. Footnote fields hold CMS's national-comparison note when present, otherwise null.

Pricing

Pay per event. You are charged $2.00 per 1,000 results saved to the dataset, plus a fraction of a cent per run start. Nothing is charged for results you do not receive. Set "Max total charge per run" in the run options to cap spending on any run. When a run reaches your cap it stops cleanly and keeps everything it already saved.

Rough guide: 1,000 results cost $2.00 and take about 15 seconds.

Use it from an AI agent (MCP)

This Actor is available as an MCP tool through the Apify MCP server. Add it to your client, then ask the agent for the data in plain language.

Claude Desktop, Claude Code or Cursor (mcp.json / claude_desktop_config.json):

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?actors=brightpath-data/cms-hospital-compare",
"headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
}
}
}

ChatGPT and other clients that support remote MCP servers: add https://mcp.apify.com/?actors=brightpath-data/cms-hospital-compare as a connector with your Apify token.

Example prompt once connected: "Find acute care hospitals in Arizona with emergency services and list their overall star rating and ownership."

Use it from code

curl -X POST "https://api.apify.com/v2/acts/brightpath-data~cms-hospital-compare/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"state":"AZ","emergencyServices":true,"maxResults":40}'

Python:

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("brightpath-data/cms-hospital-compare").call(run_input={"state": "AZ", "emergencyServices": True, "maxResults": 40})
items = client.dataset(run["defaultDatasetId"]).list_items().items

Limits and fair use

  • Up to 10,000 hospitals per run. For larger exports, split by state or city.
  • Requests are paced at one per 250 ms and fetch up to 500 records per request.
  • minOverallRating is applied after fetching each page, so a narrow filter on a huge unfiltered run (no state) can take longer than the item count suggests. Set a state for fast runs.

Data comes from the CMS Provider Data Catalog (data.cms.gov), the official public API behind Medicare Care Compare, published by the Centers for Medicare & Medicaid Services. The data is public and free to use. This Actor collects public, non-personal data only and does not bypass logins, paywalls or access controls. You are responsible for how you use the data.

Support

Found a problem or need a field added? Open an issue on the Actor's Issues tab. Fixes for broken runs are prioritized.