# HMDA Mortgage Data (`straightforward_hydra/hmda-mortgage-data`) Actor

Loan-level US mortgage records from the CFPB's public HMDA data — amounts, rates, lender, geography, outcome. No key.

- **URL**: https://apify.com/straightforward\_hydra/hmda-mortgage-data.md
- **Developed by:** [Dev D](https://apify.com/straightforward_hydra) (community)
- **Categories:** Lead generation, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 loans

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 🏦

**Loan-level US mortgage records from the CFPB's public HMDA data — straight from the government API. No API key, no proxy.**

The Home Mortgage Disclosure Act (HMDA) makes nearly every US mortgage application public. This actor pulls those **loan-level records** — amounts, interest rates, lender, geography, outcome (approved/denied), property value, and applicant attributes — with the HMDA numeric codes **decoded into readable labels**.

Perfect for **real-estate & lending analytics, fintech/mortgage market research, fair-lending & compliance analysis, and economic research**.

> Uses the CFPB HMDA Data Browser — public government data, no key. Filter by year, state/county, outcome, loan type and purpose.

***

### Features

- ✅ **No API key, no proxy** — official CFPB HMDA endpoint.
- ✅ **Loan-level** — every reported application, not just aggregates.
- ✅ **Decoded** — action, loan type, purpose, occupancy turned into labels.
- ✅ **Lender + geography** — LEI, state, county FIPS, census tract.
- ✅ **Rich fields** — amount, rate, rate spread, term, property value, income, demographics.
- ✅ **Filters** — year, state/county, action taken, loan type & purpose.

***

### Input

| Field | Description |
|---|---|
| **Years** | HMDA years (2018 onward), e.g. `["2023"]`. |
| **States** | Two-letter codes, e.g. `["CA", "TX"]`. |
| **Counties (FIPS)** | 5-digit FIPS, e.g. `["06037"]` (Los Angeles). |
| **Actions taken** | 1=Originated, 3=Denied, … (see below). |
| **Loan types** | 1=Conventional, 2=FHA, 3=VA, 4=USDA/RHS. |
| **Loan purposes** | 1=Purchase, 31=Refi, 32=Cash-out refi, 2=Improvement. |
| **Max results** | Cap (a state-year can hold millions). |

> A state or county filter is required (with a year) — a nationwide unfiltered pull is far too large.

#### Example — LA County home-purchase originations, 2023

```json
{
  "years": ["2023"],
  "counties": ["06037"],
  "actionsTaken": ["1"],
  "loanPurposes": ["1"],
  "maxResults": 50000
}
```

#### Example — denied applications in Texas

```json
{
  "years": ["2023"],
  "states": ["TX"],
  "actionsTaken": ["3"]
}
```

### Output

```json
{
  "activity_year": 2023,
  "lei": "B4TYDEB6GKMZO031MB27",
  "state": "CA",
  "county_fips": "06037",
  "census_tract": "06037...",
  "action_taken": "Loan originated",
  "loan_type": "Conventional",
  "loan_purpose": "Home purchase",
  "occupancy": "Principal residence",
  "loan_amount": 805000,
  "property_value": 1375000,
  "interest_rate": 5.75,
  "rate_spread": 0.35,
  "loan_term_months": 360,
  "applicant_income": 421000,
  "applicant_race": "White",
  "applicant_sex": "Joint",
  "applicant_age": "45-54"
}
```

### Run it on a schedule

HMDA publishes annually (with quarterly updates for large filers) — refresh your dataset when new data drops, then pipe to a warehouse or BI tool.

### Notes & limitations

- Source: **CFPB HMDA** public data. Loan amounts and property values are disclosed as **midpoints/ranges** per HMDA privacy rules; income is reported in thousands (converted to dollars here).
- Applicant demographics are self-reported and often "Not Available."
- Requires a year + a state/county filter (nationwide is too large to stream).
- Public regulatory data — no personal identifiers (no names/addresses), only geography to census-tract level.

***

#### Keywords

HMDA, mortgage data, CFPB, home loans, lending, mortgage rates, real estate finance, loan originations, denials, fair lending, redlining analysis, LEI, lender data, refinancing, FHA, conventional loans, housing finance, fintech, credit, mortgage market.

# Actor input Schema

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

HMDA years to pull, e.g. \["2023", "2022"]. Data is available from 2018.

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

Two-letter state codes, e.g. \["CA", "TX"]. At least one state or county is required.

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

5-digit county FIPS codes, e.g. \["06037"] (Los Angeles). Alternative to states.

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

Filter by outcome code: 1=Originated, 2=Approved not accepted, 3=Denied, 4=Withdrawn, 5=Closed incomplete, 6=Purchased, 7=Preapproval denied, 8=Preapproval approved not accepted.

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

1=Conventional, 2=FHA, 3=VA, 4=USDA/RHS.

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

1=Home purchase, 2=Home improvement, 31=Refinancing, 32=Cash-out refi, 4=Other.

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

Maximum number of loan records to return (a state-year can hold millions).

## Actor input object example

```json
{
  "years": [
    "2023"
  ],
  "maxResults": 10000
}
```

# 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 = {
    "years": [
        "2023"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("straightforward_hydra/hmda-mortgage-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 = { "years": ["2023"] }

# Run the Actor and wait for it to finish
run = client.actor("straightforward_hydra/hmda-mortgage-data").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 '{
  "years": [
    "2023"
  ]
}' |
apify call straightforward_hydra/hmda-mortgage-data --silent --output-dataset

```

## MCP server setup

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

```

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/CdedhrDgPYzEjnla4/builds/stE26QNBWaPzmZZjw/openapi.json
