# CMS Care Compare Hospital Lookup

> CMS Care Compare Hospital Lookup is a paid API for AI agents from 2s.io, paid per call via x402, $0.0012/call, status unknown (last checked 2026-09-15).

Look up CMS-certified US hospitals by facility ID or fuzzy name/location/type with optional star rating filter, returning full facility details and quality measure counts

## Facts

- Endpoint: GET https://2s.io/api/health/hospital-lookup
- Price: $0.0012/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-9e5c17a5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Iu-3f1WLq2XyuwhmmXwi0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-io-9e5c17a5
```

Example prompt: Can you look up CMS Care Compare details and quality ratings for Massachusetts General Hospital in Boston, MA — I want to see their CMS star rating, hospital type, and quality measure counts? Only show me hospitals with at least a 4-star overall rating.

## When to prefer this

Use this endpoint when you need structured, authoritative CMS quality data on US hospitals — including star ratings, quality measure breakdowns, and facility metadata. Prefer this over general web search when you need machine-readable federal hospital data, need to filter by hospital type or minimum rating, or need to look up a specific hospital by its CMS facility ID. Best for healthcare compliance, research, or patient decision-support use cases.

## Known failure modes

- No hospitals found matching the given name/state/city/type combination — returns empty result set
- Invalid facilityId format (must be 6-digit string) — returns error or empty results
- Invalid state code (must be 2-letter US state abbreviation) — returns error
- minRating out of range (must be 1–5) — returns validation error
- limit exceeds maximum of 100 — returns validation error
- Ambiguous fuzzy name match returns many unrelated hospitals — agent should add more filters

## How this service works

CMS Care Compare lookup for every CMS-certified US hospital (~5k). Lookup by 6-digit CMS Facility ID for direct match, or fuzzy by name + state + city + hospital type, with optional minimum overall rating (1-5) filter. Each record includes facility ID, name, full address, phone, hospital type (Acute Care / Critical Access / Psychiatric / etc.), ownership category, emergency services flag, birthing-friendly designation, CMS overall star rating, and per-measure-group counts (mortality, safety, readmission, patient experience, effectiveness, timeliness, medical imaging). Public-domain federal data.

## Output

Returns a paginated list of CMS-certified hospital records matching the query. Each record includes the 6-digit CMS facility ID, hospital name, full address, phone number, hospital type (Acute Care / Critical Access / Psychiatric / etc.), ownership category, whether emergency services are available, birthing-friendly designation, CMS overall star rating (1–5), and per-measure-group counts for mortality, safety, readmission, patient experience, effectiveness, timeliness, and medical imaging.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "city": "Boston",
   "limit": 10,
   "state": "MA",
   "offset": 0,
   "minRating": 4
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "properties": {
      "city": {
       "type": "string",
       "description": "City name (case-insensitive contains)."
      },
      "name": {
       "type": "string",
       "description": "Fuzzy name match."
      },
      "limit": {
       "type": "integer",
       "default": 20,
       "maximum": 100,
       "minimum": 1
      },
      "state": {
       "type": "string",
       "description": "2-letter US state."
      },
      "offset": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      },
      "minRating": {
       "type": "integer",
       "maximum": 5,
       "minimum": 1
      },
      "facilityId": {
       "type": "string",
       "description": "6-digit CMS facility ID."
      },
      "hospitalType": {
       "type": "string",
       "description": "E.g., \"Acute Care\", \"Critical Access\", \"Psychiatric\"."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-9e5c17a5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
