Access Canadian Dollar (CAD) Exchange Rates in JSON Format via REST API endpoints
Accessing Canadian Dollar (CAD) exchange rates in JSON format via REST API endpoints is a dependable way to price products for Canadian customers, calculate markups in real time, reconcile invoices in ERP workflows, and backfill chart data for metal price analytics. In this guide, you will learn how to use the Metals-API to retrieve CAD-based prices for precious and industrial metals and currencies, integrate these feeds into trading and fintech applications, and handle practical concerns like units (troy ounces vs grams), base currency conventions, caching, and market closures.
Why CAD-Denominated Exchange Rates Matter for Real-Time Pricing and Analytics
If your customers pay in CAD—or your P&L is reported in CAD—you want your metal or currency calculations to be CAD-native end-to-end. Whether you’re a jewelry retailer quoting prices for 18k gold in Canadian Dollar terms, a manufacturer costing copper wire in CAD per kilogram, or a quant researcher building a multi-asset strategy referencing palladium and USD/CAD, Metals-API provides low-latency, JSON-formatted exchange rates that you can set to a Canadian base with a single parameter. That keeps pricing logic simple, reduces conversion errors, and speeds up decision-making across your stack.
How Metals-API Structures Data for CAD
By default, Metals-API returns rates relative to USD. This means the rates object expresses “units of metal per 1 USD,” and the unit field explicitly states “per troy ounce.” For CAD workflows, set your requests’ base parameter to CAD to receive “units of metal per 1 CAD,” which is often a more natural way to compute Canadian retail prices, hedges, or reports. You can query the latest, historical, intraday, time series, fluctuations, conversion, OHLC, and bid/ask prices in this same CAD-relative structure.
Before you begin, get your API key at the Metals-API Website and review the core parameter and response behavior in the Metals-API Documentation. To see exactly which symbols are supported (metals and currencies), consult the always-current Metals-API Supported Symbols.
Quick Start: Retrieve CAD-Based Latest Rates in JSON
Let’s retrieve the latest XAU (gold), XAG (silver), and XPT (platinum) rates relative to CAD. The shape of the JSON below mirrors the examples in the documentation; only the base changes to CAD and the numbers would reflect CAD-relative values.
cURL request to get latest CAD-based metal rates
curl -G "BASE_URL/latest" \
--data-urlencode "access_key=YOUR_API_KEY" \
--data-urlencode "base=CAD" \
--data-urlencode "symbols=XAU,XAG,XPT"
Notes:
- Replace
BASE_URLwith the proper API base from the documentation. - Use
base=CADto return “metal units per 1 CAD.” - Restrict
symbolsto the metals and currencies you need for performance and quota efficiency.
JavaScript fetch example: caching and basic error handling
async function getCadMetalsLatest() {
const params = new URLSearchParams({
access_key: 'YOUR_API_KEY',
base: 'CAD',
symbols: 'XAU,XAG,XPT'
});
const url = `BASE_URL/latest?${params.toString()}`;
const res = await fetch(url, { cache: 'no-store' });
if (!res.ok) {
throw new Error(`HTTP ${res.status}`);
}
const data = await res.json();
if (!data.success) {
// Handle API-level error details if provided in your plan
throw new Error('API error. Inspect response for details.');
}
// Example: compute CAD price for 10 grams of gold, given rates are "XAU per CAD"
// 1 troy ounce = 31.1034768 grams
// data.rates.XAU is oz of gold per 1 CAD
// CAD per oz = 1 / data.rates.XAU
// CAD per gram = (1 / data.rates.XAU) / 31.1034768
const xauPerCad = data.rates.XAU;
const cadPerGram = (1 / xauPerCad) / 31.1034768;
const grams = 10;
const cadForTenGrams = cadPerGram * grams;
return { data, cadForTenGrams };
}
The JSON returned follows the documented structure. For example, the following “Latest Rates” response format applies whether you set base to USD, CAD, or another supported fiat:
{
"success": true,
"timestamp": 1789392009,
"base": "USD",
"date": "2026-09-14",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}
What to use:
timestampanddate: Save for auditability and charting; the timestamp is epoch seconds.base: When using CAD workflows, set this to CAD in your request; verify the response echoes it.rates: Each symbol value is “units of that metal per 1 base unit,” and the unit is a troy ounce.unit: Always interpret results with units. Prices are per troy ounce by default unless otherwise noted.
CAD as Base Currency vs. Conversions: Which Is Better?
There are two main patterns for CAD-centric systems:
- Base-CAD approach: Request
base=CADon data retrieval. This simplifies downstream math because your rates and charts are CAD-native from the start. - USD-base approach with conversion: Fetch in USD, then convert to CAD client-side using USD/CAD. This is helpful if your core system is USD and you need multi-currency toggles.
In general, prefer base-CAD for CAD-focused apps to reduce error-prone conversions and ensure pricing remains consistent across services.
Retrieving Historical CAD Rates for Backfilling Charts and Reports
Backtesting or generating monthly statements requires stable historical data in CAD. The historical rates feature returns CAD-relative metal units per troy ounce for any specific date, allowing consistent charting and P&L calculations.
{
"success": true,
"timestamp": 1789305609,
"base": "USD",
"date": "2026-09-13",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Usage in CAD:
- Set
base=CADand a date parameter to receive “XAU per CAD,” “XAG per CAD,” etc., on that date. - Beware weekends and market holidays; metals and FX liquidity may be thinner or static. Cache and display the
datefield visibly in your UI.
Time Series in CAD: Multi-Day Windows for Analytics
The time-series feature returns a daily sequence of CAD-denominated rates across a date window. This is ideal for plotting moving averages, volatility estimates, and day-over-day changes directly in CAD terms.
{
"success": true,
"timeseries": true,
"start_date": "2026-09-07",
"end_date": "2026-09-14",
"base": "USD",
"rates": {
"2026-09-07": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-09-09": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-09-14": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
CAD tips:
- Request
base=CADalong withstart_dateandend_datefor a CAD-native series. - Normalize for missing days (weekends) in your charting logic; plot only actual dates returned in the payload.
- For quant models, persist the raw values and derived metrics (returns, ATR, rolling means) with the same precision policy.
Day-to-Day CAD Fluctuations: Quantifying Moves
To summarize day-over-day changes in CAD terms across multiple symbols, the fluctuation feature calculates absolute and percentage deltas. This simplifies alerting (e.g., notify if silver moves more than 1% in CAD) and risk dashboards.
{
"success": true,
"fluctuation": true,
"start_date": "2026-09-07",
"end_date": "2026-09-14",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
},
"XAG": {
"start_rate": 0.03825,
"end_rate": 0.03815,
"change": -0.0001,
"change_pct": -0.26
},
"XPT": {
"start_rate": 0.000915,
"end_rate": 0.000912,
"change": -3.0e-6,
"change_pct": -0.33
}
},
"unit": "per troy ounce"
}
Interpreting fields in CAD:
start_rateandend_rate: “XAU per CAD,” etc., on the given dates whenbase=CAD.changeandchange_pct: Absolute and percentage change in the same “units per CAD” frame.- Use
change_pctfor alerts to avoid scale bias across metals.
Real-Time Bid/Ask in CAD: Tight Pricing for E-Commerce and OTC
When quoting live prices to CAD buyers, spreads matter. The bid/ask feature provides current two-way CAD-relative prices for tighter customer quotes and better P&L tracking on executed orders.
{
"success": true,
"timestamp": 1789392009,
"base": "USD",
"date": "2026-09-14",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
},
"XPT": {
"bid": 0.000911,
"ask": 0.000913,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
In CAD workflows:
- Set
base=CADto receive bid/ask as “metal per CAD.” - Compute CAD per ounce by inverting bid and ask:
- CAD per oz (bid side) = 1 /
ask(you buy metal at the ask, so cost is inverse of ask). - CAD per oz (ask side) = 1 /
bid(you sell metal at the bid, so revenue is inverse of bid).
- CAD per oz (bid side) = 1 /
- Use
spreadto benchmark liquidity or to drive minimum order sizes.
Open/High/Low/Close (OHLC) in CAD: Candlesticks and Risk
CAD-based OHLC makes it easy to draw candlestick charts and compute daily ranges directly in Canadian Dollar terms, aligning analysis with your accounting currency.
{
"success": true,
"timestamp": 1789392009,
"base": "USD",
"date": "2026-09-14",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
},
"XAG": {
"open": 0.03825,
"high": 0.0383,
"low": 0.0381,
"close": 0.03815
},
"XPT": {
"open": 0.000915,
"high": 0.000918,
"low": 0.00091,
"close": 0.000912
}
},
"unit": "per troy ounce"
}
Usage notes:
- With
base=CAD,open/high/low/closeare in “metal per CAD.” - Invert values to compute “CAD per oz” for chart axes if that’s more intuitive for users.
- Store timestamps to align candles across symbols or correlate with FX (e.g., USD/CAD).
Convert in CAD: Amount-Based Queries
The conversion feature lets you express a specific amount of one asset as another. For example, convert 1000 CAD into gold ounces, or vice versa, without writing your own conversion logic.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1789392009,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
CAD-centric patterns:
- Convert 5000 CAD to XAU: set
from=CAD,to=XAU,amount=5000. Theresultreturns ounces. - Convert 2 ounces of gold to CAD: set
from=XAU,to=CAD,amount=2. Theresultreturns CAD value. - Leverage
timestampfor audit logs; pair it with your order execution ID.
Intraday in CAD: Finer Granularity for Execution-Sensitive Teams
When you need more granularity than daily, the intraday feature provides higher-frequency price points for a single symbol. If your application prices baskets in CAD, request the intraday series with base=CAD to keep your snapshots aligned with Canadian exposure.
Implementation:
- Query one symbol at a time (e.g., XAU) with
base=CAD. - Cache aggressively if you display intraday to many users; see caching guidance below.
- Use the metadata (timestamps) for correct bar alignment in charts.
Lowest/Highest and CAD: Range Analytics in One Call
The lowest/highest feature (for a given date) returns the range for that day. Range stats in CAD terms are helpful for intraday risk monitors, stop/limit recommendations, or end-of-day summaries.
Implementation tips:
- Request the endpoint for your date of interest with
base=CAD. - Derive range ratios (e.g., (high-low)/close) to compare volatility across metals in a normalized way.
Carat in CAD: Retail-Ready Gold Pricing
For jewelry and retail, carat-based pricing is essential. The carat feature provides gold rates by carat against a chosen base. For Canadian storefronts, query with base=CAD, then convert per-gram pricing from troy ounce values:
- 1 troy ounce = 31.1034768 grams
- Price per gram (CAD) = (CAD per troy ounce) / 31.1034768
- Apply purity and making charges as needed.
Historical LME in CAD: Industrial Planning and Hedging
For industrial metals, the historical LME feature unlocks analysis back to 2008 for LME symbols. Request your series in CAD to connect directly with Canadian cost models for copper, aluminum, nickel, zinc, and more. This supports forecasting, vendor negotiations, and hedge effectiveness measurement without extra currency conversion steps.
API Authentication for CAD Workflows
All requests require an API key via the access_key parameter. Keep your key secret on the server side. For client-side web apps, proxy requests through your backend to avoid exposing the key or set appropriate controls. Visit the Metals-API Documentation for step-by-step setup and feature availability based on your subscription.
Precision, Units, and CAD: Avoiding Silent Errors
- Units: Unless stated otherwise, metals are “per troy ounce.” Display this explicitly in your UI.
- Grams and kilograms: Convert using the exact factor 31.1034768 grams per troy ounce; for kg multiply grams by 1000.
- Precision: Store enough decimal places to avoid rounding drift on inversions (metal/CAD vs CAD/metal).
- CAD per ounce vs ounce per CAD: The API rates are metal per base unit; invert to obtain currency per ounce if needed.
Timestamps, Timezones, and Market Hours
timestampfields are epoch seconds; convert in your display layer.- Markets: Metals and FX have different liquidity patterns; during weekends or holidays, prices may be unchanged.
- Caching: When markets are closed, reduce request frequency and serve cached CAD responses to save quota.
Caching, Performance, and Quota Efficiency for CAD Consumers
- Layered caching: Use server-side cache with short TTLs (e.g., 10–60 seconds for intraday, longer for daily).
- Symbol scoping: Limit
symbolsto exactly what you need (e.g.,XAU,XAG,XPT,USD); CAD is yourbase, so you generally do not needCADinsymbols. - Batching: Use time-series for bulk backfills instead of multiple historical calls.
- Retry/backoff: Implement exponential backoff for transient network errors.
Error Handling and Recovery in CAD Workflows
- Check
success: Always branch logic on the boolean flag before accessingrates. - Validate
base: Confirm the responsebaseequals “CAD” when you requestbase=CAD. - Fallbacks: If the latest endpoint fails, consider using the most recent cached result with a visible “stale” indicator.
- Auditing: Persist the entire JSON payload alongside order or pricing events for traceability.
Security for Production CAD Integrations
- Key management: Store your
access_keyin a secrets manager; rotate periodically. - Network controls: Make calls from the server; for SPAs, use a backend proxy.
- Validation: Sanitize query parameters (
symbols,base, date strings) before proxying client requests. - Telemetry: Log request IDs and timestamps for incident response.
CAD Pricing Examples: From Raw Rates to Customer Quotes
- Gold ring (10 grams, 18k):
- Fetch latest XAU with
base=CAD. - CAD per ounce = inverse of XAU per CAD; then CAD per gram = CAD/oz / 31.1034768.
- Apply purity: 18k is 75% purity; multiply by 0.75.
- Add making charges, taxes, margin; round as per store policy.
- Fetch latest XAU with
- Copper wire costing:
- Use time-series with
base=CADfor XCU to compute a month-average CAD/kg. - Convert oz to kg via grams; apply scrap factor for manufacturing yield.
- Use time-series with
- Hedging dashboard:
- Fetch latest + bid/ask in CAD for XAU, XPT, XPD, and USD (if needed).
- Display CAD quotes with P&L vs average cost; color-code moves with the fluctuation feature.
Neodymium (ND) in a CAD-First, Data-Driven Future
Neodymium underpins modern technologies from EV motors to wind turbines and advanced audio. As digital transformation accelerates in metal markets, CAD-denominated neodymium analytics help Canadian manufacturers and energy firms manage costs and risk. While symbol availability is defined in the live symbols list, the broader pattern holds: consistent JSON structures, clear units, and CAD-native pricing unlock seamless integration across IoT telemetry, ERP procurement modules, and predictive analytics.
Consider the following futures-oriented practices:
- Technological innovation: Ingest intraday CAD-relative pricing into smart factory MES systems to dynamically adjust production schedules based on real-time input costs.
- Data analytics: Use time-series + fluctuation data for nd-based components to forecast margin compression risk across currency scenarios.
- Smart integration: Implement event-driven alerts (e.g., if CAD strengthens 1% against USD while neodymium-linked inputs rise) to trigger pre-approved hedging playbooks.
- Future trends: As electrification expands, tune your CAD-based procurement models to correlate rare earth movements with FX and energy inputs for robust scenario planning.
End-to-End CAD Architecture Patterns
- Backend microservice:
- Service A: Metals price fetcher with
base=CAD, caching, and retry policies. - Service B: Pricing engine converting ounces to grams, applying product rules and margins.
- Service C: Analytics service computing CAD-normalized vol, VaR, and correlations via time-series.
- Service A: Metals price fetcher with
- Data store:
- Raw store: Append-only JSON payloads for audit.
- Curated store: Normalized tables for OHLC, bid/ask, and fluctuation in CAD.
- Feature store: Derived signals (moving averages, ATR, breakout flags) indexed by symbol and date.
- Client layers:
- Admin console: Controls for symbol selection, CAD display precision, and cache TTLs.
- Public UI: Customer-facing widgets with “last updated” timestamps and unit labels.
Practical CAD Tips Developers Often Miss
- Always show units and base: “CAD per oz” or “oz per CAD,” never just numbers.
- Weekend data: Expect flat readings; cache for longer and show “Market closed” badges.
- Quant comparability: If your historical backtest uses CAD per ounce, standardize that transform across your entire pipeline.
- Precision on inversions: Avoid rounding until final display to prevent compounding errors.
Comparing Common CAD Symbols and Use Cases
| Symbol | Category | Typical CAD Use | Notes |
|---|---|---|---|
| XAU | Precious | Gold jewelry pricing; reserves; hedging | Troy ounces; often inverted to CAD/oz for display |
| XAG | Precious | Retail silver quotes; electronics BOMs | Track spreads via bid/ask for tighter quotes |
| XPT | Precious | Auto catalyst costing; PGM hedges | Use time-series in CAD for vol estimates |
| XPD | Precious | Industrial catalysts; hedging dashboards | Combine with fluctuation for alerts |
| XCU | Industrial | Wire and cable costing in ERPs | Convert to CAD/kg after oz-to-gram |
| XAL | Industrial | Packaging and aerospace BOMs | Backtest LME history, normalized to CAD |
| XNI | Industrial | Stainless steel costing in CAD | Monitor bid/ask skew during stress |
| XZN | Industrial | Galvanization inputs for construction | Use time-series for supplier negotiations |
Data Validation and Sanitization
- Whitelist symbols from the official symbol list.
- Validate
baseagainst allowed fiats (e.g., CAD) before forwarding requests. - Use strict date parsing (YYYY-MM-DD); reject or correct invalid formats early.
- Enforce maximum symbol counts per request to control latency.
Advanced Analysis: Aggregation and CAD-Normalized Metrics
- Returns:
- Compute log returns or percentage changes directly on CAD-based series for portfolio analytics.
- Volatility:
- Use rolling standard deviation or ATR on inverted CAD/oz to align with end-user perception.
- Cross-asset correlation:
- Correlate CAD-based XAU with CAD equities or FX exposures to test hedging efficacy.
- Signal engineering:
- Combine fluctuation deltas with intraday directionality for alerting and execution heuristics.
Common Pitfalls with CAD Integrations
- Forgetting to set
base=CAD, then inverting twice (introducing errors). - Mixing “per oz” and “per gram” without consistent labeling.
- Assuming weekend data updates at weekday cadence.
- Not persisting
timestamp, which hinders reconciliation and auditing.
Troubleshooting Guide
- Empty or partial rates:
- Confirm symbols are valid and available for your plan in the symbols catalog.
- Reduce symbol count to isolate issues.
- Unexpected currency values:
- Verify the
basereturned equals CAD; if not, check your request query and plan features. - Ensure no client-side inversion is applied twice.
- Verify the
- Latency spikes:
- Introduce caching and short TTLs; batch historical requests via time-series.
- Use connection pooling and keep-alive on the server side.
- Precision drift:
- Perform calculations in high precision and round only for final display.
Compliance, Audit, and Documentation
- Retain the full JSON payload (including
timestamp,base, andunit) per priced transaction. - Document your conversion logic (oz to grams, purity factors) in code and wikis.
- Tag datasets with source and access metadata for reproducibility.
Linking Out: Additional References
- Metals-API Website – Get your free API key and explore product capabilities.
- Metals-API Documentation – Full parameter and endpoint behavior.
- Metals-API Supported Symbols – Up-to-date list of available metals and currencies.
- Bank of Canada Exchange Rate Resources – Useful for macro context and CAD analysis.
- London Metal Exchange (LME) – Market structure information for industrial metals.
- BIS Statistics – Broader markets context for cross-asset research.
Visual Branding
Putting It All Together
For CAD-native applications, Metals-API streamlines real-time pricing, analytics, and reporting by letting you declare base=CAD across the latest, historical, time-series, bid/ask, OHLC, fluctuation, convert, carat, intraday, and historical LME features. Always keep units clear (troy ounces), use precise conversions for grams and kilograms, and log timestamps for robust audits. Cache tactically, validate inputs against the official symbols list, and invert rates only when you truly need “CAD per ounce” for display or quotes. Ready to build? Visit the Metals-API Website to get your free API key and start integrating CAD-denominated metals and currency data into your stack today.
FAQ
Can I receive all responses directly in CAD?
Yes. Set base=CAD on your requests. The returned rates will then express “metal units per CAD,” along with timestamps and units.
How do I display CAD per ounce if the API gives me ounces per CAD?
Invert the value: CAD per ounce = 1 / (ounces per CAD). Apply the same logic for bid/ask: invert ask for the CAD buy price per ounce, invert bid for the CAD sell price per ounce.
What about grams and kilograms?
1 troy ounce equals 31.1034768 grams. CAD per gram = (CAD per ounce) / 31.1034768. CAD per kilogram = CAD per gram × 1000.
How should I handle weekends and holidays?
Expect limited or no updates. Use cached responses with a “market closed” badge and display the date and/or timestamp so users understand staleness.
How do I get bid/ask in CAD?
Request bid/ask with base=CAD. The response will contain bid and ask in “metal per CAD.” Invert to show CAD per ounce on each side.
Can I backfill my charts and reports in CAD?
Yes. Use historical and time-series with base=CAD to keep your analytics consistently CAD-denominated across past periods.
Where can I see which symbols are available?
Check the Metals-API Supported Symbols page for the latest list of metals and currencies.
How do I start?
Get your API key at the Metals-API Website, then follow the Metals-API Documentation to make your first CAD-based request.