# 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/workflows/medicare-care-compare
- Handle: `@medicare-care-compare`
- Category: [Health](https://fous.com/workflows/category/health)
- Source website: https://medicare.gov/care-compare
- Last verified: Sep 29, 2026
- Fous is not affiliated with Medicare Care Compare.

## Methods

### Search hospitals

Operation `search_hospitals`, version 1. 1 credit per call.

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

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@medicare-care-compare","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

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

### Is Fous affiliated with Medicare Care Compare?

No. Fous is not affiliated with Medicare Care Compare. This workflow reads the public medicare.gov website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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

- [All Health workflows](https://fous.com/workflows/category/health)
