Medicare API: Search hospitals
Finds 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.
Unofficial. Not affiliated with or endorsed by Medicare.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- State optional
state Optional state name or two-letter code to narrow a name search, such as California or CA.
Not set
- Search, required
search Hospital name, city and state, or ZIP code, such as Cedars-Sinai, Phoenix, AZ, or 90048.
Phoenix, AZ
- Max Results optional
max_results Maximum number of hospitals to return, such as 20 (up to 100).
5
Whole number from 1 to 100. Default
20.
Input as JSON
{ "search": "Phoenix, AZ", "max_results": 5}Output
{ "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 } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"medicare.gov/search_hospitals","input":{"search":"Phoenix, AZ","max_results":5}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "medicare.gov/search_hospitals" , "input": { "search": "Phoenix, AZ", "max_results": 5 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "medicare.gov/search_hospitals" , "input": { "search": "Phoenix, AZ", "max_results": 5 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run medicare.gov/search_hospitals# with {"search":"Phoenix, AZ","max_results":5}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "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." }, "search": { "type": "string", "minLength": 1, "description": "Hospital name, city and state, or ZIP code, such as Cedars-Sinai, Phoenix, AZ, or 90048." }, "max_results": { "type": "integer", "default": 20, "maximum": 100, "minimum": 1, "description": "Maximum number of hospitals to return, such as 20 (up to 100)." } }}Output schema
{ "type": "object", "required": [ "hospitals" ], "properties": { "hospitals": { "type": "array", "items": { "type": "object", "required": [ "hospital_name", "overall_star_rating", "patient_survey_star_rating", "hospital_type", "ownership", "emergency_services", "address", "city", "state", "zip_code", "phone", "care_compare_link", "cms_certification_number" ], "properties": { "city": { "type": [ "string", "null" ], "description": "City." }, "phone": { "type": [ "string", "null" ], "description": "Telephone number." }, "state": { "type": [ "string", "null" ], "description": "Two-letter state code." }, "address": { "type": [ "string", "null" ], "description": "Street address." }, "zip_code": { "type": [ "string", "null" ], "description": "ZIP code." }, "ownership": { "type": [ "string", "null" ], "description": "Hospital ownership." }, "hospital_name": { "type": [ "string", "null" ], "description": "Hospital name" }, "hospital_type": { "type": [ "string", "null" ], "description": "Type of hospital." }, "care_compare_link": { "type": [ "string", "null" ], "description": "Hospital page on Medicare Care Compare." }, "emergency_services": { "type": [ "string", "null" ], "description": "Whether the hospital has emergency services, Yes or No." }, "overall_star_rating": { "type": [ "integer", "null" ], "description": "Medicare overall star rating from 1 to 5, or null if not rated." }, "cms_certification_number": { "type": [ "string", "null" ], "description": "CMS certification number for the hospital.", "x-fous-developer": true }, "patient_survey_star_rating": { "type": [ "integer", "null" ], "description": "Summary patient survey star rating from 1 to 5, or null if not rated." } }, "additionalProperties": false }, "description": "Hospitals ranked by name match for name searches." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
medicare.gov/search_hospitals- Returns
- hospital name, overall and patient survey star ratings, type, ownership, emergency services, address, phone, Care Compare link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method medicare.gov/search_hospitals with the inputs above.
Ask your agent
- What are the Medicare star ratings for hospitals near ZIP code 60614? Show me the top 10.
- Find Mayo Clinic hospitals in Minnesota and give me their overall and patient survey star ratings plus phone numbers.
- List hospitals in Boise, ID with emergency services, ownership type, and addresses.
- On medicare.gov, look up Johns Hopkins Hospital and tell me its patient survey rating and Care Compare link.
- Pull up to 50 hospitals in Houston, TX from Medicare's Care Compare with their overall star ratings so I can compare them.
See more
All Medicare methodsFinds U.S. nursing homes on Medicare Care Compare by name, city and state, or ZIP code. Results include star ratings, ownership, fines from the last three years, and Care Compare links.
medicare.gov/search_nursing_homesFinds US healthcare providers by name, place, specialty and provider type in the NPI Registry, with practice contact details and primary taxonomy. Results may include providers with similar names.
npiregistry.cms.hhs.gov/search_providersLooks up a provider in the NPI Registry by 10-digit NPI number and returns the public name, specialties, addresses, contact details and registry dates.
npiregistry.cms.hhs.gov/get_providerFind nearby NHS service listings from a UK postcode or town, nearest first. NHS service search covers England; urgent_care returns A&E listings. Hours, patient availability and websites are null when not shown.
nhs.uk/search_nearby_servicesFinds places to stay in a city or area for given dates on Google Hotels, with nightly and total prices, hotel class, guest ratings, amenities, address and cheapest booking site. Optional filters for price, stars and rating; vacation rentals are left out. Prices and availability can change.
google.com/search_hotelsFinds ClinicalTrials.gov studies for a condition or medicine. You can filter by location, distance, recruitment status and phase. With a location, results are ordered by distance to the closest eligible site.
clinicaltrials.gov/search_trialsFinds a hotel on Google Hotels by name and city and returns its guest reviews in the chosen order, its Google rating and review count, and topic ratings averaged from the returned reviews that rate each topic.
google.com/get_hotel_reviewsFinds U.S. nonprofits by organization name, optionally filtered by state and city, with the latest reported revenue and assets.
projects.propublica.org/search_nonprofits