You're building a lending, treasury, or analytics workflow and need the Reserve Bank of New Zealand’s Official Cash Rate (RBNZ_OCR) in your app—updated reliably, queryable historically, with clear effective dates. By the end of this guide, you’ll fetch RBNZ_OCR live with one GET, contrast it with prior periods, compute spreads or monthly payments off the returned value, and embed a lightweight React widget that refreshes on its own.
What the RBNZ_OCR tells markets and borrowers
The RBNZ_OCR is the Reserve Bank of New Zealand’s key policy rate and the anchor for NZD funding costs. Developers, treasury teams, and quants track it to reprice floating loans, compute hedging carry, power rate-indexed products, and trigger alerts on decision days. In the Interest Rates API, RBNZ_OCR is a central_bank symbol, reported in NZD with monthly frequency.
Below is a live-style request to fetch the latest RBNZ_OCR and the official response sample you can rely on for field names, types, and interpretation.
Fetch the latest RBNZ_OCR in one GET
All endpoints use GET and an api_key query parameter. The base URL is fixed:
- Base URL: https://interestratesapi.com/api/v1/
- Authentication: api_key query parameter
- Method: GET for every endpoint
Official cURL and JSON example
curl -s "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=RBNZ_OCR"
{
"success": true,
"date": "2026-09-30",
"base": "NZD",
"rates": {
"RBNZ_OCR": 2.75
},
"dates": {
"RBNZ_OCR": "2026-09-30"
},
"currencies": {
"RBNZ_OCR": "NZD"
},
"base_filter_note": null
}
How to read it:
- rates.RBNZ_OCR is the latest Official Cash Rate as a percent per annum.
- date is the API’s evaluation date for the batch; dates.RBNZ_OCR is the effective date for this symbol.
- currencies.RBNZ_OCR shows the currency context (NZD).
Tip: use dates.RBNZ_OCR to align accruals and dashboards, since central bank decisions are not daily. The value is expressed in percent (e.g., 2.75 means 2.75% p.a.).
More /latest examples in cURL, Python, JavaScript, and PHP
These examples are ready to paste; replace YOUR_API_KEY with your key. Values in responses are illustrative unless shown in the official sample above.
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/latest",
params=dict(symbols="RBNZ_OCR", api_key="YOUR_API_KEY")
)
data = resp.json()
rate = data["rates"]["RBNZ_OCR"]
effective_date = data.get("dates", {}).get("RBNZ_OCR")
currency = data.get("currencies", {}).get("RBNZ_OCR")
print("RBNZ_OCR:", rate, "Effective:", effective_date, "Currency:", currency)
async function fetchRBNZOCR() {
const res = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=RBNZ_OCR&api_key=YOUR_API_KEY"
);
const data = await res.json();
const rate = data.rates.RBNZ_OCR;
const effDate = data.dates?.RBNZ_OCR;
return { rate, effDate };
}
fetchRBNZOCR().then(console.log);
<?php
$qs = http_build_query([
'symbols' => 'RBNZ_OCR',
'api_key' => 'YOUR_API_KEY'
]);
$url = "https://interestratesapi.com/api/v1/latest?$qs";
$json = file_get_contents($url);
$data = json_decode($json, true);
$rate = $data['rates']['RBNZ_OCR'];
$effective = $data['dates']['RBNZ_OCR'] ?? null;
echo "RBNZ_OCR: $rate% (Effective: $effective)\n";
Explore the product and endpoints: Explore Interest Rates API features and Get started with Interest Rates API. When you’re ready, Register for an API key.
Contrast today with 1 month and 1 year ago using /historical
For monthly symbols, the API returns the last available date within the month you specify. You can use this to compare the current rate with prior months and prior years for presentations, credit committee memos, or rate-indexed logic in your product.
Endpoint and example
GET /api/v1/historical requires a date in YYYY-MM-DD. The sample below shows the parameterization and a valid JSON structure (values are illustrative):
Usage patterns:
- One-month-ago comparison: choose the same day of prior month and call /historical (e.g., today minus 1 month).
- One-year-ago comparison: choose the same day last year and call /historical.
- For monthly frequency, the API will anchor to the last day with data in that month, so align your UI labels to the dates.RBNZ_OCR you receive from /latest or to your chosen historical date window.
Python snippet to print current vs prior periods
import datetime as dt
import requests
API = "https://interestratesapi.com/api/v1"
API_KEY = "YOUR_API_KEY"
SYMBOL = "RBNZ_OCR"
def get_latest():
r = requests.get(f"{API}/latest", params=dict(symbols=SYMBOL, api_key=API_KEY))
j = r.json()
return j["rates"][SYMBOL], j["dates"][SYMBOL]
def get_hist(d: str):
r = requests.get(f"{API}/historical", params=dict(date=d, symbols=SYMBOL, api_key=API_KEY))
return r.json()["rates"][SYMBOL]
latest_rate, eff_date = get_latest()
today = dt.date.today()
one_month_ago = (today.replace(day=15) - dt.timedelta(days=30)).strftime("%Y-%m-%d")
one_year_ago = today.replace(year=today.year - 1).strftime("%Y-%m-%d")
mo_rate = get_hist(one_month_ago)
yr_rate = get_hist(one_year_ago)
print(f"RBNZ_OCR now: {latest_rate}% (effective {eff_date})")
print(f"1 month ago ({one_month_ago}): {mo_rate}%")
print(f"1 year ago ({one_year_ago}): {yr_rate}%")
30-day change statistics with /fluctuation
When you need the change, percentage change, high, and low across a window, /fluctuation provides those in one call. This is useful for dashboards and compliance alerts.
Fields:
- start_value and end_value: rate at the window bounds.
- change and change_pct: absolute and percent change (percent null if start_value is 0).
- high and low: extremes inside the window.
JavaScript example computing a live 30-day change window
async function fluctuation30d() {
const today = new Date();
const end = today.toISOString().slice(0,10);
const startDate = new Date(today.getTime() - 29*24*3600*1000)
.toISOString().slice(0,10);
const url = `https://interestratesapi.com/api/v1/fluctuation?start=${startDate}&end=${end}&symbols=RBNZ_OCR&api_key=YOUR_API_KEY`;
const res = await fetch(url);
const data = await res.json();
return data.rates.RBNZ_OCR; // start_value, end_value, change, change_pct, high, low
}
Time series and OHLC for charting
For plotting or computing rolling transforms, grab a time series. The API can also compute OHLC on the fly from daily data, which is helpful even for monthly symbols if you want standardized candles by monthly or quarterly period.
/timeseries
Interpretation:
- rates.RBNZ_OCR is a date-keyed map of values. For monthly-frequency series, expect repeated values across days in a month until the next policy change date; always check frequencies.
- Use start_date and end_date in your chart axes for clarity.
/ohlc
OHLC is computed from underlying daily data in the requested period and aggregation. There is no separate persistent OHLC table; it is generated on the fly.
React widget: auto-refreshing RBNZ_OCR tile
Drop this component into your React dashboard to poll the latest rate every 60 seconds and display the value and effective date.
import React from "react";
function useRBNZOcr() {
const [state, setState] = React.useState({ rate: null, date: null, loading: true, error: null });
async function fetchNow() {
try {
const res = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=RBNZ_OCR&api_key=YOUR_API_KEY"
);
const data = await res.json();
if (!data.success) throw new Error(data.error || "API error");
setState({
rate: data.rates.RBNZ_OCR,
date: (data.dates && data.dates.RBNZ_OCR) || data.date,
loading: false,
error: null
});
} catch (e) {
setState(s => ({ ...s, loading: false, error: e.message }));
}
}
React.useEffect(() => {
fetchNow();
const id = setInterval(fetchNow, 60000);
return () => clearInterval(id);
}, []);
return state;
}
export function RbnzOcrTile() {
const { rate, date, loading, error } = useRBNZOcr();
if (loading) return <div>Loading RBNZ_OCR…</div>;
if (error) return <div>Error: {error}</div>;
return (
<div style={{ padding: 12, border: "1px solid #ccc", borderRadius: 8 }}>
<div style={{ fontSize: 12, color: "#666" }}>RBNZ_OCR (NZD, % p.a.)</div>
<div style={{ fontSize: 28, fontWeight: 600 }}>{rate}</div>
<div style={{ fontSize: 12, color: "#666" }}>Effective: {date}</div>
<a href="https://interestratesapi.com?utm_source=blog&utm_medium=article&utm_campaign=rbnz-rbnz-ocr-rate-today&utm_content=api">Try Interest Rates API</a>
</div>
);
}
Compute spreads and monthly payments from the returned value
Since rates are expressed in percent per annum, convert to a decimal and use as needed in your calculations. Two common patterns follow.
Rate spread
Given two rate values r1 and r2 from /latest (in % p.a.),
- Spread in percentage points: spread_pp = r1 − r2
- Relative spread: spread_pct = (r1 − r2) / |r2|, handle r2 = 0 safely
You can also use /api/v1/convert to compare simple loan interest costs using the latest rate for each symbol:
Monthly payment from a policy rate
For a fixed-rate amortizing loan with principal A, annual rate r% (from rates.RBNZ_OCR), and term n months, convert r to a monthly decimal i = (r / 100) / 12 and compute:
- Payment = A × i × (1 + i)^n / [(1 + i)^n − 1], assuming i > 0
- If i = 0, Payment = A / n
Remember: policy rates are reference indices; production loans may add a credit spread, fees, and compounding conventions. Capture the pure index from the API, then layer your margin logic deterministically in code.
Operational details developers ask about
- Symbol and frequency: RBNZ_OCR is a central bank policy rate with monthly frequency in this API.
- Effective dates: Use dates.RBNZ_OCR from /latest and the date parameter in /historical to align accruals and compliance snapshots.
- Business days and holidays: Central bank decisions do not occur on weekends or most holidays. For month-level series, values typically hold between policy actions—your charts should key off effective dates.
- Caching: Cache the stable response for your UI in between refresh windows (e.g., 60 seconds in dashboards). On decision days, be prepared to refresh immediately when your backend detects a new effective date.
- Error handling and rate limits: Respect error shapes: success=false plus an error string. Watch X-RateLimit-* headers to adapt polling frequency, and 429 Retry-After to back off. Common status codes include 401 (missing/invalid api_key), 403 (inactive plan), 404 (no symbols or no data), 422 (validation), 429 (quota).
- Symbol discovery: Use /symbols to confirm availability or filter by category=central_bank and base=NZD.
/symbols (discovery and metadata)
For RBNZ_OCR specifically, query with symbols=RBNZ_OCR to fetch live values, and rely on the latest endpoint for production workloads. See the MCP for architectural notes: MCP.
End-to-end examples per endpoint (cURL, Python, JS, PHP)
The following minimal calls demonstrate parameters and response handling. Values are illustrative unless they match the official block shown earlier.
/latest (RBNZ_OCR)
import requests
response = requests.get(
'https://interestratesapi.com/api/v1/latest',
params=dict(symbols='RBNZ_OCR,ECB_MRO', api_key='YOUR_API_KEY')
)
data = response.json()
const response = await fetch(
'https://interestratesapi.com/api/v1/latest?symbols=RBNZ_OCR&api_key=YOUR_API_KEY'
);
const data = await response.json();
<?php
$q = http_build_query(['symbols' => 'RBNZ_OCR', 'api_key' => 'YOUR_API_KEY']);
echo file_get_contents("https://interestratesapi.com/api/v1/latest?$q");
/historical
import requests
r = requests.get('https://interestratesapi.com/api/v1/historical',
params=dict(date='2025-06-15', symbols='RBNZ_OCR', api_key='YOUR_API_KEY'))
print(r.json())
const res = await fetch('https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=RBNZ_OCR&api_key=YOUR_API_KEY');
console.log(await res.json());
<?php
echo file_get_contents('https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=RBNZ_OCR&api_key=YOUR_API_KEY');
/fluctuation
import requests
r = requests.get('https://interestratesapi.com/api/v1/fluctuation',
params=dict(start='2025-10-30', end='2026-10-30', symbols='RBNZ_OCR', api_key='YOUR_API_KEY'))
print(r.json())
const res = await fetch('https://interestratesapi.com/api/v1/fluctuation?start=2025-10-30&end=2026-10-30&symbols=RBNZ_OCR&api_key=YOUR_API_KEY');
console.log(await res.json());
<?php
$params = http_build_query([
'start' => '2025-10-30',
'end' => '2026-10-30',
'symbols' => 'RBNZ_OCR',
'api_key' => 'YOUR_API_KEY'
]);
echo file_get_contents("https://interestratesapi.com/api/v1/fluctuation?$params");
/timeseries
import requests
r = requests.get('https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-10-30', end='2026-10-30', symbols='RBNZ_OCR', api_key='YOUR_API_KEY'))
print(r.json())
const res = await fetch('https://interestratesapi.com/api/v1/timeseries?start=2025-10-30&end=2026-10-30&symbols=RBNZ_OCR&api_key=YOUR_API_KEY');
console.log(await res.json());
<?php
$q = http_build_query(['start' => '2025-10-30', 'end' => '2026-10-30', 'symbols' => 'RBNZ_OCR', 'api_key' => 'YOUR_API_KEY']);
echo file_get_contents("https://interestratesapi.com/api/v1/timeseries?$q");
/ohlc
import requests
r = requests.get('https://interestratesapi.com/api/v1/ohlc',
params=dict(symbols='RBNZ_OCR', period='monthly', start='2025-10-30', end='2026-10-30', api_key='YOUR_API_KEY'))
print(r.json())
const res = await fetch('https://interestratesapi.com/api/v1/ohlc?symbols=RBNZ_OCR&period=monthly&start=2025-10-30&end=2026-10-30&api_key=YOUR_API_KEY');
console.log(await res.json());
<?php
$q = http_build_query(['symbols' => 'RBNZ_OCR', 'period' => 'monthly', 'start' => '2025-10-30', 'end' => '2026-10-30', 'api_key' => 'YOUR_API_KEY']);
echo file_get_contents("https://interestratesapi.com/api/v1/ohlc?$q");
/convert (optional loan interest cost comparison)
import requests
r = requests.get('https://interestratesapi.com/api/v1/convert',
params=dict(from='RBNZ_OCR', to='ECB_MRO', amount=100000, term_months=12, api_key='YOUR_API_KEY'))
print(r.json())
const res = await fetch('https://interestratesapi.com/api/v1/convert?from=RBNZ_OCR&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY');
console.log(await res.json());
<?php
$q = http_build_query(['from' => 'RBNZ_OCR', 'to' => 'ECB_MRO', 'amount' => 100000, 'term_months' => 12, 'api_key' => 'YOUR_API_KEY']);
echo file_get_contents("https://interestratesapi.com/api/v1/convert?$q");
Why developers and traders track RBNZ_OCR daily
Even though policy actions are infrequent relative to trading days, the OCR influences bank funding costs, floating mortgage resets, swap curves, and NZD risk premia. Pricing engines, treasury forecasts, and compliance systems reference this benchmark to control product repricing and monitor interest expense or income scenarios. Programmatically, the /latest endpoint plus /historical deltas give you the minimal inputs needed to adjust pricing margins or trigger hedging workflows.
Build now with the documented fields and sample responses above. Learn more at Try Interest Rates API and Get started with Interest Rates API.
FAQ
Q: What unit is RBNZ_OCR returned in?
A: Percent per annum (e.g., 2.75 means 2.75% p.a.). Convert to decimal by dividing by 100 for calculations.
Q: Which date should my UI display?
A: Prefer dates.RBNZ_OCR from /latest as the effective date. For /historical, your requested date is echoed; the API uses the last day with data in that month for monthly symbols.
Q: How often should I poll?
A: For dashboards, 30–120 seconds is typical. On policy decision days, refresh more eagerly after you detect a new effective date. Always respect 429 Retry-After and X-RateLimit-* headers.
Q: How do I detect missing or out-of-range data?
A: Check success=false with error messages and, for some 404s, a details field indicating available ranges. Validate parameters (dates, symbols) to avoid 422 errors.
Q: Can I batch multiple symbols with RBNZ_OCR?
A: Yes. /latest, /historical, /timeseries, and /fluctuation accept a comma-separated symbols parameter. Keep RBNZ_OCR alongside other benchmarks as needed.
Build your RBNZ_OCR integration today. Read the MCP notes, then get your key and ship to production: MCP • Register.