# Bank of Canada API

> Returns Bank of Canada series observations, descriptions and history, daily exchange rates, and series groups.

Category: Finance & Crypto. Region: CA. 9 endpoints at `https://api.hoshime.com/v1/bankofcanada/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/bankofcanada
## GET /v1/bankofcanada/observations

Observations of one Bank of Canada series, the most recent ones, oldest first.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `series` | string | yes | Series name, such as FXUSDCAD. (e.g. FXUSDCAD) |
| `recent` | integer | no | Number of most recent observations, from 1 to 1000. (default 10; e.g. 5) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `items` (Observation[]), `items[].date` (string), `items[].value` (number (double)), `label` (string), `series` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/observations?series=FXUSDCAD&recent=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/fxRates

The latest daily exchange rates the Bank of Canada publishes, in Canadian dollars.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `items` (FXRate[]), `items[].label` (string), `items[].series` (string), `items[].value` (number (double))

```bash
curl "https://api.hoshime.com/v1/bankofcanada/fxRates" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/series

The description of one Bank of Canada series: its label, frequency and unit.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `series` | string | yes | Series name, such as FXUSDCAD. (e.g. FXUSDCAD) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `frequency` (string), `label` (string), `name` (string), `unit` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/series?series=FXUSDCAD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/history

Observations of one Bank of Canada series between two days, oldest first.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `series` | string | yes | Series name, such as FXUSDCAD. (e.g. FXUSDCAD) |
| `start` | string | yes | First day in YYYY-MM-DD form. (e.g. 2024-01-02) |
| `end` | string | no | Last day in YYYY-MM-DD form. Omit it for the latest day. (e.g. 2024-01-04) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `items` (Observation[]), `items[].date` (string), `items[].value` (number (double)), `label` (string), `series` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/history?series=FXUSDCAD&start=2024-01-02&end=2024-01-04" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/seriesBatch

The most recent observations of up to ten Bank of Canada series in one call, oldest first.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `series` | string | yes | Comma-separated series names, such as FXUSDCAD,FXEURCAD. At most ten. (e.g. FXUSDCAD,FXEURCAD) |
| `recent` | integer | no | Number of most recent observations per series, from 1 to 1000. (default 5; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `items` (Observation[]), `items[].date` (string), `items[].value` (number (double)), `label` (string), `series` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/seriesBatch?series=FXUSDCAD%2CFXEURCAD&recent=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/group

A Bank of Canada series group: its label, description and the series it holds.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `group` | string | yes | Group name, such as FX_RATES_DAILY. (e.g. FX_RATES_DAILY) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `label` (string), `name` (string), `series` (Series[]), `series[].label` (string), `series[].name` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/group?group=FX_RATES_DAILY" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/groupRecent

The most recent days of a Bank of Canada series group, with the value of each series per day, oldest first.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `group` | string | yes | Group name, such as FX_RATES_DAILY. (e.g. FX_RATES_DAILY) |
| `recent` | integer | no | Number of most recent days, from 1 to 1000. (default 5; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `group` (string), `items` (GroupDay[]), `items[].date` (string), `items[].values` (map)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/groupRecent?group=FX_RATES_DAILY&recent=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/searchSeries

Bank of Canada series whose name, label or description contains every word of a query, such as exchange rate or inflation, with cursor paging.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to find in a series name, label or description, such as inflation CPI. (e.g. exchange rate) |
| `limit` | integer | no | Items per page, 1 to 100. (default 20; e.g. 3) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `label` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/searchSeries?query=exchange+rate&limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bankofcanada/searchGroups

Bank of Canada series groups whose name, label or description contains every word of a query, such as mortgage or treasury bills, with cursor paging.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to find in a group name, label or description, such as mortgage. (e.g. mortgage) |
| `limit` | integer | no | Items per page, 1 to 100. (default 20; e.g. 3) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `label` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/bankofcanada/searchGroups?query=mortgage&limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
