Medicare Hospital Compare Scraper — CMS Hospital Ratings avatar

Medicare Hospital Compare Scraper — CMS Hospital Ratings

Pricing

from $1.60 / 1,000 hospital profiles

Go to Apify Store
Medicare Hospital Compare Scraper — CMS Hospital Ratings

Medicare Hospital Compare Scraper — CMS Hospital Ratings

Export CMS Hospital Compare data for 5,400+ US hospitals: overall star rating, type, ownership, emergency services and address. USD 2 per 1,000 profiles.

Pricing

from $1.60 / 1,000 hospital profiles

Rating

0.0

(0)

Developer

Muhammad Afzal

Muhammad Afzal

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 hours ago

Last modified

Share

Medicare Hospital Compare Scraper returns official CMS Hospital Compare hospital profiles from the CMS Provider Data Catalog, with CMS Certification Number, hospital name, address, county, phone, hospital type, ownership, emergency services, birthing-friendly designation and the CMS overall hospital star rating. It is built for health-care analysts, researchers, payers, patient-navigation teams and developers who need structured hospital ratings data, and it costs USD 2.00 per 1,000 hospital profiles on the FREE tier (USD 1.60 on GOLD).

What hospital data does it return?

Each dataset row is one hospital from CMS's Hospital General Information file:

FieldWhat it contains
facilityIdCMS Certification Number (CCN), six digits, for example 010001
facilityNameOfficial CMS facility name
address, city, state, zipCodeFacility location
countyOrParish, phoneNumberCounty or parish and main phone number
hospitalTypeFor example Acute Care Hospitals, Critical Access Hospitals, Psychiatric or Childrens
hospitalOwnershipFor example Voluntary non-profit - Private, Proprietary or Government - Hospital District or Authority
emergencyServicestrue or false as reported to CMS
birthingFriendlyDesignationtrue when the hospital meets CMS birthing-friendly criteria
hospitalOverallRatingCMS overall star rating, 1 to 5, or null when CMS publishes none
hospitalOverallRatingFootnoteCMS footnote code for a missing or limited rating, for example 16
sourceUrl, sourceLastModified, scrapedAtThe CMS file read, its last-modified date and collection time

OUTPUT and SUMMARY in the key-value store hold the status (SUCCEEDED, EMPTY, REJECTED, BLOCKED or FAILED), filters, CMS file URL and date, record count and warnings.

How do I get CMS hospital star ratings for a state or city?

Combine state, city, nameQuery and overallRating; all filters must match. maxResults (1 to 500, default 10) caps the output.

{
"state": "TX",
"overallRating": "5",
"maxResults": 100
}
  • state: two-letter state or territory code, for example TX or PR.
  • city: case-insensitive "contains" match on the city name, so Dallas also matches longer names that contain it.
  • nameQuery: case-insensitive text inside the facility name, for example Baylor.
  • overallRating: 1 to 5. Leave it empty to include hospitals with no rating.

Invalid values (a three-letter state, a rating of 6) stop the run with REJECTED before any data is read. A valid filter with no match ends EMPTY with no record charges.

How do I look up hospitals by CMS Certification Number?

Put up to 100 six-digit CCNs in facilityIds. This is the CMS facility ID, not an NPI.

{
"facilityIds": ["010001", "450054"],
"maxResults": 10
}

How many hospitals have a CMS overall star rating?

In the CMS file dated 2026-07-22 (read on 2026-10-26), 5,419 hospitals across 56 states and territories are listed. 3,174 have an overall rating: 384 five-star, 946 four-star, 985 three-star, 661 two-star and 198 one-star. The other 2,245 have no rating and return hospitalOverallRating: null, most often with CMS footnote 16 (too few measures reported, 1,337 hospitals) or 19 (not in the CMS inpatient and outpatient quality reporting programs, 801 hospitals). The file lists 3,107 acute care hospitals and 1,382 critical access hospitals.

When should I use it, and when not?

Use it when you need the CMS hospital list with star ratings in a spreadsheet or database: market and network analysis, provider directories, care-navigation apps, research on ownership or emergency services, or a quarterly refresh of hospital ratings.

Use something else when:

How do I run it from code?

JavaScript with apify-client:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/medicare-hospital-compare-scraper').call({
state: 'CA',
overallRating: '5',
maxResults: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const h of items) console.log(h.facilityId, h.facilityName, h.city, h.hospitalOverallRating);

Python with apify-client:

import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("muhammadafzal/medicare-hospital-compare-scraper").call(run_input={
"state": "FL",
"maxResults": 500,
})
for h in client.dataset(run.default_dataset_id).iterate_items():
print(h["facilityName"], h["hospitalType"], h["emergencyServices"], h["hospitalOverallRating"])

Use it from an AI assistant

Medicare Hospital Compare Scraper works from Claude, ChatGPT, Cursor or any MCP client through Apify's MCP server. Add the single-tool URL https://mcp.apify.com/?tools=muhammadafzal/medicare-hospital-compare-scraper to your client and ask, for example: "List the five-star CMS-rated hospitals in Texas with emergency services, with their city and phone number." Each hospital profile is charged at the prices below.

What does the output look like?

The record from the default input in a 2026-10-26 cloud run:

{
"facilityId": "010001",
"facilityName": "SOUTHEAST HEALTH MEDICAL CENTER",
"address": "1108 ROSS CLARK CIRCLE",
"city": "DOTHAN",
"state": "AL",
"zipCode": "36301",
"countyOrParish": "HOUSTON",
"phoneNumber": "(334) 793-8701",
"hospitalType": "Acute Care Hospitals",
"hospitalOwnership": "Government - Hospital District or Authority",
"emergencyServices": true,
"birthingFriendlyDesignation": true,
"hospitalOverallRating": 4,
"hospitalOverallRatingFootnote": null,
"sourceUrl": "https://data.cms.gov/provider-data/sites/default/files/resources/893c372430d9d71a1c52737d01239d47_1785189955/Hospital_General_Information.csv",
"sourceLastModified": "2026-07-22",
"scrapedAt": "2026-10-26T06:53:02.301Z"
}

How much does the hospital ratings data cost?

The Actor uses pay-per-event pricing, and platform usage is included in the event prices. Each hospital profile saved to the dataset is one charged event; rejected input and empty results charge no profile events.

EventFREEBRONZESILVERGOLDPLATINUM / DIAMOND
Hospital profileUSD 0.002001USD 0.00195USD 0.0019USD 0.0016USD 0.0016
Actor start (per started GB of allocated memory)USD 0.006251USD 0.006094USD 0.005938USD 0.005USD 0.005

Worked totals on the FREE tier at the default 512 MB memory (one start event):

  • One hospital (the default input): 1 × USD 0.002001 + USD 0.006251 = USD 0.0083
  • 500 hospitals (the per-run maximum): 500 × USD 0.002001 + USD 0.006251 = USD 1.0068

All 5,419 hospitals take 11 runs of up to 500 (for example by state), about USD 10.91 on the FREE tier.

Limits and reliability

  • Source: each run looks up the current Hospital General Information file in the CMS catalog, downloads it and filters it, so you always get the latest published CMS data without a hard-coded file date.
  • Retries: CMS requests are retried up to 3 times on rate limits and server errors. If CMS stays unavailable, the run fails with BLOCKED or FAILED in OUTPUT and writes no records.
  • Order: results follow the CMS file order (by CCN), and maxResults keeps the first matches.
  • Charge limits: if you set a maximum total cost for the run, the Actor works out how many profiles fit from the live price for your tier, writes only those, and says so in its status message.

FAQ

Is Medicare Hospital Compare still available?

CMS folded Hospital Compare into Medicare Care Compare in 2020. The underlying hospital data is still published in the CMS Provider Data Catalog, which is what this Actor reads.

How often does CMS update hospital star ratings?

CMS refreshes its hospital files several times a year on its own schedule. sourceLastModified shows the date of the file each run used.

Why is a hospital's overall rating null?

CMS did not publish a star rating for that hospital. hospitalOverallRatingFootnote gives the CMS footnote code; 16 (too few measures reported) and 19 (not in the CMS quality reporting programs) are the most common.

Does it include patient survey stars or individual quality measures?

No. It returns the general information file: identity, location, type, ownership, emergency services, birthing-friendly status and the overall rating.

Can I download every hospital in the U.S.?

Yes, across runs. Each run returns up to 500 profiles, so filter by state and run one task per group of states.

Is CMS hospital data free to use?

CMS publishes it as public data. Attribute CMS as the source and do not imply CMS endorsement.

The Actor reads public CMS data with no login, CAPTCHA bypass or patient data. CMS information supports comparison and research and is not medical advice; confirm care decisions with providers. Attribute CMS as the source. This tool is not affiliated with or endorsed by CMS or Medicare, and this is not legal advice.

Last verified: 2026-10-27