# U.S. Hospital Rankings by State or City (CMS Care Compare)

> U.S. Hospital Rankings by State or City (CMS Care Compare) is a paid API for AI agents from www.x402pulse.dev, paid per call via x402, $0.0525/call, status unknown (last checked 2026-10-12).

Returns a ranked list of the best U.S. hospitals in a given state or city, sorted by CMS star rating and net quality score across mortality, safety, and readmissions measures.

## Facts

- Endpoint: GET https://www.x402pulse.dev/v1/health/hospitals?utm_source=zero.xyz
- Price: $0.0525/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/u-s-hospital-rankings-by-state-or-city-cms-care-compare-84a02e03
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YcfHvu2BgtVfh5UzuuQxK

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 u-s-hospital-rankings-by-state-or-city-cms-care-compare-84a02e03
```

Example prompt: Can you show me the top 10 best acute care hospitals in Texas with at least 4 CMS stars that have emergency services, ranked by their quality scores?

## When to prefer this

Use this endpoint when you need a ranked, filtered view of the best hospitals in a U.S. state or city based on official CMS quality data. Prefer it over general web searches for authoritative, data-driven hospital rankings. Use the sibling hospital scorecard endpoint when you need detailed metrics for a specific known hospital rather than a ranked list.

## Known failure modes

- Invalid state code returns an error or empty results
- No hospitals match the filter combination (e.g. psychiatric + 5 stars in a small state) returns empty list
- limit parameter out of range (must be 1–50) may return an error
- Data reflects CMS Care Compare snapshot and may not reflect the most current hospital status

## How this service works

Best hospitals ranking for a U.S. state or city from Centers for Medicare & Medicaid Services (CMS) Care Compare data: ranked by CMS star rating, then net score (quality measures better than national minus worse across mortality, safety and readmissions). Filter by city, minimum stars, emergency services and hospital type (acute, critical access, children's, psychiatric). Not medical advice.

## Output

A ranked list of hospitals matching the specified filters, ordered by CMS star rating (descending) then net quality score. Each entry includes hospital name, city, state, star rating, hospital type, emergency services availability, and net quality score derived from mortality, safety, and readmissions measures relative to national benchmarks.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "city": {
       "type": "string"
      },
      "type": {
       "enum": [
        "acute",
        "critical",
        "childrens",
        "psychiatric"
       ],
       "type": "string"
      },
      "limit": {
       "type": "string",
       "description": "1 to 50"
      },
      "state": {
       "type": "string",
       "description": "Two-letter state code"
      },
      "minStars": {
       "enum": [
        "1",
        "2",
        "3",
        "4",
        "5"
       ],
       "type": "string"
      },
      "emergency": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "filters": {
    "city": "Phoenix",
    "state": "AZ"
   },
   "hospitals": [
    {
     "id": "030103",
     "name": "Mayo Clinic Hospital",
     "rank": 1,
     "netScore": 9,
     "starRating": 5,
     "measuresWorse": 0,
     "measuresBetter": 9
    }
   ],
   "hospitalsMatching": 18
  },
  "cached": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/u-s-hospital-rankings-by-state-or-city-cms-care-compare-84a02e03/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.x402pulse.dev](https://www.zero.xyz/host/www.x402pulse.dev/llms.txt)
