---
name: bank-of-canada-valet-ingestion
description: "How to get Bank of Canada Valet API data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load Bank of Canada Valet series into pandas and Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/bank-of-canada-valet
Provider: https://www.bankofcanada.ca/valet/docs
Checked against the provider's documentation: 2026-10-29

## Access
- No registration and no access key.

## Request
```bash
curl 'https://www.bankofcanada.ca/valet/observations/FXUSDCAD/json?recent=5'
```

## Format
JSON (also CSV and XML): seriesDetail plus observations, each {"d": date, "<SERIES>": {"v": value}}. Values arrive as strings.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""Bank of Canada Valet API (daily USD/CAD) -> pandas -> Parquet. No key or registration."""
import requests
import pandas as pd

SERIES = "FXUSDCAD"
r = requests.get(f"https://www.bankofcanada.ca/valet/observations/{SERIES}/json",
                 params={"start_date": "2017-01-03"}, timeout=60)
r.raise_for_status()
obs = r.json()["observations"]          # [{"d": "2026-10-28", "FXUSDCAD": {"v": "1.3925"}}, ...]
df = pd.DataFrame({"date": [o["d"] for o in obs],
                   "usd_cad": [o.get(SERIES, {}).get("v") for o in obs]})
df["date"] = pd.to_datetime(df["date"])
df["usd_cad"] = pd.to_numeric(df["usd_cad"])  # values arrive as strings
df.to_parquet("boc_fxusdcad.parquet", index=False)
print(len(df), "rows", df["date"].min().date(), "to", df["date"].max().date())
```
Run by us on 2026-10-29 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 2,451 daily rows, 2017-01-03 to 2026-10-29.

## Limits
- Rate limit: Not stated. The Bank asks you to start slow at peak times, back off on errors and cache daily data instead of calling again.

## Quirks
- The daily FX series (FXUSDCAD and others) start on 2017-01-03; older noon rates are a separate legacy series.
- Exchange rates are published once per business day, so cache them.
- The rates are indicative, for statistical and analytical use, not for executing trades.

## Terms and attribution
- Free to use, copy and distribute: attribute the Bank of Canada as the source and indicate if changes were made, without suggesting endorsement.
- Terms page: https://www.bankofcanada.ca/terms/

## Sources
- https://www.bankofcanada.ca/valet-api-how-to/: "No registration is required to use the Valet API. You do not need an access key."
- https://www.bankofcanada.ca/valet-api-how-to/: "For data that updates only once a day, such as exchange rates, store the response instead of calling the API again."
- https://www.bankofcanada.ca/terms/: "You must attribute the Bank of Canada as the source of the content, and indicate if changes were made."

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
