# Medicare Care Compare API

> Medicare Care Compare returns hospital and nursing home ratings and facility details as a workflow and API.

Medicare Care Compare, also called Care Compare, finds hospitals by name, city and state, or ZIP code, returning ratings and contact details. Search nursing homes by name, city and state, or ZIP code to see ratings, ownership, fines, and facility details.

- Page: https://fous.com/tools/medicare-care-compare
- Handle: `@medicare-care-compare`
- Category: [Health](https://fous.com/tools/category/health)
- Source website: https://medicare.gov/care-compare
- Last verified: Sep 29, 2026

## Methods

### Search hospitals

Operation `search_hospitals`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find U.S. hospitals by name, city and state, or ZIP code, with Medicare overall and patient survey star ratings, contact details, and Care Compare links. Ratings may be unavailable for some hospitals.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `state` | string | no | `"California"` | Optional state name or two-letter code to narrow a name search, such as California or CA. |
| `search` | string | yes | `"Phoenix, AZ"` | Hospital name, city and state, or ZIP code, such as Cedars-Sinai, Phoenix, AZ, or 90048. |
| `max_results` | integer | no | `5` | Maximum number of hospitals to return, such as 20 (up to 100). |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "search"
  ],
  "properties": {
    "state": {
      "type": "string",
      "description": "Optional state name or two-letter code to narrow a name search, such as California or CA.",
      "examples": [
        "California"
      ]
    },
    "search": {
      "type": "string",
      "minLength": 1,
      "description": "Hospital name, city and state, or ZIP code, such as Cedars-Sinai, Phoenix, AZ, or 90048.",
      "examples": [
        "Phoenix, AZ",
        "Cedars-Sinai",
        "90048"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of hospitals to return, such as 20 (up to 100).",
      "x-fous-developer": true,
      "examples": [
        5,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "search": "Phoenix, AZ",
      "max_results": 5
    },
    {
      "search": "Cedars-Sinai"
    },
    {
      "search": "90048"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `hospitals` | array |  | Hospitals ranked by name match for name searches. |
| `hospitals[].city` | string or null | `"PHOENIX"` | City. |
| `hospitals[].phone` | string or null | `"(602) 839-2000"` | Telephone number. |
| `hospitals[].state` | string or null | `"AZ"` | Two-letter state code. |
| `hospitals[].address` | string or null | `"1111 EAST MCDOWELL ROAD"` | Street address. |
| `hospitals[].zip_code` | string or null | `"85006"` | ZIP code. |
| `hospitals[].ownership` | string or null | `"Voluntary non-profit - Other"` | Hospital ownership. |
| `hospitals[].hospital_name` | string or null | `"BANNER - UNIVERSITY MEDICAL CENTER PHOENIX"` | Hospital name |
| `hospitals[].hospital_type` | string or null | `"Acute Care Hospitals"` | Type of hospital. |
| `hospitals[].care_compare_link` | string or null | `"https://www.medicare.gov/care-compare/details/hospital/030002/view-all/"` | Hospital page on Medicare Care Compare. |
| `hospitals[].emergency_services` | string or null | `"Yes"` | Whether the hospital has emergency services, Yes or No. |
| `hospitals[].overall_star_rating` | integer or null | `3` | Medicare overall star rating from 1 to 5, or null if not rated. |
| `hospitals[].cms_certification_number` | string or null | `"030002"` | CMS certification number for the hospital. |
| `hospitals[].patient_survey_star_rating` | integer or null | `2` | Summary patient survey star rating from 1 to 5, or null if not rated. |

**Example input**

```json
{
  "search": "Phoenix, AZ",
  "max_results": 5
}
```

**Example output**

```json
{
  "hospitals": [
    {
      "city": "PHOENIX",
      "phone": "(602) 839-2000",
      "state": "AZ",
      "address": "1111 EAST MCDOWELL ROAD",
      "zip_code": "85006",
      "ownership": "Voluntary non-profit - Other",
      "hospital_name": "BANNER - UNIVERSITY MEDICAL CENTER PHOENIX",
      "hospital_type": "Acute Care Hospitals",
      "care_compare_link": "https://www.medicare.gov/care-compare/details/hospital/030002/view-all/",
      "emergency_services": "Yes",
      "overall_star_rating": 3,
      "cms_certification_number": "030002",
      "patient_survey_star_rating": 2
    },
    {
      "city": "PHOENIX",
      "phone": "(602) 943-2381",
      "state": "AZ",
      "address": "250 EAST DUNLAP AVENUE",
      "zip_code": "85020",
      "ownership": "Voluntary non-profit - Private",
      "hospital_name": "HONOR HEALTH JOHN C. LINCOLN MEDICAL CENTER",
      "hospital_type": "Acute Care Hospitals",
      "care_compare_link": "https://www.medicare.gov/care-compare/details/hospital/030014/view-all/",
      "emergency_services": "Yes",
      "overall_star_rating": 3,
      "cms_certification_number": "030014",
      "patient_survey_star_rating": 3
    },
    {
      "city": "PHOENIX",
      "phone": "(602) 344-5011",
      "state": "AZ",
      "address": "2601 EAST ROOSEVELT STREET",
      "zip_code": "85008",
      "ownership": "Government - Local",
      "hospital_name": "VALLEYWISE HEALTH MEDICAL CENTER",
      "hospital_type": "Acute Care Hospitals",
      "care_compare_link": "https://www.medicare.gov/care-compare/details/hospital/030022/view-all/",
      "emergency_services": "No",
      "overall_star_rating": 1,
      "cms_certification_number": "030022",
      "patient_survey_star_rating": 3
    }
  ]
}
```

### Search nursing homes

Operation `search_nursing_homes`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find U.S. nursing homes by name, city and state, or ZIP code, with Medicare star ratings, ownership, fines in the last three years, and Care Compare pages. Only active facilities in the current public provider listing are included.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `state` | string | no | `"Florida"` | Optional state name or two-letter code. Example: Florida. |
| `search` | string | yes | `"Burns Nursing Home"` | Nursing home name, city and state, or ZIP code. Example: Tampa, FL. |
| `max_results` | integer | no | `2` | Maximum number of homes to return. Example: 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "search"
  ],
  "properties": {
    "state": {
      "type": "string",
      "description": "Optional state name or two-letter code. Example: Florida.",
      "examples": [
        "Florida"
      ]
    },
    "search": {
      "type": "string",
      "minLength": 1,
      "description": "Nursing home name, city and state, or ZIP code. Example: Tampa, FL.",
      "examples": [
        "Burns Nursing Home",
        "Tampa, FL",
        "33602"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of homes to return. Example: 20.",
      "x-fous-developer": true,
      "examples": [
        2
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "search": "Burns Nursing Home"
    },
    {
      "state": "Florida",
      "search": "Tampa, FL",
      "max_results": 2
    },
    {
      "search": "33602"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `nursing_homes` | array |  | Matching nursing homes, with closest name matches first. |
| `nursing_homes[].name` | string | `"Burns Nursing Home, Inc."` | Name of the nursing home. |
| `nursing_homes[].phone` | string or null | `"(256) 332-4110"` | Facility telephone number. |
| `nursing_homes[].address` | string or null | `"701 MONROE STREET NW, RUSSELLVILLE, AL 35653"` | Street address, city, state, and ZIP code. |
| `nursing_homes[].total_fines` | number or null | `0` | Total federal fines in the last 3 years. |
| `nursing_homes[].fines_currency` | string | `"USD"` | Currency of total fines (USD). |
| `nursing_homes[].ownership_type` | string or null | `"For profit - Corporation"` | Type of ownership. |
| `nursing_homes[].number_of_fines` | integer or null | `0` | Number of federal fines in the last 3 years. |
| `nursing_homes[].staffing_rating` | integer or null | `4` | Staffing stars from 1 to 5, or null if not rated. |
| `nursing_homes[].care_compare_link` | string | `"https://www.medicare.gov/care-compare/details/nursing-home/015009"` | Link to this nursing home on Medicare Care Compare. |
| `nursing_homes[].abuse_warning_shown` | boolean | `false` | Whether a Medicare abuse warning icon is shown. |
| `nursing_homes[].overall_star_rating` | integer or null | `2` | Overall Medicare star rating from 1 to 5, or null if not rated. |
| `nursing_homes[].quality_measures_rating` | integer or null | `4` | Quality measure stars from 1 to 5, or null if not rated. |
| `nursing_homes[].cms_certification_number` | string | `"015009"` | CMS certification number for the facility. |
| `nursing_homes[].health_inspection_rating` | integer or null | `2` | Health inspection stars from 1 to 5, or null if not rated. |
| `nursing_homes[].number_of_certified_beds` | integer or null | `57` | Number of certified beds. |
| `nursing_homes[].average_residents_per_day` | number or null | `51.6` | Average number of residents per day. |

**Example input**

```json
{
  "search": "Burns Nursing Home"
}
```

**Example output**

```json
{
  "nursing_homes": [
    {
      "name": "Burns Nursing Home, Inc.",
      "phone": "(256) 332-4110",
      "address": "701 MONROE STREET NW, RUSSELLVILLE, AL 35653",
      "total_fines": 0,
      "fines_currency": "USD",
      "ownership_type": "For profit - Corporation",
      "number_of_fines": 0,
      "staffing_rating": 4,
      "care_compare_link": "https://www.medicare.gov/care-compare/details/nursing-home/015009",
      "abuse_warning_shown": false,
      "overall_star_rating": 2,
      "quality_measures_rating": 4,
      "cms_certification_number": "015009",
      "health_inspection_rating": 2,
      "number_of_certified_beds": 57,
      "average_residents_per_day": 51.6
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@medicare-care-compare",
  "visibility": "public",
  "operation": "search_hospitals",
  "version": 1,
  "input": {
    "search": "Phoenix, AZ",
    "max_results": 5
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@medicare-care-compare\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_hospitals\",\n  \"version\": 1,\n  \"input\": {\n    \"search\": \"Phoenix, AZ\",\n    \"max_results\": 5\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@medicare-care-compare",
  "visibility": "public",
  "operation": "search_hospitals",
  "version": 1,
  "input": {
    "search": "Phoenix, AZ",
    "max_results": 5
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/medicare-care-compare`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `search_hospitals`: Search hospitals. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_nursing_homes`: Search nursing homes. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-medicare-care-compare https://api.fous.com/mcp/tools/medicare-care-compare --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare hospital overall and patient survey star ratings.
- Find hospitals by name, location, or ZIP code.
- Compare nursing home ratings, including staffing and health inspections.
- Review nursing home fines from the last three years.
- Find facility contact details and certified bed counts.

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Medicare Care Compare tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Medicare Care Compare account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from medicare.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What are a hospital’s overall and patient survey ratings?

Search hospitals returns Medicare overall and patient survey star ratings, when available.

### How many federal fines has a nursing home received?

Search nursing homes returns the number and total amount of federal fines from the last three years.

### What is a nursing home’s staffing rating?

Search nursing homes returns staffing stars from 1 to 5, or no rating when it is unavailable.

## Related

- [NPI Registry API](https://fous.com/tools/npi-registry.md): NPI Registry returns public US provider search results with contact and taxonomy details, plus individual 10-digit NPI records with registry dates; fields may be missing.
- [ClinicalTrials.gov API](https://fous.com/tools/clinicaltrials-gov.md): ClinicalTrials.gov helps users find studies and view public trial records, including sponsor-run or funded studies; site distances are approximate, and contacts, eligibility, or exact dates may be missing.
- [Homes.com API](https://fous.com/tools/homes-com.md): Search homes for sale in the United States.
- [Mayo Clinic API](https://fous.com/tools/mayo-clinic.md): Mayo Clinic provides health information from public condition pages, including condition overviews and, where available, diagnosis, treatment, home care, alternative medicine, and appointment preparation.
- [NHS API](https://fous.com/tools/nhs.md): NHS provides condition and medicine guidance, with condition dates reflecting the latest pages used, and nearby England service listings ordered by distance; availability details may be missing.
- [US Census Bureau API](https://fous.com/tools/us-census-bureau.md): US Census Bureau returns statistics from varying Census years, population estimates through July 1, and address geographies using Census vintages that may differ from representation.
- [GoodRx API](https://fous.com/tools/goodrx.md): Prescription savings and drug prices at US pharmacies.
- [Drugs.com API](https://fous.com/tools/drugs-com.md): Drugs.com provides public medicine guides, interaction and food or lifestyle warnings for 2–10 medicines, pill matches by imprint, color, or shape, and listed US cash prices by strength, form, and quantity.
- [All Health tools](https://fous.com/tools/category/health)
