Statistics web service (API)

The JSON (JavaScript Object Notation) web service described in this section allows access via URL requests to all the information available both in the Statistics section of the Banco de España and in the BIESTAbre en nueva ventana application.

The structure of URL requests and the simplicity of the JSON format make these types of applications widely used to provide data that allows for the automatic exploitation of statistical information.

Definition of Requests

In this section, the two types of requests that can be made are defined: latest data and series list.

Definition

This request allows you to obtain the latest published data for one or more series. The result for each series is supplemented with other variables such as frequency, description, or trend.

Request

https://app.bde.es/bierest/resources/srdatosapp/favoritas?idioma={language}&series={series_list}

where:

  • language: can take the values es or en, to obtain the result in Spanish or English, respectively
  • series_list: list of series codes separated by commas

Result

It is an array or list of objects. The fields of each object are:

  • "serie": series code that appears in the CSV files of time series and in BIEST application
  • "descripcionCorta": short description of the series
  • "codFrecuencia": series frequency. It can take the values:
    • D: daily
    • M: monthly
    • Q: quarterly
    • A: annual
  • "decimales": maximum number of decimal places in which the data is presented
  • "simbolo": symbol representing the data
  • "tendencia": trend compared to the previous period. It can take the following values:
    • +: if it increases
    • -: if it decreases
    • =: if it remains the same
  • "fechaValor": date and time in the format yyyy-mm-ddThh:mm:ssZ. Note: according to the frequency, each period is associated with the following dates:
    • Daily frequency (D): the date is the reference date
    • Monthly frequency (M): the date is the 1st of the reference month
    • Quarterly frequency (Q): the date is the 1st of the first month of the reference quarter. For example, 2023-04-01 for the 2nd quarter
    • Annual frequency (A): the date is January 1st of the reference year
  • "valor": latest published data of the series

For example:

Definition

This request allows you to obtain the details of one or several complete series as well as their metadata.

Request

https://app.bde.es/bierest/resources/srdatosapp/listaSeries?idioma={language}&series={series_list}&rango={time_range}

where:

  • language: can take the values es or en, to obtain the result in Spanish or English, respectively
  • series_list: list of series codes separated by commas
  • time_range: it can be an annual range (for example, rango=2024) or a code that determines the number of months to display based on the frequency of the series:
    • Daily frequency (D): 3M (last 3 months), 12M, and 36M
    • Monthly frequency (M): 30M, 60M, and MAX (entire series)
    • Quarterly frequency (Q): 30M, 60M, and MAX
    • Annual frequency (A): 60M and MAX
    Note: If the parameter "time_range" is not specified, the request will return the smallest range for the series frequency (for example, for monthly frequency: 30M).

Result

It is an array or list of objects. The fields of each object are:

  • "serie": series code that appears in the CSV files of time series and in BIEST application
  • "descripcion": series description
  • "descripcionCorta": short description of the series
  • "codFrecuencia": series frequency. It can take the values:
    • D: daily
    • M: monthly
    • Q: quarterly
    • A: annual
  • "decimales": maximum number of decimal places in which the data is presented
  • "simbolo": symbol representing the data
  • "informacion": it is a list of additional metadata in the form of title-description pairs, which is displayed in the Information tab of the APP
  • "fechaInicio": it corresponds to the first period available for the series (see the format defined for the "dates" field)
  • "fechaFin": it corresponds to the last period available for the series (see the format defined for the "dates" field)
  • "fechas": array with the dates obtained according to the request range. They are date and time in the format yyyy-mm-ddThh:mm:ssZ Nota: según la frecuencia, cada periodo se asocia a las siguientes fechas:
    • Daily frequency (D): the date is the reference date
    • Monthly frequency (M): the date is the 1st of the reference month
    • Quarterly frequency (Q): the date is the 1st of the first month of the reference quarter. For example, 2023-04-01 for the 2nd quarter
    • Annual frequency (A): the date is January 1st of the reference year
  • "valores": array with the published data corresponding to the dates obtained in the "dates" field, and in the same order

For example:

Series Search

This section allows you to obtain information on the series available in the web service through the series code that appears both in the BIESTAbre en nueva ventana application and in the CSV (or Excel) files associated with the statistical tables that the Banco de España publishes in PDF format in its Statistics section.

Enter the series code

Statistics Information Service

  • Telephone: +34 91 338 5651
  • Monday to Friday, from 9:00 AM to 2:00 PM