Skip to content

ECB

Discover European Central Bank statistical series and retrieve observations with original periods, units and source metadata

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/ecb/index.md to help me query ECB with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Compare euro exchange rates across currencies

Example output · captured
Connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT c.code AS currency, c.name AS currency_name,
  round(avg(o.value), 4) AS avg_rate_per_eur, count(o.value) AS months
FROM ecb.main.observations('EXR', 'M.USD+GBP+JPY.EUR.SP00.A', start_period := '2024-01', end_period := '2024-03') AS o
JOIN ecb.main.codes('CL_CURRENCY') AS c ON c.code = split_part(o.series_key, '.', 2)
GROUP BY c.code, c.name
ORDER BY c.code
Result
currency currency_name avg_rate_per_eur months
GBP UK pound sterling 0.8562 3
JPY Japanese yen 161.2 3
USD US dollar 1.0857 3

Quick start

Choose where to run ECB, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'ecb' AS ecb (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-ecb-worker'
);

3. Run a query

query.sql
SELECT c.code AS currency, c.name AS currency_name,
  round(avg(o.value), 4) AS avg_rate_per_eur, count(o.value) AS months
FROM ecb.main.observations('EXR', 'M.USD+GBP+JPY.EUR.SP00.A', start_period := '2024-01', end_period := '2024-03') AS o
JOIN ecb.main.codes('CL_CURRENCY') AS c ON c.code = split_part(o.series_key, '.', 2)
GROUP BY c.code, c.name
ORDER BY c.code
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'ecb' AS ecb (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-ecb-worker'
);

Overview

European Central Bank statistics as SQL tables: exchange rates, interest rates, money, prices and other euro-area time series from the ECB Data Portal, with dataflow dimensions and code lists. No API key needed.

Catalog

Everything ecb exposes once attached — read straight from the worker's released build.

ecb 1 schema
main 5 functions

ECB Data Portal dataflows as table functions: datasets, dimensions, code lists and observations.

Schema examples (7)
Examples (7)

Discover ECB datasets

SELECT flow, name FROM ecb.main.datasets(flow := 'EXR') ORDER BY flow;

Discover ECB dimensions

SELECT dimension, position, codelist
FROM ecb.main.dimensions('EXR')
ORDER BY position NULLS LAST, dimension;

Discover ECB dimension codes

SELECT code, name
FROM ecb.main.codes('CL_CURRENCY')
WHERE code IN ('USD','EUR')
ORDER BY code;

Inspect ECB series

SELECT series_key, title, unit
FROM ecb.main.series('EXR', 'D.USD.EUR.SP00.A')
ORDER BY series_key;
3 more examples

Every frequency at which the US dollar/euro reference rate is published, with the frequency name decoded from the CL_FREQ code list

SELECT s.frequency, f.name AS frequency_name, s.series_key
FROM ecb.main.series('EXR', '.USD.EUR.SP00.A') AS s
JOIN ecb.main.codes('CL_FREQ') AS f ON f.code = s.frequency
ORDER BY s.series_key;

Read ECB observations

SELECT period, value, unit
FROM ecb.main.observations('EXR', 'D.USD.EUR.SP00.A', start_period := '2024-01-02', end_period := '2024-01-05')
ORDER BY period;

Average monthly ECB euro reference rates for Q1 2024 (USD, GBP, JPY), labelled with each currency's name from the CL_CURRENCY code list

SELECT c.code AS currency, c.name AS currency_name,
  round(avg(o.value), 4) AS avg_rate_per_eur, count(o.value) AS months
FROM ecb.main.observations('EXR', 'M.USD+GBP+JPY.EUR.SP00.A', start_period := '2024-01', end_period := '2024-03') AS o
JOIN ecb.main.codes('CL_CURRENCY') AS c ON c.code = split_part(o.series_key, '.', 2)
GROUP BY c.code, c.name
ORDER BY c.code;
Result
currency currency_name avg_rate_per_eur months
GBP UK pound sterling 0.8562 3
JPY Japanese yen 161.2 3
USD US dollar 1.0857 3
Table functions
codes (codelist VARCHAR, agency := VARCHAR, language := VARCHAR, max_rows := BIGINT, version := VARCHAR) 1 example

List values, translated labels and optional hierarchy parents from one SDMX code list. Use the agency and version returned by dimensions().

Positional arguments
codelist VARCHAR
Code-list identifier returned by dimensions(), for example CL_CURRENCY.
Named arguments
agency := VARCHAR
Maintaining SDMX agency identifier. · default "ECB"
language := VARCHAR
Preferred code-label language with English fallback. · default "en"
max_rows := BIGINT
Explicit output cap after a complete bounded source response; use dates and keys to reduce source work. · default 100000
version := VARCHAR
Published artifact version or latest. · default "latest"
Returns columns
code VARCHAR
Code used as one dimension-key component.
name VARCHAR
Translated code label.
description VARCHAR
Translated code description when supplied.
parent_code VARCHAR
Parent code for hierarchical classifications, if supplied.
attributes_json VARCHAR
Original code XML attributes.
Example

Discover ECB dimension codes

SELECT code, name
FROM ecb.main.codes('CL_CURRENCY')
WHERE code IN ('USD','EUR')
ORDER BY code;
Link
datasets (agency := VARCHAR, flow := VARCHAR, language := VARCHAR, max_rows := BIGINT, version := VARCHAR) 1 example

List dataflows and their referenced data structures. Use flow to select one artifact; all lists available dataflows. Discovery does not retrieve observations.

Named arguments
agency := VARCHAR
Maintaining SDMX agency identifier. · default "ECB"
flow := VARCHAR
Dataflow identifier; all discovers the agency's catalog. · default "all"
language := VARCHAR
Preferred metadata language; falls back to English or the first available label. · default "en"
max_rows := BIGINT
Explicit output cap after a complete bounded source response; use dates and keys to reduce source work. · default 100000
version := VARCHAR
Published artifact version or latest. · default "latest"
Returns columns
flow VARCHAR
SDMX dataflow identifier.
agency VARCHAR
Maintaining agency identifier.
version VARCHAR
Published dataflow version.
name VARCHAR
Translated dataset name.
description VARCHAR
Translated dataset description when supplied.
structure_id VARCHAR
Referenced data structure identifier.
structure_agency VARCHAR
Maintaining agency of the data structure.
structure_version VARCHAR
Referenced data structure version.
Example

Discover ECB datasets

SELECT flow, name FROM ecb.main.datasets(flow := 'EXR') ORDER BY flow;
Link
dimensions (flow VARCHAR, agency := VARCHAR, max_rows := BIGINT, version := VARCHAR) 1 example

Return the dataflow's series-key dimensions in their declared positions plus its time dimension. Code-list references supply arguments for codes().

Positional arguments
flow VARCHAR
Dataflow identifier returned by datasets(), for example EXR.
Named arguments
agency := VARCHAR
Maintaining SDMX agency identifier. · default "ECB"
max_rows := BIGINT
Explicit output cap after a complete bounded source response; use dates and keys to reduce source work. · default 100000
version := VARCHAR
Published artifact version or latest. · default "latest"
Returns columns
dimension VARCHAR
Dimension identifier used in SDMX keys.
position BIGINT
One-based series-key position; the observation dimension may have no position.
is_time BOOLEAN
Whether this is the time dimension at observation level.
codelist VARCHAR
Referenced code list, if the dimension has an enumeration.
codelist_agency VARCHAR
Maintaining agency for the code list.
codelist_version VARCHAR
Referenced code-list version.
concept VARCHAR
Referenced statistical concept identifier.
Example

Discover ECB dimensions

SELECT dimension, position, codelist
FROM ecb.main.dimensions('EXR')
ORDER BY position NULLS LAST, dimension;
Link
observations (flow VARCHAR, key VARCHAR, agency := VARCHAR, end_period := VARCHAR, first_n := BIGINT, include_history := BOOLEAN, last_n := BIGINT, max_rows := BIGINT, start_period := VARCHAR, updated_after := VARCHAR, version := VARCHAR) 2 examples

Retrieve observations with original periods, values, units and SDMX attributes. include_history preserves source dataset actions and validity intervals; these are not inferred ALFRED-style vintage dates. Deletions without individual observations have a NULL period. Required positional arguments are flow and key; remaining controls are named.

Positional arguments
flow VARCHAR
Dataflow identifier returned by datasets(), for example EXR.
key VARCHAR
Dot-separated dimension values in dimensions() order; empty components are wildcards and '+' selects alternatives.
Named arguments
agency := VARCHAR
Maintaining SDMX agency identifier. · default "ECB"
end_period := VARCHAR
Inclusive native SDMX upper period bound; empty leaves it open. · default ""
first_n := BIGINT
Earliest observations per matching series; zero leaves this source limit unset. · default 0
include_history := BOOLEAN
Request previous dataset versions; source action and validity fields are preserved without inventing vintages. · default false
last_n := BIGINT
Latest observations per matching series; zero leaves this source limit unset. · default 0
max_rows := BIGINT
Explicit output cap after a complete bounded source response; use dates and keys to reduce source work. · default 100000
start_period := VARCHAR
Inclusive native SDMX lower period bound; empty leaves it open. · default ""
updated_after := VARCHAR
Only changes after this timezone-qualified ISO 8601 instant; empty disables incremental filtering. · default ""
version := VARCHAR
Published artifact version or latest. · default "latest"
Returns columns
flow VARCHAR
Requested dataflow identifier.
series_key VARCHAR
Dot-separated source series key; NULL for dataset-wide deletion markers.
frequency VARCHAR
Source frequency code.
title VARCHAR
Source series title when supplied.
unit VARCHAR
Source units, without currency conversion.
unit_multiplier BIGINT
Source base-ten exponent; values are not rescaled.
dimensions_json VARCHAR
Complete series dimension IDs and values.
attributes_json VARCHAR
Effective inherited source attributes.
dataset_action VARCHAR
Source SDMX action, including Delete markers.
valid_from VARCHAR
Source dataset validFromDate; not an inferred observation release date.
valid_to VARCHAR
Source dataset validToDate when supplied.
dataset_attributes_json VARCHAR
Complete source dataset XML attributes.
period VARCHAR
Native SDMX period; NULL for a deletion marker without individual observations.
value DOUBLE
Numeric observation in published units; NULL when unavailable or deleted.
value_text VARCHAR
Original numeric source text for exact decimal conversion.
observation_status VARCHAR
Source observation status code when supplied.
Examples (2)

Read ECB observations

SELECT period, value, unit
FROM ecb.main.observations('EXR', 'D.USD.EUR.SP00.A', start_period := '2024-01-02', end_period := '2024-01-05')
ORDER BY period;

Average monthly ECB euro reference rates for Q1 2024 (USD, GBP, JPY), labelled with each currency's name from the CL_CURRENCY code list

SELECT c.code AS currency, c.name AS currency_name,
  round(avg(o.value), 4) AS avg_rate_per_eur, count(o.value) AS months
FROM ecb.main.observations('EXR', 'M.USD+GBP+JPY.EUR.SP00.A', start_period := '2024-01', end_period := '2024-03') AS o
JOIN ecb.main.codes('CL_CURRENCY') AS c ON c.code = split_part(o.series_key, '.', 2)
GROUP BY c.code, c.name
ORDER BY c.code;
Result
currency currency_name avg_rate_per_eur months
GBP UK pound sterling 0.8562 3
JPY Japanese yen 161.2 3
USD US dollar 1.0857 3
Link
series (flow VARCHAR, key VARCHAR, agency := VARCHAR, end_period := VARCHAR, first_n := BIGINT, include_history := BOOLEAN, last_n := BIGINT, max_rows := BIGINT, start_period := VARCHAR, updated_after := VARCHAR, version := VARCHAR) 2 examples

Return matching series dimensions, titles, units and effective metadata using the source nodata mode. Required positional arguments are flow and key; all remaining controls are named arguments.

Positional arguments
flow VARCHAR
Dataflow identifier returned by datasets(), for example EXR.
key VARCHAR
Dot-separated dimension values in dimensions() order; empty components are wildcards and '+' selects alternatives.
Named arguments
agency := VARCHAR
Maintaining SDMX agency identifier. · default "ECB"
end_period := VARCHAR
Inclusive native SDMX upper period bound; empty leaves it open. · default ""
first_n := BIGINT
Earliest observations per matching series; zero leaves this source limit unset. · default 0
include_history := BOOLEAN
Request previous dataset versions; source action and validity fields are preserved without inventing vintages. · default false
last_n := BIGINT
Latest observations per matching series; zero leaves this source limit unset. · default 0
max_rows := BIGINT
Explicit output cap after a complete bounded source response; use dates and keys to reduce source work. · default 100000
start_period := VARCHAR
Inclusive native SDMX lower period bound; empty leaves it open. · default ""
updated_after := VARCHAR
Only changes after this timezone-qualified ISO 8601 instant; empty disables incremental filtering. · default ""
version := VARCHAR
Published artifact version or latest. · default "latest"
Returns columns
flow VARCHAR
Requested dataflow identifier.
series_key VARCHAR
Dot-separated source series key; NULL for dataset-wide deletion markers.
frequency VARCHAR
Source frequency code.
title VARCHAR
Source series title when supplied.
unit VARCHAR
Source units, without currency conversion.
unit_multiplier BIGINT
Source base-ten exponent; values are not rescaled.
dimensions_json VARCHAR
Complete series dimension IDs and values.
attributes_json VARCHAR
Effective inherited source attributes.
dataset_action VARCHAR
Source SDMX action, including Delete markers.
valid_from VARCHAR
Source dataset validFromDate; not an inferred observation release date.
valid_to VARCHAR
Source dataset validToDate when supplied.
dataset_attributes_json VARCHAR
Complete source dataset XML attributes.
Examples (2)

Inspect ECB series

SELECT series_key, title, unit
FROM ecb.main.series('EXR', 'D.USD.EUR.SP00.A')
ORDER BY series_key;

Every frequency at which the US dollar/euro reference rate is published, with the frequency name decoded from the CL_FREQ code list

SELECT s.frequency, f.name AS frequency_name, s.series_key
FROM ecb.main.series('EXR', '.USD.EUR.SP00.A') AS s
JOIN ecb.main.codes('CL_FREQ') AS f ON f.code = s.frequency
ORDER BY s.series_key;
Link

Try these queries

exchange_rates_dataflow — Look up the ECB exchange-rates dataflow (EXR) from the keyless ECB Data Portal API

SELECT flow, name FROM ecb.main.datasets(flow := 'EXR') ORDER BY flow;

Uses datasets

Discover ECB dimensions

SELECT dimension, position, codelist
FROM ecb.main.dimensions('EXR')
ORDER BY position NULLS LAST, dimension

Uses dimensions

Discover ECB dimension codes

SELECT code, name
FROM ecb.main.codes('CL_CURRENCY')
WHERE code IN ('USD','EUR')
ORDER BY code

Uses codes

Inspect ECB series

SELECT series_key, title, unit
FROM ecb.main.series('EXR', 'D.USD.EUR.SP00.A')
ORDER BY series_key

Uses series

Every frequency at which the US dollar/euro reference rate is published, with the frequency name decoded from the CL_FREQ code list

SELECT s.frequency, f.name AS frequency_name, s.series_key
FROM ecb.main.series('EXR', '.USD.EUR.SP00.A') AS s
JOIN ecb.main.codes('CL_FREQ') AS f ON f.code = s.frequency
ORDER BY s.series_key

Uses seriescodes

Read ECB observations

SELECT period, value, unit
FROM ecb.main.observations('EXR', 'D.USD.EUR.SP00.A', start_period := '2024-01-02', end_period := '2024-01-05')
ORDER BY period

Uses observations

ECB is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.