# Freddie Mac API

> Freddie Mac returns 15-year and 30-year fixed mortgage rates, weekly history, and rate changes as a workflow and API.

Freddie Mac’s Get mortgage rates method returns 15-year and 30-year fixed mortgage rates for the latest survey or a chosen date. It also returns weekly history and week-over-week and year-ago changes; date ranges are optional.

- Page: https://fous.com/tools/freddie-mac
- Handle: `@freddie-mac`
- Category: [Finance](https://fous.com/tools/category/finance)
- Source website: https://freddiemac.com/pmms
- Last verified: Sep 30, 2026

## Methods

### Get mortgage rates

Operation `get_mortgage_rates`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get Freddie Mac’s U.S. 30-year and 15-year fixed mortgage rates for the latest survey or a chosen date, with weekly and year-ago changes. An optional date range adds up to 520 weekly results, newest first. The 15-year series begins in August 1991; earlier rates are unavailable. Year-ago changes compare with the survey week around 52 weeks earlier.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `date` | string | no | `"2026-09-22"` | Survey week on or before this date; defaults to the latest survey. |
| `end_date` | string | no | `"2025-10-31"` | Last date to include in weekly history; defaults to today when start_date is set. |
| `start_date` | string | no | `"2025-09-01"` | First date to include in weekly history; defaults to the earliest available survey when end_date is set. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "example": "2026-09-24",
      "description": "Survey week on or before this date; defaults to the latest survey.",
      "examples": [
        "2026-09-22",
        "1971-04-30",
        "2026-09-24"
      ]
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "example": "2025-10-31",
      "description": "Last date to include in weekly history; defaults to today when start_date is set.",
      "examples": [
        "2025-10-31",
        "1971-05-14",
        "2025-12-31"
      ]
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "example": "2025-09-01",
      "description": "First date to include in weekly history; defaults to the earliest available survey when end_date is set.",
      "examples": [
        "2025-09-01",
        "1971-04-01",
        "2010-01-01"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {},
    {
      "date": "2026-09-22",
      "end_date": "2025-10-31",
      "start_date": "2025-09-01"
    },
    {
      "date": "1971-04-30",
      "end_date": "1971-05-14",
      "start_date": "1971-04-01"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `page_url` | string | `"https://www.freddiemac.com/pmms/pmms_archives"` |  |
| `survey_date` | string | `"2026-09-24"` |  |
| `weekly_history` | array |  | Weekly survey results, newest first, within the requested date range; up to 520 weeks. Empty if no range was requested. |
| `weekly_history[].page_url` | string | `"https://www.freddiemac.com/pmms/pmms_archives"` |  |
| `weekly_history[].survey_date` | string | `"2025-10-30"` |  |
| `weekly_history[].rate_15_year_percent` | number or null | `5.41` |  |
| `weekly_history[].rate_30_year_percent` | number | `6.17` | Average fixed mortgage rate in percent (for example, 6.35 means 6.35%). |
| `rate_15_year_percent` | number or null | `6.42` |  |
| `rate_30_year_percent` | number | `7.03` | Average fixed mortgage rate in percent (for example, 6.35 means 6.35%). |
| `change_15_year_year_ago_points` | number or null | `0.93` |  |
| `change_30_year_year_ago_points` | number or null | `0.73` |  |
| `change_15_year_previous_week_points` | number or null | `0.16` |  |
| `change_30_year_previous_week_points` | number or null | `0.08` |  |

**Example input**

```json
{}
```

**Example output**

```json
{
  "page_url": "https://www.freddiemac.com/pmms/pmms_archives",
  "survey_date": "2026-09-24",
  "weekly_history": [],
  "rate_15_year_percent": 6.42,
  "rate_30_year_percent": 7.03,
  "change_15_year_year_ago_points": 0.93,
  "change_30_year_year_ago_points": 0.73,
  "change_15_year_previous_week_points": 0.16,
  "change_30_year_previous_week_points": 0.08
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@freddie-mac",
  "visibility": "public",
  "operation": "get_mortgage_rates",
  "version": 1,
  "input": {},
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@freddie-mac\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_mortgage_rates\",\n  \"version\": 1,\n  \"input\": {},\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@freddie-mac",
  "visibility": "public",
  "operation": "get_mortgage_rates",
  "version": 1,
  "input": {},
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/freddie-mac`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_mortgage_rates`: Get mortgage rates. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-freddie-mac https://api.fous.com/mcp/tools/freddie-mac --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Track weekly changes in fixed mortgage rates
- Compare 15-year and 30-year mortgage rates
- Review mortgage rates over a selected date range
- Compare current rates with rates from a year ago

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Freddie Mac tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Freddie Mac account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from freddiemac.com when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 30, 2026.

### What are the latest 15-year and 30-year mortgage rates?

Get mortgage rates returns rates for the latest survey by default.

### How have mortgage rates changed week over week?

Get mortgage rates returns the previous-week changes for both fixed-rate terms.

### What were mortgage rates during a date range?

Get mortgage rates returns weekly history when you provide a date range.

## Related

- [Bankrate API](https://fous.com/tools/bankrate.md): Bankrate provides personal finance information, national-average mortgage and refinance rates with published dates, and listed savings, CD, and money market rates that may change daily.
- [US Treasury API](https://fous.com/tools/us-treasury.md): US Treasury provides official daily interest rates and national debt figures for requested or latest available dates, plus quarterly reporting exchange rates using the latest preceding quarter when needed.
- [FRED API](https://fous.com/tools/fred.md): FRED provides public economic series, observations, latest values, sources, and popular topic searches with coverage dates and metadata; freshness varies by series.
- [Macrotrends API](https://fous.com/tools/macrotrends.md): Macrotrends provides long-term financial and economic charts, company metric histories, and yearly commodity and index prices; current-year prices may be incomplete.
- [Yahoo Finance API](https://fous.com/tools/yahoo-finance.md): Yahoo Finance provides quotes, movers, company financials, analyst ratings, earnings, news, and up to 5,000 price rows with adjusted returns; prices may be delayed.
- [MSN Money API](https://fous.com/tools/msn-money.md): MSN Money provides stock quotes, key facts, financial news, and market data, including current market movers; quotes and prices may be delayed.
- [European Central Bank API](https://fous.com/tools/european-central-bank.md): The European Central Bank provides official euro reference rates and informational currency conversions using the latest preceding published rates when needed, plus current key interest rates and optionally earlier changes.
- [Google Finance API](https://fous.com/tools/google-finance.md): Google Finance returns possibly delayed prices and figures, indexes, up to four movers timed by oldest quote, currency conversions, and up to five financial periods.
- [All Finance tools](https://fous.com/tools/category/finance)
