# SNB Swiss Rates Scraper (`parseforge/snb-swiss-rates-scraper`) Actor

Scrapes Swiss National Bank interest rates, bond yields, and FX rates from four statistical cubes. Returns each observation as a flat row with date, value, and cube ID.

- **URL**: https://apify.com/parseforge/snb-swiss-rates-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Integrations
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### SNB Swiss Rates Scraper

**Scrape official Swiss National Bank interest rates, bond yields, and foreign exchange rates, up to a million data points per run.** Every rate comes with its date, value, and cube identifier. No API key required. Export to CSV, JSON, Excel, or XML.

The Swiss National Bank publishes policy rates, bond yields, and daily or monthly FX rates on its data portal, but manual downloads are slow and hard to automate. This actor reads the SNB's public statistical cubes directly, filters by date range, and returns each observation in one fixed schema. It is built for analysts who need Swiss franc interest rate and exchange rate history without writing their own ETL.

| Who uses it | What they scrape Swiss National Bank for |
|---|---|
| Financial analysts | Pull the SNB policy rate history to model Swiss monetary policy decisions. |
| Forex traders | Download daily CHF exchange rates against major currencies for backtesting. |
| Economic researchers | Gather long-run Swiss government bond yields for yield curve analysis. |
| Data engineers | Feed a scheduled pipeline with the latest SNB rates without maintaining a custom connector. |

### What it does

This actor collects Swiss National Bank rates from four statistical cubes and returns each observation as a flat row with date, value, and cube identifier.

- 🏦 **Four statistical cubes:** policy rate, bond yields, daily FX, and monthly FX from the SNB data portal.
- 📅 **Date range filter:** set a start and end date to pull only the observations you need.
- 📊 **Flat row output:** each rate is one row with the date, numeric value, and cube identifier.
- ⚙️ **Configurable volume:** cap the maximum number of rates per run, from a single test row up to one million.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Swiss National Bank data

**📈 Track Swiss monetary policy.**

A macro analyst pulls the SNB policy rate cube every quarter to update a chart of Swiss interest rate decisions since 2000.

**💱 Backtest CHF trading strategies.**

A quant trader downloads daily CHF/EUR and CHF/USD rates for the last five years to run a carry-trade simulation.

**📉 Model Swiss yield curves.**

A PhD researcher collects Confederation bond yields across all available maturities to study term premia in safe-haven currencies.

**🔄 Automate a rates pipeline.**

A data engineer schedules a weekly run of the monthly FX cube and appends the rows to a corporate data warehouse.

### Why choose this scraper

|  | What you get |
|---|---|
| **Official source** | Data comes directly from the Swiss National Bank's public statistical cubes, not a third party. |
| **No API registration** | Reads the same feeds the SNB portal uses; no application, no OAuth, no rate-limit headaches. |
| **Fixed schema** | Every run returns the same columns: date, value, and cube ID, ready for your model or dashboard. |
| **Four cubes, one actor** | Switch between policy rates, bond yields, daily FX, and monthly FX with one input field. |

### How it compares

No other Store actor targets Swiss National Bank the same way, so the honest comparison is with the alternatives teams actually weigh.

| | SNB Swiss Rates Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Swiss National Bank changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the actor by selecting one of four SNB statistical cubes and an optional date range; filters run as each observation is read so only matching rates reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0085 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.85 |
| 1,000 results | $8.50 |
| 10,000 results | $85.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [SNB Swiss Rates Scraper](https://apify.com/parseforge/snb-swiss-rates-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Swiss National Bank through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/snb-swiss-rates-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your date range. If dateFrom is after the last available observation, or dateTo is before the first, the cube will return nothing. Try widening the range or removing the date filters.

**The run returns fewer rows than my maxItems setting.**

This is normal. The SNB cube only contains as many observations as exist for your selected date range. The actor stops when it runs out of data, not when it hits maxItems.

**I see an error about the cube ID.**

Make sure you selected one of the four listed cubes in the input. Typing a custom value that is not in the dropdown will cause the run to fail.

**The date format is wrong in my output.**

The actor returns dates as provided by the SNB feed. If you need a specific format, use a post-processing step in your pipeline or a simple formula in Excel after export.

**Can I get intraday FX rates?**

No. The SNB cubes this actor reads contain daily and monthly frequencies only. Intraday or tick data is not available through this source.

### FAQ

| Question | Answer |
|---|---|
| Which rates can I scrape with this actor? | You can scrape the SNB policy rate, Swiss Confederation bond yields, daily foreign exchange rates, and monthly foreign exchange rates. Select the cube you want with the Cube ID input. |
| Do I need an API key from the Swiss National Bank? | No. The actor reads the same public data feeds that power the SNB data portal. No registration or API key is required. |
| How far back does the data go? | The start date depends on the cube. Policy rate data goes back decades, while daily FX typically starts later. Set a dateFrom to pull only the period you need. |
| What format does the output come in? | You can export your dataset to CSV, JSON, Excel, or XML from the Apify platform. Each row contains the date, the rate value, and the cube identifier. |
| Can I get both daily and monthly FX rates in one run? | No. Each run targets one cube at a time. To collect both daily and monthly FX, run the actor twice with different Cube ID selections. |
| What currencies are included in the FX cubes? | The SNB publishes rates for major currencies such as EUR, USD, GBP, and JPY, among others. The actor returns whatever the selected cube contains for your date range. |
| Is the data updated when the SNB publishes new rates? | Yes. The actor reads the live SNB data feed each time it runs, so you always get the latest published observation. |
| Can I limit how many rows the actor returns? | Yes. Set the Maximum rates input to cap the number of observations per run, from 1 up to 1,000,000. |
| Does this actor handle Swiss average mortgage rates? | No. The four available cubes cover the policy rate, bond yields, daily FX, and monthly FX. Mortgage rates are not included in these cubes. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Swiss National Bank. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `cube` (type: `string`):

SNB cube ID.

## `dateFrom` (type: `string`):

YYYY-MM-DD.

## `dateTo` (type: `string`):

YYYY-MM-DD.

## `maxItems` (type: `integer`):

Maximum number of exchange rates to collect per run.

## Actor input object example

```json
{
  "cube": "rendoblid",
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/snb-swiss-rates-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/snb-swiss-rates-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10
}' |
apify call parseforge/snb-swiss-rates-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/snb-swiss-rates-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aciCAdl1hVdJB7ghx/builds/h8zpkd1zZPuJ4ytUZ/openapi.json
