FAQ – The API for interest rates and exchange rates

On 27 November 2023, the Riksbank published a new REST API (Application Programming Interface) that makes it possible to automatically obtain values for interest rates and exchange rates. On this page, we have gathered some frequently asked questions about the Riksbank’s API for interest rates and exchange rates.

DISCLAIMERS and RESERVATION

Exchange rates are indicative only and are published by the Riksbank for information purposes. They should therefore not be used for transactional purposes.

The Riksbank disclaims liability for any errors or changes in values afterwards and for any interruptions in the functioning of the website and the API that may affect access to the statistics.

The Riksbank reserves the right to make updates/changes to the website and the API that may affect the downloading of statistics.

What do I need to do if I currently have an integration with the Riksbank’s old SOAP API?

The Riksbank’s old SOAP API will close on 27 May 2024. When it closes, the SOAP API will stop working and anyone who has set up an integration with the SOAP API must develop a new integration with the new REST API to continue to be able to automatically retrieve interest rates and exchange rates via API from the Riksbank.

How do I set up an integration with the new REST API?

Read more under FAQ on this page. Technical documentation for developers and the possibility of registering users can also be found in the Riksbank’s API portal.

Are there any restrictions on calling the new API?

We have a limit on the number of calls from the same IP address within a certain time span. If there is a greater need, it is possible to register on the API portal to obtain a personal API key that allows more calls.

How do I register in the API portal?

Select Sign Up in the top right corner and register your details. Once you are logged in, go to the Products tab and create a subscription. Then your API keys will be visible under the Profile tab as Primary and Secondary key. These are your API keys and you can use any of them. 

How many calls can I make after I have registered?

As a registered user in the API portal, you can call our API 200 times per minute with a ceiling of 30,000 calls per week by using the API key found under your profile (either Primary Key or Secondary Key).

How do I use the API key for calls?

You put the key in an http header called Ocp-Apim-Subscription-Key. You can also add ?subscription-key=<yourApiKey> directly in a REST call in the web browser after the call. Note that there are different keys for the test environment (developer.api-test.riksbank.se) and the production environment (developer.api.riksbank.se). You must register for each environment you want to use.

How should I use the new API?

A brief description of the terminology used may prove helpful in making the best use of the API. All interest rates and currencies are in series that are organised into groups. For example, the series SEKISKPMI (Icelandic currency) is included in GroupId 130, “Currencies against Swedish kronor”. This page, Series for the API, shows which series are available:

Each individual entry is called an observation. To retrieve an observation, specify the series from which it is to be retrieved and a date. The API can retrieve all existing groups and series. Once you know which series you are interested in, you can retrieve observations for them within given date ranges. The API also supports the retrieval of cross rates, the exchange rate between two foreign currencies calculated using rates against the Swedish krona. You can also retrieve aggregated data (week, month, quarter, year).

It is currently only possible to get one observation per series, which is a difference from the previous API.

For example, to download the latest rate for SEKNOKPMI (Norwegian krone), call:

https://api.riksbank.se/swea/v1/Observations/Latest/seknokpmi

To retrieve cross rates between USD and EUR from a certain date, for example, use:

https://api.riksbank.se/swea/v1/CrossRates/sekusdpmi/sekeurpmi/2024-01-23

All series can be retrieved using:

https://api.riksbank.se/swea/v1/Series

All groups in which the series are grouped can be retrieved using:

https://api.riksbank.se/swea/v1/Groups

How do I get inverse rates?

An observation for the US dollar, for example, shows how many SEK are required for one unit. To invert the rate, divide 1 by the value you get. This tells you how 1 SEK relates to the other currency. You can also call our help series SEKETT to handle this for you. 

What unit are the currencies presented in?

The rate for all currencies is given as 1 Swedish krona against 1 unit of the foreign currency as from 27 November 2023. (Previously, the exchange rate was quoted in Swedish kronor against 100 units of the foreign currency for certain currencies).

Why doesn’t my search show observations for all of the selected series?

If a series is excluded from the results this is probably due to that series’ period of validity lying outside of the selected time period. Check the period of validity of the series. The date in brackets after the series name shows the period during which there are observations for this series.

How many decimals do interest rate and exchange rate observations have?

In most cases, interest and exchange rate quotations are published with four decimal places, following the principle 1.2345. However, the number of decimals can vary. There may be fewer decimal places: if the last digit or digits are 0, they will not be displayed. More decimal places may also be given for some low value currencies. Numbers less than 1 are displayed with 1 to 4 significant figures, but no more than 6 decimal places, e.g. 0.000012.

Is it necessary to cite the source when disseminating statistics on interest rates and exchange rates?

Yes, you must always state that Sveriges Riksbank is the source (“Source: Sveriges Riksbank”).

The exchange rates published by the Riksbank as of 27 November 2023 are set by the ECB (European Central Bank), but converted by the Riksbank to rates against Swedish kronor. Previously, the Riksbank published exchange rates set by Nasdaq.  

If I have processed statistics on interest rates and exchange rates myself, do I still have to state the source?

No, in that case you should not state Sveriges Riksbank as the source.

May I use the API for commercial purposes?

The Riksbank’s API is freely available without charge and the data may be freely adapted and used without any particular permission or agreement being required. However, exchange rates are indicative only and are published by the Riksbank for information purposes. They should therefore not be used for transactional purposes.

Is there anything I cannot do with the API?

You may not use the API to spread malware. Nor may you present the service you have developed as an “official cooperation” or “partnership” with the Riksbank.

How do I receive notification of new versions of the API?

New versions are announced on the Riksbank’s website or in the API portal.

Questions?

For more information on the API, email: API@riksbank.se

Was this information helpful? After your answear a textbox appears

Thanks for your feedback!

Your comment could not be sent, please try again later

Updated 21/02/2024