Consumer Financial Protection Bureau (CFPB) CSV API

HMDA data as CSV downloads

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cfpb-csv-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cfpb-csv-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.0
  title: Consumer Complaint Database Aggregations CSV API
  description: The API for searching the CFPB Consumer Complaint Database, which contains over 15 million consumer financial complaint records.
  termsOfService: https://cfpb.github.io/source-code-policy/
  contact:
    name: Report API Issues
    url: https://github.com/cfpb/ccdb5-api/issues
  license:
    name: Creative Commons License CC0
    url: https://github.com/cfpb/ccdb5-api/blob/main/LICENSE
servers:
- url: https://www.consumerfinance.gov/data-research/consumer-complaints/search/api/v1/
  description: Production server
security: []
tags:
- name: CSV
  description: HMDA data as CSV downloads
paths:
  /view/nationwide/csv:
    get:
      tags:
      - CSV
      summary: Nationwide data subset as CSV
      description: Returns a CSV download of HMDA data for the entire nation filtered by the specified variables.
      parameters:
      - $ref: '#/components/parameters/years'
      - $ref: '#/components/parameters/actions_taken'
      - $ref: '#/components/parameters/construction_methods'
      - $ref: '#/components/parameters/derived_dwelling_categories'
      - $ref: '#/components/parameters/derived_loan_product_types'
      - $ref: '#/components/parameters/ethnicities'
      - $ref: '#/components/parameters/lien_statuses'
      - $ref: '#/components/parameters/loan_purposes'
      - $ref: '#/components/parameters/loan_types'
      - $ref: '#/components/parameters/races'
      - $ref: '#/components/parameters/sexes'
      responses:
        '200':
          description: CSV data response
          content:
            text/csv:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request - invalid parameters
  /view/csv:
    get:
      tags:
      - CSV
      summary: Data subset as CSV by geography or LEI
      description: Returns a CSV download of HMDA data filtered by state, county, MSA/MD, or LEI and the specified variables.
      parameters:
      - $ref: '#/components/parameters/years'
      - $ref: '#/components/parameters/states'
      - $ref: '#/components/parameters/counties'
      - $ref: '#/components/parameters/msamds'
      - $ref: '#/components/parameters/leis'
      - $ref: '#/components/parameters/actions_taken'
      - $ref: '#/components/parameters/construction_methods'
      - $ref: '#/components/parameters/derived_dwelling_categories'
      - $ref: '#/components/parameters/derived_loan_product_types'
      - $ref: '#/components/parameters/ethnicities'
      - $ref: '#/components/parameters/lien_statuses'
      - $ref: '#/components/parameters/loan_purposes'
      - $ref: '#/components/parameters/loan_types'
      - $ref: '#/components/parameters/races'
      - $ref: '#/components/parameters/sexes'
      responses:
        '200':
          description: CSV data response
          content:
            text/csv:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request - invalid parameters
components:
  parameters:
    ethnicities:
      name: ethnicities
      in: query
      description: Comma-separated list of ethnicity codes
      schema:
        type: string
    derived_loan_product_types:
      name: derived_loan_product_types
      in: query
      description: Comma-separated list of derived loan product type codes
      schema:
        type: string
    actions_taken:
      name: actions_taken
      in: query
      description: Comma-separated list of action taken codes (1-8)
      schema:
        type: string
    loan_types:
      name: loan_types
      in: query
      description: Comma-separated list of loan type codes (1=Conventional, 2=FHA, 3=VA, 4=FSA/RHS)
      schema:
        type: string
    counties:
      name: counties
      in: query
      description: Comma-separated list of 5-digit FIPS county codes
      schema:
        type: string
    states:
      name: states
      in: query
      description: Comma-separated list of two-letter state abbreviations (e.g. CA,TX)
      schema:
        type: string
    sexes:
      name: sexes
      in: query
      description: Comma-separated list of sex codes (1=Male, 2=Female, 3=Information not provided, 4=Not applicable)
      schema:
        type: string
    loan_purposes:
      name: loan_purposes
      in: query
      description: Comma-separated list of loan purpose codes (1=Home purchase, 2=Home improvement, 31=Refinancing, 32=Cash-out refinancing, 4=Other purpose, 5=Not applicable)
      schema:
        type: string
    lien_statuses:
      name: lien_statuses
      in: query
      description: Comma-separated list of lien status codes (1=First lien, 2=Subordinate lien)
      schema:
        type: string
    construction_methods:
      name: construction_methods
      in: query
      description: Comma-separated list of construction method codes (1=Site Built, 2=Manufactured)
      schema:
        type: string
    races:
      name: races
      in: query
      description: Comma-separated list of race codes
      schema:
        type: string
    years:
      name: years
      in: query
      required: true
      description: Comma-separated list of years (e.g. 2018,2019,2020)
      schema:
        type: string
        example: '2020'
    leis:
      name: leis
      in: query
      description: Comma-separated list of Legal Entity Identifiers (LEI) for financial institutions
      schema:
        type: string
    derived_dwelling_categories:
      name: derived_dwelling_categories
      in: query
      description: Comma-separated list of derived dwelling category codes
      schema:
        type: string
    msamds:
      name: msamds
      in: query
      description: Comma-separated list of 5-digit MSA/MD codes
      schema:
        type: string
externalDocs:
  description: Additional API Information
  url: https://cfpb.github.io/api/ccdb/