Bank of Canada Overnight Rate API: BOC_OVERNIGHT as JSON

Bank of Canada Overnight Rate API: BOC_OVERNIGHT as JSON

You need the Bank of Canada’s overnight policy rate inside your software and you want it as clean JSON you can trust. By the end of this guide you’ll be able to call the Interest Rates API for BOC_OVERNIGHT, parse the response, cache it correctly for business days, and use it to compute spreads or plug it into loan payment formulas.

What BOC_OVERNIGHT is and when you need it

BOC_OVERNIGHT is the symbol for the Bank of Canada overnight rate delivered by Interest Rates API. It’s the short-term policy benchmark used across Canadian lending, treasury, and risk systems. Typical use cases include repricing variable-rate products, computing indexed spreads, and keeping dashboards aligned with the latest central bank stance.

The Interest Rates API returns this benchmark as JSON over HTTPS. You request the latest value by symbol. For this series, use the symbols=BOC_OVERNIGHT parameter. Authentication is via an api_key query parameter.

Plan, access, and one-symbol-per-request behavior

The Starter plan is $19/mo and includes a 7-day trial. Starter supports one symbol per request, so for BOC_OVERNIGHT you’ll pass exactly one symbol in the query. If your system needs multiple benchmarks in the same job, parallelize calls or queue them. To begin, click Register, create an account, copy your API key, and you’re ready to call the endpoint.

Endpoint and required parameters

Request the latest Bank of Canada overnight rate with:

  • HTTP method: GET
  • Endpoint: /api/v1/latest
  • Query parameters:
    • symbols=BOC_OVERNIGHT
    • api_key=YOUR_API_KEY

Do not pass base=USD if you need the CAD series for BOC_OVERNIGHT. Keep the call minimal and symbol-specific as shown below.

Quick start with curl

Copy, paste, and run this request from your terminal. Replace YOUR_API_KEY with your token from the dashboard.

curl "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=BOC_OVERNIGHT"

Understanding the JSON you get back

Below is the official live JSON sample for the latest endpoint. The print is dated 2026-08-31, not “today”. Your integration should always read and store the effective date from the payload, not assume the response time equals the benchmark’s date.

{
  "success": true,
  "date": "2026-08-31",
  "base": "CAD",
  "rates": {"BOC_OVERNIGHT": 2.25},
  "dates": {"BOC_OVERNIGHT": "2026-08-31"},
  "currencies": {"BOC_OVERNIGHT": "CAD"}
}

Key fields you will use in production typically include:

  • success: Boolean indicating if the request was processed successfully.
  • dated: The effective date for the rate (not necessarily the time you fetched it). Use this in your database as the data’s business date and in downstream valuation logic.
  • rates: An object mapping symbol codes to numeric values. For this use case, read rates.BOC_OVERNIGHT.

On first integration, log the entire response to confirm field names. You should persist both rates.BOC_OVERNIGHT and dated, as recommended in the go-live checklist below.

Go live in four steps

  1. Register for the 7-day trial: Register.
  2. Copy your api_key from the dashboard.
  3. Call GET /api/v1/latest with symbols=BOC_OVERNIGHT.
  4. Store both rates.BOC_OVERNIGHT and the dated field in your data store.

A minimal Python example

This Python snippet fetches the latest Bank of Canada overnight rate and prints the value and effective date. It performs the same request as the curl example.

import os
import requests

API_KEY = os.getenv("INTEREST_RATES_API_KEY", "YOUR_API_KEY")
BASE_URL = "https://interestratesapi.com/api/v1/latest"

params = {
    "symbols": "BOC_OVERNIGHT",
    "api_key": API_KEY
}

resp = requests.get(BASE_URL, params=params, timeout=10)
data = resp.json()

if not data.get("success", False):
    # Examine any error fields present and handle gracefully
    raise SystemExit(f"Request failed: {data}")

rates = data.get("rates", {})
boc_overnight = rates.get("BOC_OVERNIGHT")
dated = data.get("dated")

if boc_overnight is None:
    raise SystemExit("Missing BOC_OVERNIGHT in response 'rates'")

print(f"BOC_OVERNIGHT: {boc_overnight}")
print(f"Effective date: {dated}")

# Example downstream usage:
# - Persist to your DB with keys (symbol='BOC_OVERNIGHT', dated, value)
# - In formulas, treat 'boc_overnight' as a percentage; divide by 100 for decimal math

How to read and use the value

The API returns benchmark values as numeric rates. In most applications you will treat rates.BOC_OVERNIGHT as a percentage value. For arithmetic in pricing formulas (e.g., discounting, accruals, or loan payments), convert it to a decimal rate by dividing by 100 where your math expects decimals. For display, keeping it as a percentage is typical.

Always pair the rate with its dated field from the response. Never assume “today” for policy rates or overnight fixings—on weekends, holidays, or after-hours, the effective date may be different from your fetch timestamp.

Publication cadence, business days, and caching

Benchmarks like BOC_OVERNIGHT follow market calendars and may not update on weekends or public holidays. Your integration should:

  • Read dated, and cache the last-seen value keyed by that date. If a new fetch returns the same dated, you can safely continue to serve the cached value.
  • Schedule updates on business days. If your job runs daily, check for changes in dated to determine whether to propagate updates downstream.
  • Handle end-of-month, quarter-end, and holiday periods where the previous effective date persists.

Because Starter allows one symbol per request, you may parallelize calls for multiple symbols across a job queue. If you are only using BOC_OVERNIGHT, a single GET per day (or per intraday cycle) is typically enough; re-requesting within the same day will usually return the same dated value.

Computing spreads and monthly payments

Spreads: To compute a product rate from BOC_OVERNIGHT plus a margin, work in consistent units:

  • Let r_pct be rates.BOC_OVERNIGHT (percentage points).
  • Let m_pct be your margin in percentage points.
  • Product rate in percentage points = r_pct + m_pct.
  • For decimal math: r = r_pct / 100 and m = m_pct / 100. Then product rate (decimal) = r + m.

Monthly payments: For a standard amortizing loan using a rate derived from BOC_OVERNIGHT:

  • Convert the annual percentage to a decimal annual rate: r_annual = (r_pct) / 100.
  • Compute the periodic rate for monthly payments: r_month = r_annual / 12.
  • Payment formula for principal P over N months: payment = P * r_month / (1 - (1 + r_month)^{-N}).

This keeps your math general and avoids assumptions about current benchmark levels. The only requirement is to convert percentage values to decimals before using them in formulas that expect decimals.

Error handling and missing values

Production code should be robust to temporary issues:

  • Check success in the JSON. If success=false, log the whole payload and back off or retry based on your job schedule.
  • Validate rates.BOC_OVERNIGHT is present and not null. If missing, skip updating your store for that run and continue serving the last known good value paired with its dated.
  • Store both the raw payload and parsed fields on successful runs for auditing.

If your call fails authentication, verify you are sending api_key as a query parameter and that the key is correct. Avoid including unsupported parameters for this CAD series—specifically, do not pass base=USD.

Timezones, effective dates, and reproducibility

Use dated as the canonical effective date for analytics and reporting. When you persist data, store at least:

  • symbol: "BOC_OVERNIGHT"
  • dated: the effective date from the response
  • value: the numeric rate
  • fetched_at: your system timestamp (UTC)

With this model, you can reproduce any computed result later by referencing the combination of symbol and dated. If your system spans timezones, normalize fetched_at to UTC and rely on dated for the benchmark’s business day.

Testing and monitoring

Before shipping to production:

  • Write unit tests that fail fast if success is false, rates.BOC_OVERNIGHT is missing, or dated regresses unexpectedly.
  • Set up synthetic checks that call /api/v1/latest for BOC_OVERNIGHT and alert on parse errors, non-2xx statuses, or schema mismatches.
  • Record the last-seen dated and raise a low-priority alert if the value hasn’t changed after several business days (account for holidays).

Security and configuration

Keep your API key in server-side configuration (environment variables or a secure secret manager). Do not embed the key in client-side code. When calling the API from jobs or services, pass api_key in the query string as shown above. Rotate keys according to your internal policy.

MCP reference and moving to production

If your integration uses managed connectivity or platform tooling, review the MCP page for additional operational details. For production rollout, keep the go-live checklist simple: register, copy your API key, call GET /api/v1/latest with symbols=BOC_OVERNIGHT, and store both rates.BOC_OVERNIGHT and dated.

Operational tips that save time

  • Idempotency: If the dated field hasn’t changed since your last successful run, skip downstream recomputations and keep caches warm.
  • Versioning: Persist raw responses in object storage per dated to enable reprocessing without refetching.
  • Data contracts: Expose a small internal DTO containing {symbol, dated, value} so multiple services consume a stable shape.
  • Validation: Clamp obviously invalid values (e.g., negative where your domain disallows them) and route to a dead letter queue for inspection.
  • Visibility: Add diagnostics to print the first 200 bytes of the JSON on failures to speed up triage without leaking secrets.

FAQ

Is the latest value always for “today”?
No. The sample response is dated 2026-08-31. Always read and rely on the dated field, not the wall-clock fetch time.

How do I authenticate?
Pass your token in the api_key query parameter. Example: /api/v1/latest?symbols=BOC_OVERNIGHT&api_key=YOUR_API_KEY.

Can I request multiple symbols on Starter?
Starter is one symbol per request. For BOC_OVERNIGHT, pass exactly symbols=BOC_OVERNIGHT. If you need more symbols, issue additional requests.

Why am I seeing CAD values when I pass base=USD?
For this CAD series, do not pass base=USD. Omit unsupported base parameters and request the symbol directly.

What should I store?
At minimum: symbol ("BOC_OVERNIGHT"), dated from the response, and rates.BOC_OVERNIGHT. Keep your own fetched_at timestamp for auditing.

Ready to integrate BOC_OVERNIGHT and ship your feature? Start your 7-day trial and get your API key here: Register.

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key