apyhub
Back
▣ RETRIEVAL KIT

Mortgage Rates by Country API

What it does

The Mortgage Rates API returns official mortgage and benchmark rates by country. Send a mode such as latest, history, compare, or countries, plus optional country, product, sort, limit, startDate, endDate, and frequency filters. You get back a JSON response with billing info, row count, and rate records.

Use latest for the newest rate, plus the previous value and yearly change when available. Use history for past rates in a date range, and set frequency to native, monthly, or yearly.

Teams use Mortgage Rates API to build mortgage comparison tools, rate charts, and market watch pages. They also use it to show one headline rate per country and to track rate moves over time.

The response can include the country name, product name, rate date, source, link, and attribution for each row.

POST
Mortgage Rates API - US, UK, Canada, Eurozone Official Data
https://api.eu.apyhub.com/martin10291/mortgage-rates-by-country

QUICKSTART

GUIDE

Quickstart

Fetch the latest mortgage rates with the default latest mode and the most common country codes.

curl -X POST "https://api.eu.apyhub.com/martin10291/mortgage-rates-by-country" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "latest",
    "country": ["US", "GB", "CA", "DE"]
  }'

What you'll get back

Returns a JSON object with billed and count integer fields, plus an items array of rate records.

  • billed: units charged for this call
  • count: number of rows in items
  • items: array of objects containing fields such as date, rate, country, product, and other rate metadata
{
  "billed": 4,
  "count": 4,
  "items": [
    {
      "date": "2024-06-01",
      "rate": 6.85,
      "country": "US",
      "product": "30y-fixed"
    }
  ]
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
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.
For latest: country (default), rate (cheapest first), rate_desc, change (biggest fall first).
Maximum rows returned for history (newest kept). Between 1 and 20000.

About this endpoint

What it does

Returns mortgage rate data for the requested mode and filters, using the request body fields defined in the schema. The response is a JSON object that includes billing and row counts plus an items array of rate records.

Request Body

ParameterTypeMandatoryDescription
modeENUMYesAllowed values: latest, history, compare, countries.
latest = newest rate of every country/product with previous value, change, and 1-year change.
history = past observations of the chosen countries (requires country).
compare = one headline rate per country sorted cheapest first.
countries = not further specified by the schema description.
sortENUMNoAllowed values: country, rate, rate_desc, change.
For latest: country (default), rate, rate_desc, change.
limitIntegerNoMaximum rows returned for history (newest kept). Default: 20.
Schema also states a minimum of 1 and a maximum of 100, and the description says "Between 1 and 20000."
countryString ArrayNoISO country codes such as US, GB, CA, DE.
UK, EA (euro area = U2), and full names like Germany also work.
Empty means all 25 for latest/compare.
Required for history.
Maximum 100 items.
endDateStringNoFor history: last date, in YYYY-MM-DD or YYYY-MM format. Default: today.
productString ArrayNoOptional filter. Allowed values include 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.
For US, supported products are 30y-fixed, 15y-fixed, 5-1-arm (ended 2022).
Maximum 100 items.
frequencyENUMNoAllowed values: native, monthly, yearly.
For history: native (weekly for US/Canada, monthly for UK/euro), monthly, or yearly (last observation of each period). Default: native.
startDateStringNoFor history: first date, in YYYY-MM-DD or YYYY-MM format. Default: full history.

Response

Returns a JSON object with billed and count integer fields and an items array of objects. Each item can include date, rate, unit, stale, active, change, source, country, product, change1y, frequency, rate1yAgo, sourceUrl, attribution, countryName, productName, previousDate, and previousRate fields as declared in the schema. The schema does not specify a response status code.

ParameterTypeMandatoryDescription
billedIntegerNoUnits charged for this call: result rows only; not-found, unavailable, and invalid rows are free.
countIntegerNoNumber of rows in items.
itemsObject ArrayNoArray of rate records. Each object may contain: date (String), rate (Number), unit (String), stale (Boolean), active (Boolean), change (Number), source (String), country (String), product (String), change1y (Number), frequency (String), rate1yAgo (Number), sourceUrl (String), attribution (String), countryName (String), productName (String), previousDate (String), previousRate (Number).
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.