query_complaints: Query For Complaints

View source: R/query_complaints.R

query_complaintsR Documentation

Query For Complaints

Description

API docs: https://cfpb.github.io/api/ccdb/

Usage

query_complaints(
  search_term = NULL,
  field = NULL,
  frm = NULL,
  size = NULL,
  sort = NULL,
  format = NULL,
  no_aggs = NULL,
  no_highlight = NULL,
  company = NULL,
  company_public_response = NULL,
  company_received_max = NULL,
  company_received_min = NULL,
  company_response = NULL,
  consumer_consent_provided = NULL,
  consumer_disputed = NULL,
  date_received_max = NULL,
  date_received_min = NULL,
  has_narrative = NULL,
  issue = NULL,
  product = NULL,
  state = NULL,
  submitted_via = NULL,
  tags = NULL,
  timely = NULL,
  zip_code = NULL
)

Arguments

search_term

(string) Return results containing specific term

field

(string) If the parameter "search_term" has a value, use "field" to specify which field is searched. If not specified, "complaint_what_happened" will be searched.

frm

(integer) Return results starting from a specific index, only if format parameter is not specified, ignore otherwise

size

(integer) Limit the size of the results. Max limit is 1000

sort

(string) Return results sort in a particular order

format

(string) Format to be returned, if this parameter is not specified, frm/size parameters can be used properly, but if a format is specified for exporting, frm/size will be ignored

no_aggs

(boolean) Include aggregations in result or not, True means no aggregations will be included, False means aggregations will be included.

no_highlight

(boolean) Include highlight of search term in result or not, True means no highlighting will be included, False means highlighting will be included.

company

(string array) Filter the results to only return these companies

company_public_response

(string array) Filter the results to only return these types of public response by the company

company_received_max

(string) Return results with date < company_received_max (i.e. 2017-03-04)

company_received_min

(string) Return results with date >= company_received_min (i.e. 2017-03-04)

company_response

(string array) Filter the results to only return these types of response by the company

consumer_consent_provided

(string array) Filter the results to only return these types of consent consumer provided

consumer_disputed

(string array) Filter the results to only return the specified state of consumer disputed, i.e. yes, no

date_received_max

(string) Return results with date < date_received_max (i.e. 2017-03-04)

date_received_min

(string) Return results with date >= date_received_min (i.e. 2017-03-04)

has_narrative

(string array) Filter the results to only return the specified state of whether it has narrative in the complaint or not, i.e. yes, no

issue

(string array) Filter the results to only return these types of issue and subissue, i.e. product-only: Getting a Loan, subproduct needs to include product, separated by '•', Getting a Loan•Cant qualify for a loan

product

(string array) Filter the results to only return these types of product and subproduct, i.e. product-only: Mortgage, subproduct needs to include product, separated by '•', Mortgage•FHA mortgage

state

(string array) Filter the results to only return these states (use abbreviation, i.e. CA, VA)

submitted_via

(string array) Filter the results to only return these types of way consumers submitted their complaints

tags

(string array) Filter the results to only return these types of tag

timely

(string array) Filter the results to show whether a response was timely

zip_code

(string array) Zip Code

Value

A data frame:

tags

Data that supports easier searching and sorting of complaints submitted by or on behalf of consumers.

zip_code

string

complaint_id

string

issue

factor The issue the consumer identified in the complaint

date_received

POSIXlt The date the CFPB received the complaint

state

factor

consumer_disputed

factor Whether the consumer disputed the company’s response

product

factor The type of product the consumer identified in the complaint

has_narrative

boolean

company_response

factor

company

string The complaint is about this company

submitted_via

factor How the complaint was submitted to the CFPB

date_sent_to_company

POSIXlt The date the CFPB sent the complaint to the company

company_public_response

string The company's optional, public-facing response to a consumer's complaint

sub_product

factor The type of sub-product the consumer identified in the complaint

timely

factor Whether the company gave a timely response

complaint_what_happened

string Consumer complaint narrative is the consumer-submitted description of "what happened" from the complaint.

sub_issue

factor The sub-issue the consumer identified in the complaint

consumer_consent_provided

factor Identifies whether the consumer opted in to publish their complaint narrative.

Examples

## Not run: 
  query_complaints(size = 1)

## End(Not run)


bertcarnell/cfpb.api documentation built on June 2, 2025, 6:09 a.m.