You need current 2-year mortgage rates you can drop into your app this week. By the end of this guide, you’ll call a real endpoint that returns 2-year fixed mortgage rate data (with providers and example payments), parse it, and ship a working integration.
What you get from the Canada Mortgage Rates API
The Canada Mortgage Rates API exposes fixed-rate mortgage listings by term. It returns structured arrays of rates with the lender/provider name and an example periodic payment. This is useful for:
- Rate comparison widgets and landing pages that must stay current.
- Pre-qualification flows where users pick a term and lender.
- Lead routing and rate-alert emails in mortgage marketplaces.
On Zyla API Hub, you use one account, one API key, and a subscription-and-quota model across thousands of APIs. For this finance use case, we’ll focus on the 2-year endpoint and also note 3-year and 5-year options from the same listing.
Getting started on Zyla API Hub
Open the API’s marketplace page and start a trial to obtain your key:
- Visit the listing: Start 7-day trial on Canada Mortgage Rates API.
- Click Subscribe or Start Free Trial (when available) and copy your API key.
- Authenticate with Authorization: Bearer YOUR_API_KEY.
Billing on Zyla is subscription + quota (not pay-per-call). Check the API page for current access options and pricing.
Endpoints you can call
All endpoints below are POST requests and, per documentation, do not require request parameters. Send only the Authorization header.
Mortgage Rates 2 Year
- Method: POST
- URL: https://zylalabs.com/api/5180/canada-mortgage-rates-api/11347/mortgage-rates-2-year
- Description: Returns a list of 2-year fixed mortgage rates with provider names and example payments.
cURL example (copy-pasteable):
curl -s -X POST "https://zylalabs.com/api/5180/canada-mortgage-rates-api/11347/mortgage-rates-2-year" \
-H "Authorization: Bearer YOUR_API_KEY"
Mortgage Rates 3 Year
- Method: POST
- URL: https://zylalabs.com/api/5180/canada-mortgage-rates-api/11348/mortgage-rates-3-year
- Description: Returns a list of 3-year fixed mortgage rates with provider names and example payments.
cURL example:
Mortgage Rates 5 Year
- Method: POST
- URL: https://zylalabs.com/api/5180/canada-mortgage-rates-api/11349/mortgage-rates-5-year
- Description: Returns a list of 5-year fixed mortgage rates with provider names and example payments.
cURL example:
Official 2-year response shape
Below is the official sample for the 2-year endpoint. Use it to shape your models and tests.
[
{
"best_2_year_fixed_mortgage_rates": [
{
"rate": "3.99%",
"provider": "Big 6 Bank",
"payment": "$2,077"
},
{
"rate": "4.09%",
"provider": "Scotiabank",
"payment": "$2,098"
},
{
"rate": "4.49%",
"provider": "CanwiseA Ratehub.ca Company",
"payment": "$2,185"
},
{
"rate": "4.49%",
"provider": "Canadian LenderRatehub.ca Exclusive",
"payment": "$2,185"
},
{
"rate": "4.59%",
"provider": "TD Bank",
"payment": "$2,207"
},
{
"rate": "4.64%",
"provider": "MCAP",
"payment": "$2,218"
},
{
"rate": "4.74%",
"provider": "First National",
"payment": "$2,240"
},
{
"rate": "4.79%",
"provider": "RBC Royal Bank",
"payment": "$2,251"
},
{
"rate": "4.84%",
"provider": "National Bank of Canada",
"payment": "$2,263"
},
{
"rate": "4.93%",
"provider": "Bank of Montreal",
"payment": "$2,283"
},
{
"rate": "5.14%",
"provider": "Alterna Savings",
"payment": "$2,330"
},
{
"rate": "5.74%",
"provider": "Meridian Credit Union",
"payment": "$2,468"
},
{
"rate": "7.54%",
"provider": "ICICI Bank Canada",
"payment": "$2,901"
},
{
"rate": "4.49%",
"provider": "CIBC",
"payment": "$2,185"
},
{
"rate": "5.14%",
"provider": "Tangerine",
"payment": "$2,330"
},
{
"rate": "5.74%",
"provider": "Simplii Financial",
"payment": "$2,468"
}
]
}
]
What to read:
- best_2_year_fixed_mortgage_rates: array of rate entries for the 2-year term.
- Each entry includes:
- rate: percentage string.
- provider: lender or institution name.
- payment: example periodic payment string, including a currency symbol and separators as shown.
Python example: fetch and display the best 2-year fixed rates
This script calls the 2-year endpoint, checks the payload, and prints a simple comparison list. It uses only the documented URL and Authorization header.
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
URL = "https://zylalabs.com/api/5180/canada-mortgage-rates-api/11347/mortgage-rates-2-year"
headers = {
"Authorization": f"Bearer {API_KEY}"
}
resp = requests.post(URL, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json()
# Defensive parsing per official sample
rates = []
if isinstance(data, list) and data:
payload = data[0]
rates = payload.get("best_2_year_fixed_mortgage_rates", [])
# Print a compact table
for item in rates:
provider = item.get("provider")
rate = item.get("rate")
payment = item.get("payment")
print(f"{provider:<30} {rate:>6} {payment:>8}")
Implementation notes that save time
- Authentication: Send Authorization: Bearer YOUR_API_KEY on every request.
- Request body: None is required for these endpoints; do not add extra params.
- Strings and formatting: rate and payment are returned as strings (e.g., "3.99%", "$2,077"). If you need numeric comparisons, strip symbols and separators before parsing.
- Currency and cadence: The payment value is presented as a formatted currency string. Use it for display or derive numbers carefully; cadence (monthly/bi-weekly) is not specified in the sample, so do not assume.
- Updates and caching: If your UI doesn’t require sub-minute freshness, cache responses server-side (e.g., for several minutes) to reduce calls and page latency.
- Pagination: Not applicable here; the response returns a single array of listings.
- Error handling: Treat non-2xx as transient or auth failures. Log the full response body for debugging and surface a user-friendly fallback in the UI.
Practical use cases
- Landing page modules: Show “Best 2-year fixed rate today” with the top line from the array, and link to a full table.
- Pre-approval flows: Let users select a 2-year option from the provider list; persist the selection and rate snapshot in your application record.
- Lead distribution: Route leads to lenders whose entries appear in the feed, attaching the displayed rate and payment strings.
- Rate alert emails: Compare today’s top 2-year rate against your stored baseline; if the percentage string decreases, trigger a notification.
Expanding beyond 2-year terms
If your journey needs side-by-side term comparisons, call the 3-year and 5-year endpoints and render adjacent tables. Since these endpoints share the same auth and no-parameter pattern, you can reuse your client code and switch only the URL.
Call this API from AI agents via MCP
You can also invoke marketplace APIs from AI coding agents using the Zyla MCP endpoint. Point your client to https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and configure a tool that posts to the desired hub URL. See the MCP page for details on wiring this into your development environment.
Why ship on Zyla API Hub
- One API key and subscription model across more than 10,000 public APIs.
- Consistent auth and request patterns simplify your backend code.
- Add more finance and payments capabilities without procurement overhead.
Explore more finance listings on Zyla API Hub whenever you need to expand your product surface.
FAQ
Does the 2-year endpoint require any parameters?
No. Per the documentation, send a POST request with only the Authorization header.
What fields should I display to users?
At a minimum: provider, rate, and payment. Keep rate and payment formatting intact if you don’t need numeric math, since they already include symbols and separators.
How often does the data update?
The documentation does not specify update frequency. Implement caching that fits your UI needs and check the endpoint periodically.
Is there a free plan?
Plans on Zyla use subscription + quota. Check the API page for current access options and pricing. You can start a 7-day trial from the item page when available.
Can I compare 2-year vs 3-year vs 5-year rates in one view?
Yes. Call the three endpoints independently and render their arrays in adjacent tables or tabs.
Ready to build your mortgage rate widget or onboarding flow? Start your integration with the 2-year endpoint today: open the Canada Mortgage Rates API listing and start the 7-day trial.