Browse

Useful tips

You can find the documentation provided by the SDMX Technical Working Group here.

The SDMX Technical Working Group has published content-oriented guidelines for the SDMX 2.1 RESTful API.

If the documentation does not contain the information you require, or if you have any general comments or feedback regarding our web service, please contact us.

The SDMX Connectors project provides a set of end-user plug-ins for popular data analysis tools, and can also be used to access the ECB web service.

All sample queries in this tutorial can also be executed using command line tools such as curl or wget:

wget -O data.xml \ --header="Accept:application/vnd.sdmx.structurespecificdata+xml;version=2.1" \ https://data-api.ecb.europa.eu/service/data/EXR/M.NOK.EUR.SP00.A
curl -k -o data.xml \ --header "Accept:application/vnd.sdmx.structurespecificdata+xml;version=2.1" \ https://data-api.ecb.europa.eu/service/data/EXR/M.NOK.EUR.SP00.A

Python example:

import requests

# URL of the time series
url = "https://data-api.ecb.europa.eu/service/data/EXR/M.NOK.EUR.SP00.A"

# Headers to store the content negotiation setting for the format of the output file.
headers = {
    "Accept": "application/vnd.sdmx.structurespecificdata+xml;version=2.1"
}

# Perform the GET request with SSL verification disabled
response = requests.get(url, headers=headers, verify=False)

# Check if the request was successful
if response.status_code == 200:
    # Write the content to a file called 'data.xml'.
    with open('data.xml', 'wb') as file:
        file.write(response.content)
    print("Data has been written to data.xml")
else:
    print(f"Failed to retrieve data: Status code {response.status_code}")