# Mortgage Rates API - US, UK, Canada, Eurozone Official Data (`martin10291/mortgage-rates-api`) Actor

No API key. Official mortgage rates for 25 markets in one call: US 30-year and 15-year fixed (Freddie Mac PMMS weekly since 1971), Canada 1/3/5-year conventional and prime (Bank of Canada), UK 2/3/5/10-year fixed, 95% LTV and variable (Bank of England), and the cost of borrowing for house purchase i

- **URL**: https://apify.com/martin10291/mortgage-rates-api.md
- **Developed by:** [Martin Petrov](https://apify.com/martin10291) (community)
- **Categories:** Developer tools, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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

## Mortgage Rates API - US, UK, Canada, Eurozone Official Data

**No API key. Problem:** your mortgage calculator, proptech app, personal-finance dashboard or AI agent needs today's mortgage rate, and every country publishes it differently: Freddie Mac posts a weekly CSV, the Bank of Canada a JSON feed, the Bank of England a database export with its own series codes, the ECB an SDMX cube with 21 countries and four fixation periods. Most "mortgage rate" APIs cover one country or scrape lender sites.

**This API:** one JSON call for 25 markets from the official publishers, with history and change fields ready to show.

- **United States:** 30-year and 15-year fixed (Freddie Mac PMMS, weekly since 1971), 5/1 ARM history (ended 2022).
- **Canada:** 1-, 3- and 5-year conventional mortgage + prime rate (Bank of Canada, weekly since 1990).
- **United Kingdom:** 2-, 3-, 5- and 10-year fixed (75% LTV), 2-year fixed at 95% LTV, 2-year variable, lifetime tracker, Bank Rate (Bank of England, monthly since 1995).
- **Euro area + 21 countries** (AT BE BG CY DE EE ES FI FR GR HR IE IT LT LU LV MT NL PT SI SK): cost of borrowing for house purchase, all fixation periods and split into floating/up to 1 year, 1-5 years, 5-10 years, over 10 years (ECB MFI interest rate statistics, monthly since 2003).
- **Every row:** `rate`, `date`, `previousRate`, `change`, `rate1yAgo`, `change1y`, `active`, `source`, `sourceUrl`, `attribution`.
- **Modes:** `latest`, `history` (native, monthly or yearly), `compare` (one headline rate per country, cheapest first), `countries` (coverage and date ranges).

### Example (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/martin10291~mortgage-rates-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "latest", "country": ["US", "GB", "DE"]}'
```

Output row (measured 2026-11-14):

```json
{"country": "US", "countryName": "United States", "product": "30y-fixed", "productName": "30-year fixed rate mortgage",
 "rate": 7.11, "unit": "percent", "date": "2026-11-12", "frequency": "weekly",
 "previousRate": 7.18, "previousDate": "2026-11-05", "change": -0.07, "rate1yAgo": 6.22, "change1y": 0.89,
 "active": true, "source": "Freddie Mac PMMS", "sourceUrl": "https://www.freddiemac.com/pmms",
 "attribution": "Freddie Mac, Primary Mortgage Market Survey (PMMS)", "stale": false}
```

More inputs:

- `{"mode": "compare"}` -> 25 rows, cheapest first (2026-09: Malta 1.93%, Spain 2.99%, Germany 4.09%, UK 2y fixed 5.39%, Canada 5y 6.19%, US 30y 7.11%).
- `{"mode": "history", "country": ["US"], "product": ["30y-fixed"], "startDate": "2008-01", "frequency": "monthly"}`
- `{"mode": "latest", "country": ["Germany", "France", "Italy"], "product": ["over-10y-fixed", "1-5y-fixed"]}`
- `{"mode": "countries"}` -> what is covered, first and last date per product.

### Use from agents (MCP)

Add the Apify MCP server (`https://mcp.apify.com?tools=martin10291/mortgage-rates-api`) to Claude, Cursor or any MCP client and ask: "What is the average 30-year mortgage rate in the US this week, and how does Germany compare?".

### Schedule it

Set `onlyNew: true` and a `monitorId`, schedule the actor weekly (Friday): each run returns only the rates published since the last run (new Freddie Mac / Bank of Canada week, new UK / ECB month).

### Input

| Field | Meaning |
|---|---|
| `mode` | latest (default), history, compare, countries |
| `country` | ISO codes (US, CA, GB, DE, ...), UK / EA / full names work; empty = all |
| `product` | optional filter (30y-fixed, 5y-fixed, 2y-fixed, all-fixation, over-10y-fixed, ...) |
| `startDate`, `endDate` | history range, YYYY-MM-DD or YYYY-MM |
| `frequency` | native, monthly, yearly (history) |
| `sort` | country, rate, rate_desc, change (latest) |
| `limit` | max rows, default 1000 |
| `onlyNew`, `monitorId` | only new publications per watch |

### Honest limits

- These are official survey/statistical averages, not a quote from a lender. US = Freddie Mac weekly survey average; UK = quoted rates of UK lenders; euro countries = average rate on new loans (ECB, published about 5 weeks after the month).
- Values are exactly as published (percent). Series that ended (US 5/1 ARM 2022, UK tracker 2025, Malta over-10y 2021) are kept for history and marked `active: false`.
- Freddie Mac and the Bank of Canada publish weekly, the Bank of England and the ECB monthly; there is no daily data.
- Sources and terms: Freddie Mac ("information may be used with proper attribution"), Bank of Canada, Bank of England, European Central Bank. Each row carries the attribution; keep it when you display the data. Not affiliated with any of these institutions.

### FAQ

- **How fresh is the data?** The cache refreshes every 6 hours. US rates update every Thursday (Freddie Mac), Canada weekly (Wednesday), UK at the start of each month for the previous month, euro countries about 5 weeks after month end (ECB).
- **What if a source is down?** You get the last good copy and `stale: true` on the affected rows; the call does not fail. Only if a needed source has never loaded do you get `upstream error: ...`.
- **Errors:** invalid input returns a clear message with the valid values, for example `invalid input: GB has no 30y-fixed; available: 2y-fixed, 3y-fixed, 5y-fixed, ...`. Failed runs are not charged.
- **Why are euro rates lower than US 30-year rates?** They measure different loans: the US figure is a 30-year fixed survey average, the euro figure is the average rate on all new house-purchase loans (many with short fixation). Use `product` to compare like with like (e.g. `over-10y-fixed`).

# Actor input Schema

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

latest = newest rate of every country/product with previous value, change and 1-year change; history = past observations of the chosen countries (needs Country); compare = one headline rate per country sorted cheapest first (US 30-year fixed, Canada 5-year, UK 2-year fixed, euro countries all fixation periods, or the Product you pick); countries = what is covered, since when, from which source.

## `country` (type: `array`):

ISO country codes, for example US, GB, CA, DE, FR, ES, IT, NL. UK, EA (euro area = U2) and full names like Germany also work. Empty = all 25 (latest/compare). Required for history.

## `product` (type: `array`):

Optional filter: 30y-fixed, 15y-fixed, 5-1-arm, 1y-fixed, 2y-fixed, 3y-fixed, 5y-fixed, 10y-fixed, 2y-fixed-95ltv, 2y-variable, tracker, all-fixation, floating-1y, 1-5y-fixed, 5-10y-fixed, over-10y-fixed, prime-rate, policy-rate. US: 30y-fixed, 15y-fixed, 5-1-arm (ended 2022). Canada: 1y/3y/5y-fixed, prime-rate. UK: 2y/3y/5y/10y-fixed, 2y-fixed-95ltv, 2y-variable, tracker, policy-rate (Bank Rate). Euro countries: all-fixation, floating-1y, 1-5y-fixed, 5-10y-fixed, over-10y-fixed. Empty = every product.

## `startDate` (type: `string`):

For history: first date, YYYY-MM-DD or YYYY-MM. Default = full history.

## `endDate` (type: `string`):

For history: last date, YYYY-MM-DD or YYYY-MM. Default today.

## `frequency` (type: `string`):

For history: native (weekly for US/Canada, monthly for UK/euro), monthly or yearly (last observation of each period).

## `sort` (type: `string`):

For latest: country (default), rate (cheapest first), rate_desc, change (biggest fall first).

## `limit` (type: `integer`):

Maximum rows returned for history (newest kept). Between 1 and 20000.

## `onlyNew` (type: `boolean`):

Return only rates published after the last run with this Monitor ID (per country and product). Schedule it weekly to get each new Freddie Mac / Bank of Canada week and each new UK / ECB month once.

## `monitorId` (type: `string`):

Name of the watch for only-new mode, for example my-calculator. Each Monitor ID keeps its own last dates.

## Actor input object example

```json
{
  "mode": "latest",
  "country": [
    "US",
    "GB",
    "CA",
    "DE"
  ],
  "frequency": "native",
  "sort": "country",
  "limit": 1000,
  "onlyNew": false,
  "monitorId": "default"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per country, product and date: rate in percent, date, frequency, previous rate and change, rate 1 year ago and 1-year change, active flag, source, source URL and attribution. Countries mode: one row per country with its products and date range.

# 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 = {
    "mode": "latest",
    "country": [
        "US",
        "GB",
        "CA",
        "DE"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/mortgage-rates-api").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 = {
    "mode": "latest",
    "country": [
        "US",
        "GB",
        "CA",
        "DE",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("martin10291/mortgage-rates-api").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 '{
  "mode": "latest",
  "country": [
    "US",
    "GB",
    "CA",
    "DE"
  ]
}' |
apify call martin10291/mortgage-rates-api --silent --output-dataset

```

## MCP server setup

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

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/9fKslSoRNILWEFmjc/builds/w9hIqHpPheshsl3H0/openapi.json
