Eurostatx

An Elixir client for the Eurostat APIs, the open data services of the statistical office of the European Union.

Everything Eurostat publishes — national accounts, prices, jobs, energy, population, trade — is in free APIs that need no key. Eurostatx covers all of them, validates the options before making the request and turns the answers into Explorer data frames, ready to analyse or to plot in Livebook.

This page is a demo: the countries of the Union side by side, with figures asked of Eurostat with Eurostatx and drawn with Apache ECharts. Under each chart is the call that fetched it.

{:eurostatx, "~> 0.1"}

Renewable energy

Share of renewable sources in gross final energy consumption, in the latest year. The line is the EU as a whole.

In plain words. Renewables are the energy sources that do not run out, such as sun, wind, water or biomass. The figure is their share of all the energy a country uses, heating and transport included, so it comes out lower than their share of electricity.

Asking Eurostat…
eu = ~w(BE BG CZ DK DE EE IE EL ES FR HR IT CY LV LT LU HU MT NL AT PL PT RO SI SK FI SE)

Eurostatx.Statistics.data_as_data_frame!("nrg_ind_ren",
  filters: [geo: ["EU27_2020" | eu], nrg_bal: "REN", unit: "PC"],
  last_periods: 2
)

Electricity prices

Price of electricity for households with a medium consumption (2,500 to 5,000 kWh a year), taxes included, in euros per kWh, in the latest half-year.

In plain words. A kilowatt-hour (kWh) is what a 1,000-watt appliance, a microwave for instance, uses in an hour. The chart shows what a household pays for each one, taxes included.

Asking Eurostat…
eu = ~w(BE BG CZ DK DE EE IE EL ES FR HR IT CY LV LT LU HU MT NL AT PL PT RO SI SK FI SE)

Eurostatx.Statistics.data_as_data_frame!("nrg_pc_204",
  filters: [
    geo: ["EU27_2020" | eu],
    siec: "E7000",
    nrg_cons: "KWH2500-4999",
    unit: "KWH",
    tax: "I_TAX",
    currency: "EUR"
  ],
  last_periods: 2
)

Data: © European Union, Eurostat, reusable under its copyright notice (CC BY 4.0). The page asks Eurostat for it one request at a time, as Eurostat asks, and keeps it for a few hours, so it always shows the latest figures published.

Map: Natural Earth, in the public domain.

Eurostatx is an independent open source project: it is not developed, endorsed or supported by Eurostat.