# Swiss National Bank API

> Returns SNB data cubes, SARON and money-market rates, Swiss bond yields and central bank policy rates.

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

The dimension tree of one SNB cube: the member ids that the select filter of cube and the other endpoints take.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cube` | string | yes | SNB cube id. Confirmed: snboffzisa, zirepo, zimoma, rendoblim, devkum. (e.g. rendoblim) |
| `lang` | string | no | Language of the series names: en, de, fr or it. Default en. (one of en, de, fr, it; default en) |
| `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: `cube` (string), `dimensions` (DimensionNode[]), `dimensions[].id` (string), `dimensions[].items` (DimensionNode[]), `dimensions[].name` (string)

```bash
curl "https://api.hoshime.com/v1/snb/cubeDimensions?cube=rendoblim" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snb/moneyMarket

SARON and the CHF money-market complex: the SARON term structure and the reference rates, in one answer.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `set` | string | no | Which table: saron (the SARON term structure), reference (SARON, TOMN, EGMBF, LIBOR and the non-CHF benchmarks), or all. Default all. (one of all, saron, reference; default all; e.g. saron) |
| `from` | string | no | Earliest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `to` | string | no | Latest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `select` | string | no | Dimension filter in the upstream's own syntax, such as D0(H0,H6). Narrows the answer to those members. |
| `length` | integer | no | Observations per series, newest first. Default 100, max 20000. (default 100) |
| `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: `frequency` (string), `key` (string), `name` (string), `observations` (Observation[]), `observations[].date` (string), `observations[].value` (number (double) | null), `unit` (string)

```bash
curl "https://api.hoshime.com/v1/snb/moneyMarket?set=saron" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snb/bondYields

Swiss Confederation bond yields by maturity, one series per maturity.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `maturity` | string | no | Maturities in years, comma-separated. Published: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30. Default all. (e.g. 2,10) |
| `from` | string | no | Earliest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `to` | string | no | Latest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `length` | integer | no | Observations per series, newest first. Default 200, max 20000. (default 200) |
| `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: `frequency` (string), `key` (string), `name` (string), `observations` (Observation[]), `observations[].date` (string), `observations[].value` (number (double) | null), `unit` (string)

```bash
curl "https://api.hoshime.com/v1/snb/bondYields?maturity=2%2C10" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snb/policyRates

Official policy rates of the SNB, the Fed, the ECB, the Bank of England and the Bank of Japan, from one Swiss cube.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `bank` | string | no | Central banks to return, comma-separated: snb, fed, ecb, boe, boj. Default all five. (e.g. snb,ecb) |
| `from` | string | no | Earliest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `to` | string | no | Latest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `length` | integer | no | Observations per series, newest first. Default 200, max 20000. (default 200) |
| `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: `frequency` (string), `key` (string), `name` (string), `observations` (Observation[]), `observations[].date` (string), `observations[].value` (number (double) | null), `unit` (string)

```bash
curl "https://api.hoshime.com/v1/snb/policyRates?bank=snb%2Cecb" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snb/cube

Any SNB data cube, raw: its series with dates and values, narrowed by the select filter.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cube` | string | yes | SNB cube id. Confirmed: snboffzisa, zirepo, zimoma, rendoblim, devkum. (e.g. zirepo) |
| `lang` | string | no | Language of the series names: en, de, fr or it. Default en. (one of en, de, fr, it; default en) |
| `from` | string | no | Earliest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `to` | string | no | Latest observation date, YYYY, YYYY-MM or YYYY-MM-DD. |
| `select` | string | no | Dimension filter in the upstream's own syntax, such as D0(H0,H6). Narrows the answer to those members. (e.g. D0(H0)) |
| `length` | integer | no | Observations per series, newest first. Default 200, max 20000. (default 200) |
| `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: `frequency` (string), `key` (string), `name` (string), `observations` (Observation[]), `observations[].date` (string), `observations[].value` (number (double) | null), `unit` (string)

```bash
curl "https://api.hoshime.com/v1/snb/cube?cube=zirepo&select=D0%28H0%29" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
