Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Medicare-certified nursing home ratings, staffing, and inspection records for building local long-term-care comparison tools.
From source to product signal
Nursing Home Provider Information lists certified facilities with Five-Star ratings, staffing, and inspection dates. Start with one state and the stable dataset identifier. Ratings can be missing, inspections lag events, and a star rating is not a clinical recommendation.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://data.cms.gov/provider-data/api/1/datastore/query/4pq5-n9py/0",
params={
"limit": 20,
"conditions[0][property]": "state",
"conditions[0][value]": "CA",
"conditions[0][operator]": "=",
},
timeout=30,
)
response.raise_for_status()
homes = pd.DataFrame(response.json()["results"])
print(
homes[
[
"cms_certification_number_ccn",
"provider_name",
"state",
"overall_rating",
]
].head(20)
)Test a useful signal
Summarize Five-Star ratings and staffing for facilities in one state.
Centers for Medicare & Medicaid Services is a government source. Last verified 2026-08-18. Temporal coverage: current Medicare-certified nursing homes.