# HMDA Mortgage Data - Home Loan Applications by Lender (`pink_comic/hmda-mortgage-disclosure-data`) Actor

Search HMDA Home Mortgage Disclosure Act data from CFPB. Get mortgage application records by state, lender, year. Loan amounts, interest rates, denial reasons, demographics. 30M+ records. No API key needed.

- **URL**: https://apify.com/pink\_comic/hmda-mortgage-disclosure-data.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** Other
- **Stats:** 2 total users, 2 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## HMDA Mortgage Data - Home Loan Applications by Lender & State

Search the Home Mortgage Disclosure Act (HMDA) database from the Consumer Financial Protection Bureau (CFPB). Access 30+ million annual mortgage application records with loan amounts, interest rates, property values, denial reasons, and borrower demographics.

### Use Cases

- **Mortgage lenders** -- analyze competitor lending patterns by geography and product type
- **Real estate investors** -- identify lending trends and property values by census tract
- **Compliance teams** -- monitor fair lending practices and denial rate patterns
- **Market researchers** -- track mortgage origination volumes, rates, and loan sizes
- **Data journalists** -- investigate lending disparities by demographics and geography
- **Fintech companies** -- build mortgage market intelligence products

### Features

- Filter by state, county (FIPS code), year, and lender (LEI)
- Filter by action taken (originated, denied, withdrawn)
- Filter by loan type (conventional, FHA, VA, USDA) and purpose (purchase, refinance)
- Human-readable decoded values (not raw codes)
- Loan amounts, interest rates, property values, income, debt-to-income ratios
- Borrower demographics (age, ethnicity, race, sex)
- Census tract level geographic detail
- 2018-2023 data available
- No API key required

### Output Fields

Each record includes:

| Field | Description |
|-------|-------------|
| activityYear | Reporting year |
| lei | Lender Legal Entity Identifier |
| stateCode | State code |
| countyCode | FIPS county code |
| censusTract | Census tract |
| actionTaken | Action taken (originated, denied, etc.) |
| loanType | Conventional, FHA, VA, or USDA |
| loanPurpose | Purchase, refinancing, improvement, etc. |
| loanAmount | Loan amount in dollars |
| interestRate | Interest rate percentage |
| loanTerm | Loan term in months |
| propertyValue | Property value |
| loanToValueRatio | LTV ratio |
| debtToIncomeRatio | DTI ratio range |
| income | Applicant income (thousands) |
| derivedLoanProductType | Product type (e.g. "Conventional:First Lien") |
| derivedDwellingCategory | Dwelling type (e.g. "Single Family:Site-Built") |
| derivedEthnicity | Applicant ethnicity |
| derivedRace | Applicant race |
| derivedSex | Applicant sex |
| applicantAge | Applicant age range |
| occupancyType | Principal residence, second home, or investment |
| denialReason | Reason for denial (if denied) |

### Example Use

Search for all originated conventional mortgages in California for 2023:

```json
{
    "states": "CA",
    "years": "2023",
    "actionsTaken": "1",
    "loanTypes": "1",
    "maxResults": 1000
}
````

Search for denied FHA loans in Texas and Florida:

```json
{
    "states": "TX,FL",
    "years": "2023",
    "actionsTaken": "3",
    "loanTypes": "2",
    "maxResults": 500
}
```

Search a specific lender (Wells Fargo) nationwide:

```json
{
    "lei": "B4TYDEB6GKMZO031MB27",
    "years": "2023",
    "maxResults": 2000
}
```

### Data Source

Data comes from the CFPB HMDA Data Browser API, which provides public access to data reported by financial institutions under the Home Mortgage Disclosure Act. This is the same data available at [ffiec.cfpb.gov](https://ffiec.cfpb.gov/data-browser/).

# Actor input Schema

## `states` (type: `string`):

Comma-separated 2-letter state codes (e.g. "CA", "CA,NY,TX"). Leave empty for nationwide.

## `years` (type: `string`):

Comma-separated years (e.g. "2023", "2022,2023"). Available: 2018-2023.

## `lei` (type: `string`):

Legal Entity Identifier for a specific lender (e.g. "B4TYDEB6GKMZO031MB27" for Wells Fargo). Leave empty for all lenders.

## `counties` (type: `string`):

Comma-separated FIPS county codes (e.g. "06037" for Los Angeles County). Leave empty for all counties.

## `actionsTaken` (type: `string`):

Filter by action: 1=originated, 2=approved not accepted, 3=denied, 4=withdrawn, 5=incomplete, 6=purchased. Comma-separate for multiple.

## `loanTypes` (type: `string`):

Filter by loan type: 1=conventional, 2=FHA, 3=VA, 4=USDA/RHS. Comma-separate for multiple.

## `loanPurposes` (type: `string`):

Filter by purpose: 1=home purchase, 2=improvement, 31=refinancing, 32=cash-out refi, 4=other.

## `maxResults` (type: `integer`):

Maximum number of mortgage records to return.

## Actor input object example

```json
{
  "states": "CA",
  "years": "2023",
  "counties": "06075",
  "actionsTaken": "1",
  "maxResults": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "states": "CA",
    "years": "2023",
    "lei": "",
    "counties": "06075",
    "actionsTaken": "1",
    "loanTypes": "",
    "loanPurposes": "",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/hmda-mortgage-disclosure-data").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "states": "CA",
    "years": "2023",
    "lei": "",
    "counties": "06075",
    "actionsTaken": "1",
    "loanTypes": "",
    "loanPurposes": "",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/hmda-mortgage-disclosure-data").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "states": "CA",
  "years": "2023",
  "lei": "",
  "counties": "06075",
  "actionsTaken": "1",
  "loanTypes": "",
  "loanPurposes": "",
  "maxResults": 100
}' |
apify call pink_comic/hmda-mortgage-disclosure-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pink_comic/hmda-mortgage-disclosure-data",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "HMDA Mortgage Data - Home Loan Applications by Lender",
        "description": "Search HMDA Home Mortgage Disclosure Act data from CFPB. Get mortgage application records by state, lender, year. Loan amounts, interest rates, denial reasons, demographics. 30M+ records. No API key needed.",
        "version": "0.1",
        "x-build-id": "esZlsAtAH4NznLhsu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pink_comic~hmda-mortgage-disclosure-data/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pink_comic-hmda-mortgage-disclosure-data",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/pink_comic~hmda-mortgage-disclosure-data/runs": {
            "post": {
                "operationId": "runs-sync-pink_comic-hmda-mortgage-disclosure-data",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/pink_comic~hmda-mortgage-disclosure-data/run-sync": {
            "post": {
                "operationId": "run-sync-pink_comic-hmda-mortgage-disclosure-data",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "states": {
                        "title": "States",
                        "type": "string",
                        "description": "Comma-separated 2-letter state codes (e.g. \"CA\", \"CA,NY,TX\"). Leave empty for nationwide."
                    },
                    "years": {
                        "title": "Years",
                        "type": "string",
                        "description": "Comma-separated years (e.g. \"2023\", \"2022,2023\"). Available: 2018-2023.",
                        "default": "2023"
                    },
                    "lei": {
                        "title": "Lender LEI",
                        "type": "string",
                        "description": "Legal Entity Identifier for a specific lender (e.g. \"B4TYDEB6GKMZO031MB27\" for Wells Fargo). Leave empty for all lenders."
                    },
                    "counties": {
                        "title": "Counties (FIPS Codes)",
                        "type": "string",
                        "description": "Comma-separated FIPS county codes (e.g. \"06037\" for Los Angeles County). Leave empty for all counties.",
                        "default": "06075"
                    },
                    "actionsTaken": {
                        "title": "Action Taken",
                        "type": "string",
                        "description": "Filter by action: 1=originated, 2=approved not accepted, 3=denied, 4=withdrawn, 5=incomplete, 6=purchased. Comma-separate for multiple."
                    },
                    "loanTypes": {
                        "title": "Loan Types",
                        "type": "string",
                        "description": "Filter by loan type: 1=conventional, 2=FHA, 3=VA, 4=USDA/RHS. Comma-separate for multiple."
                    },
                    "loanPurposes": {
                        "title": "Loan Purposes",
                        "type": "string",
                        "description": "Filter by purpose: 1=home purchase, 2=improvement, 31=refinancing, 32=cash-out refi, 4=other."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of mortgage records to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
