Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Consumer financial product complaints sent to companies for response, for building company, product, and state complaint-monitoring tools.
From source to product signal
The Consumer Complaint Database publishes complaints that CFPB sent to companies for response. Start with one product and one state through the search API. These records are not a statistical sample of consumer experience and are not a finding that a company violated the law.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://www.consumerfinance.gov/data-research/consumer-complaints/search/api/v1/",
params={"size": 20, "product": "Mortgage", "state": "CA"},
timeout=30,
)
response.raise_for_status()
hits = [hit["_source"] for hit in response.json()["hits"]["hits"]]
complaints = pd.DataFrame(hits)
complaints["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(complaints[["company", "product", "issue", "date_received"]].head(20))Test a useful signal
Identify which companies appear most often in recent California mortgage complaints.
Consumer Financial Protection Bureau is a government source. Last verified 2026-08-14. Temporal coverage: 2011-present.