# CFPB complaints

> POST /cfpb/complaints counts the consumer complaints a company received at the CFPB: total, monthly trend, top products and issues, responses and timely-response share.

`POST https://api.qelka.com/v1/cfpb/complaints`

See how many consumer complaints a bank, lender, card issuer, debt collector or credit bureau has received through the Consumer Financial Protection Bureau (CFPB): the all-time total, the count month by month over the last 12 months, the products and issues consumers complain about most, how the company closed them, and the share it answered on time. Each lookup costs 1 credit, found or not; errors and test keys are never billed.

## Request

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `company` | string | Yes | none | Company name, 2 to 200 characters. It is matched with the names the CFPB database uses, such as `WELLS FARGO & COMPANY`. |
| `fresh` | boolean | No | `false` | `true` skips the 24-hour result cache and counts again. |

One lookup sends a query to the CFPB search API for each month of the trend, plus a few more, so every snippet sets a 60-second client timeout.

```bash title="cURL"
curl https://api.qelka.com/v1/cfpb/complaints \
  --max-time 60 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"company": "Wells Fargo"}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/cfpb/complaints', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ company: 'Wells Fargo' }),
  signal: AbortSignal.timeout(60_000),
})
const result = await response.json()
console.log(result)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/cfpb/complaints",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"company": "Wells Fargo"},
    timeout=60,
)
result = response.json()
print(result)
```
```php title="PHP"
<?php
$ch = curl_init('https://api.qelka.com/v1/cfpb/complaints');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['company' => 'Wells Fargo']),
    CURLOPT_TIMEOUT => 60,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
```
```go title="Go"
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	payload, _ := json.Marshal(map[string]any{"company": "Wells Fargo"})
	request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/cfpb/complaints", bytes.NewReader(payload))
	request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
	request.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 60 * time.Second}
	response, err := client.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var result map[string]any
	if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Println(result)
}
```
```ruby title="Ruby"
require 'json'
require 'net/http'

uri = URI('https://api.qelka.com/v1/cfpb/complaints')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ company: 'Wells Fargo' })

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 60) do |http|
  http.request(request)
end
result = JSON.parse(response.body)
puts result
```

## Response

Every lookup gets a `200`, found or not. Read `status` first: `found` or `not_found`.

| Field | Type | Description |
|---|---|---|
| `id` | string | Identifier of this lookup: `lkp_` followed by 26 characters. |
| `object` | string | Always `cfpb_complaints`. |
| `input` | string | The `company` you sent, without surrounding spaces. |
| `status` | string | `found` when the matched company has at least one complaint, `not_found` otherwise. |
| `company` | string or null | The company name as the CFPB database records it. `null` when no name matched. |
| `total` | integer | Every complaint the database holds for the company. |
| `last_12_months` | integer | Complaints received in `window`. |
| `months` | array of objects | Complaints received each month of `window`, oldest first. |
| `months.month` | string | The month, `YYYY-MM`. |
| `months.complaints` | integer | Complaints received that month. |
| `months.partial` | boolean | `true` for the current month, which is not over. |
| `top_products` | array of objects | Up to 5 products consumers complained about most in `window`. |
| `top_products.name` | string | The product, as the CFPB names it, such as `Credit card`. |
| `top_products.complaints` | integer | Complaints about it in `window`. |
| `top_products.share` | number | Its share of `last_12_months`, from 0 to 1, three decimals. |
| `top_issues` | array of objects | Up to 5 most frequent issues in `window`, with the same fields. |
| `company_responses` | array of objects | Up to 5 most frequent ways the company closed the complaints in `window`, such as `Closed with explanation` or `Closed with monetary relief`, with the same fields. |
| `timely_response_share` | number or null | Share of the complaints in `window` that the CFPB marks as answered on time, from 0 to 1, four decimals. `null` when none is marked either way. |
| `window` | object | The period the recent figures cover: the last 12 calendar months, the current one included. |
| `window.from` | string | First day, `YYYY-MM-DD`. |
| `window.to` | string | Last day: today, `YYYY-MM-DD`. |
| `data_updated` | string or null | When the CFPB last updated its database, ISO 8601. |
| `other_companies` | array of strings | Other names of the database that resemble the one you sent, up to five. |
| `credits_used` | integer | Credits debited for this call: 1 with a live key, `0` with a test key. |
| `cached` | boolean | `true` when the answer came from the 24-hour cache. |

```json title="Response"
{
  "id": "lkp_01M8CFQ9KCP29ZEMZ02Q3PP5RS",
  "object": "cfpb_complaints",
  "input": "Wells Fargo",
  "status": "found",
  "company": "WELLS FARGO & COMPANY",
  "total": 179241,
  "last_12_months": 22840,
  "months": [
    { "month": "2025-12", "complaints": 2117, "partial": false },
    { "month": "2026-01", "complaints": 2251, "partial": false },
    { "month": "2026-02", "complaints": 1822, "partial": false },
    { "month": "2026-03", "complaints": 2287, "partial": false },
    { "month": "2026-04", "complaints": 2209, "partial": false },
    { "month": "2026-05", "complaints": 2025, "partial": false },
    { "month": "2026-06", "complaints": 1896, "partial": false },
    { "month": "2026-07", "complaints": 1766, "partial": false },
    { "month": "2026-08", "complaints": 1784, "partial": false },
    { "month": "2026-09", "complaints": 1749, "partial": false },
    { "month": "2026-10", "complaints": 1994, "partial": false },
    { "month": "2026-11", "complaints": 940, "partial": true }
  ],
  "top_products": [
    { "name": "Checking or savings account", "complaints": 10083, "share": 0.441 },
    { "name": "Credit card", "complaints": 3738, "share": 0.164 },
    {
      "name": "Credit reporting or other personal consumer reports",
      "complaints": 3344,
      "share": 0.146
    },
    { "name": "Debt collection", "complaints": 2034, "share": 0.089 },
    {
      "name": "Money transfer, virtual currency, or money service",
      "complaints": 1596,
      "share": 0.07
    }
  ],
  "top_issues": [
    { "name": "Managing an account", "complaints": 6027, "share": 0.264 },
    { "name": "Incorrect information on your report", "complaints": 1998, "share": 0.087 },
    {
      "name": "Problem with a lender or other company charging your account",
      "complaints": 1495,
      "share": 0.065
    },
    {
      "name": "Problem with a purchase shown on your statement",
      "complaints": 1405,
      "share": 0.062
    },
    {
      "name": "Took or threatened to take negative or legal action",
      "complaints": 1093,
      "share": 0.048
    }
  ],
  "company_responses": [
    { "name": "Closed with explanation", "complaints": 17485, "share": 0.766 },
    { "name": "Closed with non-monetary relief", "complaints": 2593, "share": 0.114 },
    { "name": "Closed with monetary relief", "complaints": 1926, "share": 0.084 },
    { "name": "In progress", "complaints": 836, "share": 0.037 }
  ],
  "timely_response_share": 0.9999,
  "window": { "from": "2025-12-01", "to": "2026-11-26" },
  "data_updated": "2026-11-26T12:00:00-05:00",
  "other_companies": [],
  "credits_used": 1,
  "cached": false
}
```

## Act on the status

| `status` | What it means | What to do |
|---|---|---|
| `found` | A company of the database matches the name and has complaints. | Check that `company` is the company you meant, then read the trend in `months` and the mix in `top_products` and `top_issues`. |
| `not_found` with `other_companies` | The name is not close enough to any name of the database. | Send one of `other_companies` as `company`. |
| `not_found` without `other_companies` | No name of the database resembles the one you sent. | Try the legal name of the company or of its parent group: the CFPB records complaints under one company name, which can be the parent, as `WELLS FARGO & COMPANY` is for Wells Fargo. |

Every status is billed 1 credit, because the lookup ran.

Test keys never call the CFPB. They know one fictional company, `SAMPLE FINANCIAL SERVICES, INC.`, found by names whose words start words of its name, such as `Sample Financial`, with fixed counts; its months and `window` follow today's date. Any other name is `not_found`.

## Read the counts with care

A complaint is what a consumer told the CFPB, not a finding against the company: the CFPB does not verify every claim, and it publishes a complaint only after the company responds or after 15 days, whichever comes first. A large company gets more complaints because it has more customers, so compare counts with the company's size, and look at the trend and the issues rather than the total alone.

## Timely responses

The CFPB sends each complaint to the company, which is expected to respond within 15 days, and marks in its database whether the response came on time. `timely_response_share` is the share of complaints received in `window` that are marked as answered on time, out of those marked either way.

## How the company is matched

The name you send goes to the CFPB company suggestion search. A suggestion with the same name, once case and punctuation are ignored, is taken; otherwise the closest one, if it is close enough. The counts then come from the CFPB search API, filtered on that exact company name: one query for the total, one for the products, issues, responses and timely flags of `window`, and one per month.

## Where the data comes from

Counts come from the [CFPB Consumer Complaint Database](https://www.consumerfinance.gov/data-research/consumer-complaints/) search API, queried at request time. The CFPB publishes the database under the CC0 public domain dedication. See the [data sources page](https://qelka.com/data-sources).

## Examples

### Look up a company with a test key

With a test key in `QELKA_API_KEY`, this request returns the fictional company, with months that follow the day you call. Called on 2026-11-26, it returned:

```bash title="cURL"
curl https://api.qelka.com/v1/cfpb/complaints \
  --max-time 60 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"company": "Sample Financial"}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/cfpb/complaints', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ company: 'Sample Financial' }),
  signal: AbortSignal.timeout(60_000),
})
const result = await response.json()
console.log(result)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/cfpb/complaints",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"company": "Sample Financial"},
    timeout=60,
)
result = response.json()
print(result)
```

```json title="Response"
{
  "id": "lkp_01M8CGA9X6TF0R5M8BQH2ZD7JW",
  "object": "cfpb_complaints",
  "input": "Sample Financial",
  "status": "found",
  "company": "SAMPLE FINANCIAL SERVICES, INC.",
  "total": 3120,
  "last_12_months": 540,
  "months": [
    { "month": "2025-12", "complaints": 46, "partial": false },
    { "month": "2026-01", "complaints": 47, "partial": false },
    { "month": "2026-02", "complaints": 41, "partial": false },
    { "month": "2026-03", "complaints": 48, "partial": false },
    { "month": "2026-04", "complaints": 42, "partial": false },
    { "month": "2026-05", "complaints": 49, "partial": false },
    { "month": "2026-06", "complaints": 43, "partial": false },
    { "month": "2026-07", "complaints": 50, "partial": false },
    { "month": "2026-08", "complaints": 44, "partial": false },
    { "month": "2026-09", "complaints": 51, "partial": false },
    { "month": "2026-10", "complaints": 45, "partial": false },
    { "month": "2026-11", "complaints": 52, "partial": true }
  ],
  "top_products": [
    { "name": "Credit card", "complaints": 260, "share": 0.481 },
    { "name": "Checking or savings account", "complaints": 180, "share": 0.333 },
    { "name": "Debt collection", "complaints": 100, "share": 0.185 }
  ],
  "top_issues": [
    { "name": "Problem with a purchase shown on your statement", "complaints": 150, "share": 0.278 },
    { "name": "Managing an account", "complaints": 120, "share": 0.222 },
    { "name": "Fees or interest", "complaints": 90, "share": 0.167 }
  ],
  "company_responses": [
    { "name": "Closed with explanation", "complaints": 470, "share": 0.87 },
    { "name": "Closed with monetary relief", "complaints": 50, "share": 0.093 },
    { "name": "In progress", "complaints": 20, "share": 0.037 }
  ],
  "timely_response_share": 0.9907,
  "window": { "from": "2025-12-01", "to": "2026-11-26" },
  "data_updated": "2026-01-01T12:00:00-05:00",
  "other_companies": [],
  "credits_used": 0,
  "cached": false
}
```

## Errors

| Status | Type | When |
|---|---|---|
| 400 | [invalid_request](https://qelka.com/docs/errors#invalid_request) | `company` missing, shorter than 2 or longer than 200 characters, a body that is not a JSON object, or a field the request table does not list |
| 401 | [invalid_api_key](https://qelka.com/docs/errors#invalid_api_key) | The key is missing, unknown or revoked |
| 402 | [insufficient_credits](https://qelka.com/docs/errors#insufficient_credits) | Your balance is less than 1 credit (live keys only) |
| 403 | [forbidden](https://qelka.com/docs/errors#forbidden) | The key is restricted to other endpoints |
| 405 | [invalid_request](https://qelka.com/docs/errors#invalid_request) | The method is not `POST` |
| 422 | [unprocessable_input](https://qelka.com/docs/errors#unprocessable_input) | The company name has no word of two letters or more |
| 429 | [rate_limited](https://qelka.com/docs/errors#rate_limited) | Too many requests: wait `Retry-After` seconds |
| 500 | [internal_error](https://qelka.com/docs/errors#internal_error) | Unexpected error on our side: retry with backoff |
| 502 | [upstream_unavailable](https://qelka.com/docs/errors#upstream_unavailable) | The CFPB API could not be reached, answered with an error or did not answer within 10 seconds: retry later |

No error is billed. A company without complaints is not an error: it is a `200` with `status: "not_found"`.

## Related

- [CFPB complaint data API](https://qelka.com/products/cfpb-complaint-data)
- Free tool: [CFPB complaints](https://qelka.com/tools/cfpb-complaints)
- [Bank lookup (FDIC)](https://qelka.com/docs/api-reference/bank) and [SEC company data](https://qelka.com/docs/api-reference/sec-company)
- [Batch](https://qelka.com/docs/api-reference/batch): up to 100 lookups in one call, each item with `type: "cfpb_complaints"`
- [Bulk](https://qelka.com/docs/api-reference/bulk): a whole file of company names with `type=cfpb_complaints`
- [Caching](https://qelka.com/docs/caching), [Errors](https://qelka.com/docs/errors), [Test mode](https://qelka.com/docs/test-mode)
