SNB Historical Data API: Timeseries, Charts & Downloads

SNB Historical Data API: Timeseries, Charts & Downloads

Introduction

In the world of finance, accurate and timely interest rate data is crucial for making informed decisions. Developers building fintech applications, economists, quantitative analysts, and financial data engineers require reliable access to historical and real-time interest rate data. The SNB Historical Data API from Interest Rates API provides a comprehensive solution for retrieving Swiss National Bank (SNB) policy rates, interbank rates, and other financial time series data. This blog post will explore the capabilities of the SNB Historical Data API, focusing on its endpoints, practical use cases, and implementation strategies.

Understanding the SNB Policy Rate

The SNB policy rate is a critical indicator of the monetary policy stance of the Swiss National Bank. It influences borrowing costs, savings rates, and overall economic activity in Switzerland. Accessing this data through the SNB Historical Data API allows developers to integrate real-time and historical interest rate information into their applications, enabling better financial analysis and decision-making.

Key Features of the SNB Historical Data API

The SNB Historical Data API offers several endpoints that allow users to retrieve various types of interest rate data. Below, we will discuss each endpoint in detail, including its purpose, response structure, and practical use cases.

1. Retrieve Available Symbols

The first step in using the SNB Historical Data API is to retrieve the available symbols for interest rates. This can be done using the /api/v1/symbols endpoint.

Endpoint: GET /api/v1/symbols

cURL Example:

curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=CHF&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "SNB_POLICY_RATE",
"name": "Swiss National Bank Policy Rate",
"category": "central_bank",
"country_code": "CH",
"currency_code": "CHF",
"frequency": "monthly",
"description": "The interest rate set by the Swiss National Bank."
}
]
}

This endpoint provides a list of available symbols, including the SNB policy rate, which is essential for further data retrieval.

2. Fetch Latest Interest Rates

The /api/v1/latest endpoint allows users to retrieve the most recent values for specified symbols, including the SNB policy rate.

Endpoint: GET /api/v1/latest

cURL Example:

curl "https://interestratesapi.com/api/v1/latest?symbols=SNB_POLICY_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"date": "2026-05-27",
"base": "CHF",
"rates": {
"SNB_POLICY_RATE": 5.33
},
"dates": {
"SNB_POLICY_RATE": "2026-05-27"
},
"currencies": {
"SNB_POLICY_RATE": "CHF"
}
}

This endpoint is particularly useful for applications that require real-time interest rate data for financial analysis or decision-making.

3. Historical Data Retrieval

For point-in-time lookups, the /api/v1/historical endpoint allows users to fetch the SNB policy rate for a specific date.

Endpoint: GET /api/v1/historical

cURL Example:

curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=SNB_POLICY_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"date": "2025-06-15",
"base": "CHF",
"rates": {
"SNB_POLICY_RATE": 5.33
},
"currencies": {
"SNB_POLICY_RATE": "CHF"
}
}

This endpoint is essential for analyzing historical trends and making informed predictions based on past data.

4. Time Series Data

The /api/v1/timeseries endpoint enables users to retrieve a series of interest rates between two specified dates.

Endpoint: GET /api/v1/timeseries

cURL Example:

curl "https://interestratesapi.com/api/v1/timeseries?start=2025-05-01&end=2026-05-01&symbols=SNB_POLICY_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"base": "CHF",
"start_date": "2025-05-01",
"end_date": "2026-05-01",
"rates": {
"SNB_POLICY_RATE": {
"2025-05-01": 5.50,
"2025-06-01": 5.45,
"2025-07-01": 5.40
}
},
"frequencies": {
"SNB_POLICY_RATE": "monthly"
},
"currencies": {
"SNB_POLICY_RATE": "CHF"
}
}

This endpoint is particularly useful for financial analysts looking to perform time series analysis and visualize trends over time.

5. Fluctuation Analysis

The /api/v1/fluctuation endpoint provides statistics on the changes in interest rates over a specified date range.

Endpoint: GET /api/v1/fluctuation

cURL Example:

curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-05-01&end=2026-05-01&symbols=SNB_POLICY_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"rates": {
"SNB_POLICY_RATE": {
"start_date": "2025-05-01",
"end_date": "2026-05-01",
"start_value": 5.50,
"end_value": 5.33,
"change": -0.17,
"change_pct": -3.09,
"high": 5.50,
"low": 5.25
}
}
}

This endpoint is valuable for understanding the volatility of interest rates and assessing the impact of economic events on the SNB policy rate.

6. OHLC Data for Candlestick Charts

The /api/v1/ohlc endpoint provides Open-High-Low-Close (OHLC) data, which is essential for creating candlestick charts.

Endpoint: GET /api/v1/ohlc

cURL Example:

curl "https://interestratesapi.com/api/v1/ohlc?symbols=SNB_POLICY_RATE&period=monthly&start=2025-05-01&end=2026-05-01&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"period": "monthly",
"start_date": "2025-05-01",
"end_date": "2026-05-01",
"rates": {
"SNB_POLICY_RATE": [
{
"period": "2025-05",
"open": 5.50,
"high": 5.55,
"low": 5.45,
"close": 5.50,
"data_points": 30
}
]
}
}

This endpoint is particularly useful for developers looking to visualize interest rate trends using libraries like Chart.js or Plotly.

7. Loan Interest Cost Comparison

The /api/v1/convert endpoint allows users to compare the total interest cost of loans between different interest rates.

Endpoint: GET /api/v1/convert

cURL Example:

curl "https://interestratesapi.com/api/v1/convert?from=SNB_POLICY_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "SNB_POLICY_RATE",
"rate": 5.33,
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}

This endpoint is valuable for financial advisors and individuals looking to make informed decisions about loan options based on interest rate comparisons.

Building a Data Pipeline with Python

To effectively utilize the SNB Historical Data API, developers can build a data pipeline using Python. Below is a complete example of how to fetch SNB policy rates, store them in a Pandas DataFrame, and export the data to CSV or Parquet format.

import requests
import pandas as pd

# Fetch latest SNB policy rate
response = requests.get(
'https://interestratesapi.com/api/v1/latest',
params=dict(symbols='SNB_POLICY_RATE', api_key='YOUR_KEY')
)
data = response.json()

# Create a DataFrame
df = pd.DataFrame(data['rates'], index=[data['date']])

# Export to CSV
df.to_csv('snb_policy_rate.csv')

# Export to Parquet
df.to_parquet('snb_policy_rate.parquet')

This pipeline allows for easy data manipulation and storage, enabling further analysis and visualization.

Common Pitfalls in Time Series Analysis

When working with time series data, developers should be aware of several common pitfalls:

  • Missing Dates: Ensure that the data covers all required dates, especially when analyzing monthly symbols.
  • Frequency Considerations: Understand the implications of daily vs. monthly frequency on analysis and visualization.
  • Data Points Interpretation: Be cautious when interpreting the number of data points, as it may affect the reliability of trends.

Conclusion

The SNB Historical Data API from Interest Rates API provides a robust solution for accessing Swiss National Bank policy rates and other interest rate data. By leveraging its various endpoints, developers can build powerful financial applications that analyze trends, visualize data, and make informed decisions. Whether you are a developer, economist, or financial analyst, integrating this API into your workflow can significantly enhance your capabilities in financial data analysis.

For more information and to get started with the SNB Historical Data API, visit Explore Interest Rates API features and Get started with Interest Rates API.

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key

Related posts