cfpb_complaint_trends
Track consumer complaint trends over time using CFPB data. Aggregate by month, quarter, or year, and filter by product, issue, company, or state for detailed insights.
Instructions
Get complaint trends over time using the CFPB Trends API. Uses dedicated /trends endpoint with lens-based aggregation. REQUIRED: trend_interval ('month', 'quarter', or 'year') — the API rejects requests without it. Lens options: 'overview' (total counts), 'product' (by product), 'issue' (by issue), 'tags' (by tag). Sub-lens allows drilling into sub-categories within the lens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lens | No | Trend lens (default: overview) | |
| focus | No | Focus charts on a specific product or company name | |
| issue | No | Issue type filter | |
| state | No | Two-letter state code: 'CA', 'TX', 'NY' | |
| company | No | Company name: 'Wells Fargo', 'Equifax', etc. | |
| product | No | Financial product: 'Mortgage', 'Debt collection', etc. | |
| sub_lens | No | Sub-lens drill-down | |
| sub_lens_depth | No | Top N sub-aggregations to return (default 10) | |
| trend_interval | Yes | Time bucket size for trend aggregation: 'month', 'quarter', or 'year' | |
| date_received_max | No | End date (YYYY-MM-DD) | |
| date_received_min | No | Start date (YYYY-MM-DD) |