# Live Mortgage Rates + Housing Affordability Index (FRED) (`andrew_avina/mortgage-rate-intelligence-mcp`) Actor

Live 30yr/15yr/ARM rates from FRED. Returns monthly payment, spread over 10yr Treasury, Housing Affordability Index. Current: 30yr=6.48%, AFI=74.2. MCP-native: 'Monthly payment on $400K at current rates?' Updated weekly from Federal Reserve.

- **URL**: https://apify.com/andrew\_avina/mortgage-rate-intelligence-mcp.md
- **Developed by:** [Andrew Avina](https://apify.com/andrew_avina) (community)
- **Categories:** MCP servers, Business
- **Stats:** 1 total users, 0 monthly users, 0.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

## Mortgage Rate Intelligence MCP

**Live 30yr/15yr/ARM mortgage rates from FRED, plus affordability index, payment calculator, and historical rate context from 2020–2026.**

Returns a single comprehensive record per run with current rates, spread analysis, buyer guidance, payment scenarios across multiple purchase prices, and an affordability index comparing median income to median home price at current rates.

---

### What It Returns

| Field | Description |
|-------|-------------|
| `scenario` | Run label |
| `as_of_date` | Date of rate data (FRED weekly release) |
| `source` | "FRED API (live)" or "FRED fallback database" |
| `rate_30yr_fixed` | Current 30-year fixed mortgage rate (%) |
| `rate_15yr_fixed` | Current 15-year fixed mortgage rate (%) |
| `rate_5yr_arm` | Current 5/1 ARM initial rate (%) |
| `fed_funds_rate` | Federal Funds Rate — primary Fed policy lever (%) |
| `treasury_10yr` | 10-Year Treasury yield — benchmark for mortgage pricing (%) |
| `spread_30yr_over_10yr` | Mortgage spread over Treasuries (historically 1.5–2.5%; currently elevated) |
| `spread_30yr_over_15yr` | Premium for 30yr vs 15yr term |
| `spread_note` | Interpretation of current spread environment |
| `rate_environment` | Classification: Low / Below average / Moderate / Elevated / High |
| `buyer_guidance` | Actionable rate-environment advice for buyers |
| `refinance_note` | When refinancing makes sense |
| `affordability_index` | HAI-style index: >100 = median income can afford median home |
| `qualifying_income_needed` | Annual income required to qualify for median home at current rate |
| `median_household_income` | Current US median household income |
| `median_home_price` | Current US median home price |
| `monthly_payment_median_home` | P&I payment on median home at 20% down and current 30yr rate |
| `pct_income_housing_median_buyer` | Housing payment as % of median income |
| `market_affordable_for_median_buyer` | true/false affordability flag |
| `trend_30yr` | Rate direction: "declining" / "stable" / "rising" |
| `trend_note` | Trend magnitude and context |
| `payment_scenarios` | Array: monthly P&I + total interest for 5 purchase price tiers (or custom) |
| `rate_history` | Quarterly rate history 2020–2026 for context |

#### Payment Scenario Fields (per price tier)

| Field | Description |
|-------|-------------|
| `purchase_price` | Home price |
| `down_payment` | Down payment amount (20% default) |
| `loan_amount` | Principal |
| `monthly_pmt_30yr` | 30yr fixed monthly P&I |
| `monthly_pmt_15yr` | 15yr fixed monthly P&I |
| `monthly_pmt_5arm` | 5/1 ARM monthly P&I (initial 5yr period) |
| `total_interest_30yr` | Lifetime interest on 30yr loan |
| `total_interest_15yr` | Lifetime interest on 15yr loan |
| `interest_savings_15yr` | Interest saved by choosing 15yr over 30yr |

---

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fred_api_key` | string | No | FRED API key (DEMO_KEY used if omitted — 120 req/day) |
| `purchase_price` | number | No | Custom purchase price for payment scenarios |
| `down_payment_pct` | number | No | Down payment percentage (default: 20) |
| `loan_amount` | number | No | Override loan amount directly |
| `show_rate_history` | boolean | No | Include quarterly rate history 2020–2026 (default: true) |
| `limit` | integer | No | Reserved (single record output) |

Get a free FRED API key at [fred.stlouisfed.org/docs/api/api_key.html](https://fred.stlouisfed.org/docs/api/api_key.html).

---

### Example Inputs

**Current rates snapshot (no key needed):**
```json
{}
````

**Payment calculator for $450K home:**

```json
{
  "purchase_price": 450000,
  "down_payment_pct": 20
}
```

**With your own FRED API key (higher rate limit):**

```json
{
  "fred_api_key": "your_key_here",
  "purchase_price": 550000,
  "down_payment_pct": 10
}
```

***

### Example Output (truncated)

```json
{
  "scenario": "Current Mortgage Rate Environment",
  "as_of_date": "2026-01-10",
  "source": "FRED API (live)",
  "rate_30yr_fixed": 6.48,
  "rate_15yr_fixed": 5.71,
  "rate_5yr_arm": 5.55,
  "fed_funds_rate": 3.58,
  "treasury_10yr": 4.32,
  "spread_30yr_over_10yr": 2.16,
  "spread_note": "30yr spread of 2.16% over 10yr Treasury is near normal (<2.5%)",
  "rate_environment": "Elevated (6-7%)",
  "buyer_guidance": "Lock rate if finding good deal; refinance opportunity likely within 2-3 years",
  "affordability_index": 74.2,
  "qualifying_income_needed": 108720,
  "median_household_income": 80610,
  "monthly_payment_median_home": 2104,
  "pct_income_housing_median_buyer": 31.3,
  "market_affordable_for_median_buyer": false,
  "trend_30yr": "declining",
  "trend_note": "30yr fixed moved -0.48% over last 8 weeks; current: 6.48%",
  "payment_scenarios": [
    {
      "purchase_price": 300000,
      "down_payment": 60000,
      "loan_amount": 240000,
      "monthly_pmt_30yr": 1514,
      "monthly_pmt_15yr": 1993,
      "monthly_pmt_5arm": 1361,
      "total_interest_30yr": 305040,
      "total_interest_15yr": 118740,
      "interest_savings_15yr": 186300
    }
  ]
}
```

***

### Affordability Index Explained

The **Affordability Index** is modeled after the National Association of Realtors' Housing Affordability Index (HAI):

- **Index = 100**: Median income household qualifies exactly for the median-priced home at current rates with 20% down (using 28% front-end DTI rule)
- **Index > 100**: Median household can afford the median home (e.g., 120 = 20% above qualifying threshold)
- **Index < 100**: Median income falls short (e.g., 74 = only 74% of required income — typical 2024-2026 condition)

At 6.5% rates on a $420K median home, the monthly payment (~$2,100) consumes ~31% of the $80K median income — above the 28% threshold, meaning the market is unaffordable for the median buyer.

***

### Rate History (2020–2026)

| Period | 30yr | 15yr | 5/1 ARM | Fed Funds | Note |
|--------|------|------|---------|-----------|------|
| 2021-Q1 | 2.81% | 2.21% | 2.51% | 0.25% | Historic lows |
| 2022-Q4 | 6.90% | 6.15% | 5.68% | 3.83% | Rapid hike cycle |
| 2023-Q4 | 7.44% | 6.74% | 6.52% | 5.33% | Peak rates |
| 2024-Q4 | 6.72% | 5.96% | 5.75% | 4.58% | Easing begins |
| 2026-Q1 | 6.48% | 5.71% | 5.55% | 3.58% | Current |

***

### Data Sources

- **FRED** (Federal Reserve Bank of St. Louis) — MORTGAGE30US, MORTGAGE15US, MORTGAGE5US, DGS10, FEDFUNDS
- **Built-in fallback** — curated rate history when FRED is unavailable or rate-limited

***

### Use Cases

- **AI agent deal underwriting** — inject live rates into investment analysis workflows
- **Buyer affordability coaching** — show real payment impact at current rates by price tier
- **Rate trend tracking** — compare current environment to historical cycle
- **Refinance decision support** — assess spread and trend before advising action
- **Market timing analysis** — affordability index shows housing market stress level

***

### Related Actors in the Real Estate Suite

- **[Real Estate Investment Intelligence MCP](../real-estate-intelligence-mcp/)** — Property listings + deal scoring using live rate inputs
- **[Rentcast Rental Market Intelligence MCP](../rentcast-market-mcp/)** — LTR rent estimates and vacancy rates
- **[STR Market Intelligence MCP](../str-market-intelligence-mcp/)** — Airbnb/VRBO ADR, occupancy, and STR investment scores

## Actor input object example

```json
{}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("andrew_avina/mortgage-rate-intelligence-mcp").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("andrew_avina/mortgage-rate-intelligence-mcp").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 '{}' |
apify call andrew_avina/mortgage-rate-intelligence-mcp --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Live Mortgage Rates + Housing Affordability Index (FRED)",
        "description": "Live 30yr/15yr/ARM rates from FRED. Returns monthly payment, spread over 10yr Treasury, Housing Affordability Index. Current: 30yr=6.48%, AFI=74.2. MCP-native: 'Monthly payment on $400K at current rates?' Updated weekly from Federal Reserve.",
        "version": "0.0",
        "x-build-id": "o5IehVg7mw4ffaaQO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/andrew_avina~mortgage-rate-intelligence-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-andrew_avina-mortgage-rate-intelligence-mcp",
                "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/andrew_avina~mortgage-rate-intelligence-mcp/runs": {
            "post": {
                "operationId": "runs-sync-andrew_avina-mortgage-rate-intelligence-mcp",
                "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/andrew_avina~mortgage-rate-intelligence-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-andrew_avina-mortgage-rate-intelligence-mcp",
                "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": {}
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
