# HMDA Mortgage Lending Analytics Scraper (`parselab/hmda-mortgage-lending-analytics-scraper`) Actor

Get mortgage lending data from HMDA: applications, approvals and denial rates by race, ethnicity, sex and loan type for any state, county or metro area, lender rankings with market share, and loan level records. Export to CSV or Excel.

- **URL**: https://apify.com/parselab/hmda-mortgage-lending-analytics-scraper.md
- **Developed by:** [ParseLab](https://apify.com/parselab) (community)
- **Categories:** Business, Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $14.63 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## HMDA Mortgage Lending Analytics Scraper

Get mortgage lending data from the Home Mortgage Disclosure Act (HMDA) for any state, county or metro area, in clean rows you can export to CSV or Excel. See how many mortgage applications were made, approved and denied, what the average loan was, how denial rates differ by race, ethnicity, sex, loan type and loan purpose, which lenders hold the market, and every single loan application record when you need it.

HMDA is the public record that most US mortgage lenders must file every year. The Consumer Financial Protection Bureau (CFPB) and the FFIEC publish it, but the raw files hold millions of rows with numeric codes. This Actor reads the published data for you, decodes the codes and adds the numbers analysts normally work out by hand: denial rates, ratios between groups, lender market share and loan to income.

### What can you do with this HMDA data scraper?

- Compare mortgage denial rates between Black, White, Asian and Hispanic applicants in a county.
- See the denial rate for FHA, VA, conventional and USDA loans in a state over several years.
- Rank the mortgage lenders in a metro area by loans originated and market share.
- Find lenders that deny far more or far fewer applications than the local market.
- Build a county by county table of applications, originations, average loan size and denial rate for a whole state.
- Track the split between purchase loans, refinancing and cash-out refinancing over time.
- Download loan level records for a county with loan amount, interest rate, loan to value, income, debt to income and denial reasons.
- Check what a specific lender did in a state with its LEI code.
- Prepare fair lending screens and community reinvestment research.

### Three ways to collect data

| Mode | One row is | Best for |
|---|---|---|
| Market summary | one place and year | market reports, fair lending screens, trends |
| Lender ranking | one lender, place and year | market share, competitor analysis |
| Loan records | one loan application | models, audits, custom analysis |

### What data do you get in the market summary?

- Place type, code and name, and the year.
- Applications, loans originated, approved but not accepted, denied, withdrawn and closed for incompleteness.
- Originated volume in dollars, average loan, denied volume, denial rate, origination rate and withdrawal rate.
- For White, Black, Asian, American Indian, Pacific Islander, two or more minority races, joint and not available applicants: loans originated, denied and the denial rate.
- The same three numbers for Hispanic and non-Hispanic applicants, and for female, male and joint applicants.
- Originated, denied and denial rate for conventional, FHA, VA and USDA loans, and for purchase, home improvement, refinance, cash-out refinance and other purposes.
- Ratios of denial rates: Black against White, Asian against White, American Indian against White, Hispanic against non-Hispanic and female against male.
- Shares of FHA, VA, conventional and USDA loans, and of purchase and refinance loans.

### What data do you get for a lender?

- Rank, lender name and LEI code.
- Applications reported, loans originated, approved but not accepted and denied.
- Originated volume, average loan and denial rate.
- Market share by number of loans and by dollar volume.
- The denial rate of the whole market and the difference between the lender and the market in percentage points.

### What data do you get for a loan record?

- Year, lender LEI, metro area, state, county and census tract.
- Action taken, loan type, loan purpose, lien status, dwelling category, occupancy, construction method and units.
- Loan amount, loan to value, interest rate, rate spread, loan term, property value, income and debt to income range.
- Loan costs, points and fees, origination charges, discount points and lender credits.
- Applicant ethnicity, race, sex and age, whether there is a co-applicant, and the automated underwriting system used.
- Denial reasons written out in words, loan to income ratio, and tract population, minority share and income compared with the metro area.

### Input example

Denial rates by county for all counties in Texas for 2023 and 2024:

```json
{
    "mode": "marketSummary",
    "states": ["TX"],
    "allCountiesOfStates": true,
    "years": ["2023", "2024"]
}
```

Top ten lenders in Wyoming for 2024:

```json
{
    "mode": "lenders",
    "states": ["WY"],
    "years": ["2024"],
    "maxItems": 10
}
```

### Output example

A real lender row:

```json
{
    "geoName": "Wyoming",
    "year": 2024,
    "rank": 1,
    "lenderName": "Rocket Mortgage, LLC",
    "originated": 952,
    "denied": 199,
    "originatedVolumeUsd": 223630000,
    "denialRatePct": 17,
    "marketSharePctByCount": 8.43,
    "marketDenialRatePct": 21.7,
    "denialRateVsMarketPp": -4.7
}
```

### How much does it cost?

You pay for each row returned, and the price per row drops with higher Apify subscription plans. Free accounts can test the Actor with up to 10 rows per run. A market summary row takes a fraction of a second, so a state with all its counties finishes in a minute or two.

### Frequently asked questions

**How is the denial rate calculated?**
Denied applications divided by originated, approved but not accepted and denied applications. Withdrawn and incomplete files are not counted, which is the usual way to measure it.

**Does a higher denial rate prove discrimination?**
No. The rates do not include credit scores, income or debt. They are a starting point for questions, not proof.

**Which years are available?**
2018 and later, as published by the CFPB. The latest year can change when lenders correct their filings.

**Why do small places show empty ratios?**
When a group has no denied applications or no White applicants, the ratio cannot be calculated and the field is null.

**Can I get every loan in the country?**
Loan records need a state, county, metro area or lender, because the full file has millions of rows. Use several runs or the market summary for large areas.

**How do I find a lender's LEI?**
Run the lenders mode for a state. Each row shows the lender name and its LEI.

### Limits

The Actor covers HMDA data only. The public file leaves out names and exact addresses, and applicants without a reported race or ethnicity appear in the not available groups. Ratios are not adjusted for credit risk. The data is public and published by the Consumer Financial Protection Bureau and the FFIEC.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000.

## `mode` (type: `string`):

Market summary gives one row per place and year with applications, approvals, denials, loan sizes and denial rates by race, ethnicity, sex, loan type and purpose. Lenders ranks the mortgage lenders of a place by loans, volume, market share and denial rate. Loan records gives one row per loan application with decoded values.

## `years` (type: `array`):

Reporting years, for example 2023 and 2024. Years from 2018 are available. Leave empty for the latest full year.

## `states` (type: `array`):

Two letter state codes such as TX or CA. Leave the places empty to get the whole country.

## `counties` (type: `array`):

Five digit county codes such as 48201 for Harris County, Texas.

## `allCountiesOfStates` (type: `boolean`):

Instead of one row per state, give one row for every county of the selected states.

## `metroAreas` (type: `array`):

Metropolitan statistical area or division codes such as 26420 for Houston.

## `leis` (type: `array`):

Keep only these lenders, written as their 20 character Legal Entity Identifier. Needed for loan records without a place.

## `lenderNameContains` (type: `string`):

Lenders mode only. Keep only lenders whose name contains this text, for example Wells Fargo.

## `minApplications` (type: `integer`):

Lenders mode only. Skip small lenders.

## `actionsTaken` (type: `array`):

Loan records only. Which outcomes to keep. Leave empty for all.

## `loanTypes` (type: `array`):

Loan records only. Leave empty for all.

## `loanPurposes` (type: `array`):

Loan records only. Leave empty for all.

## `minLoanAmount` (type: `integer`):

Loan records only.

## `maxLoanAmount` (type: `integer`):

Loan records only.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "marketSummary",
  "allCountiesOfStates": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parselab/hmda-mortgage-lending-analytics-scraper").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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parselab/hmda-mortgage-lending-analytics-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "maxItems": 10
}' |
apify call parselab/hmda-mortgage-lending-analytics-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parselab/hmda-mortgage-lending-analytics-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Icb1c04e82tXSbfH1/builds/XDxguERnPW5Z7Qt3V/openapi.json
