An Elixir client for the INE API, the open data service of Spain's National Statistics Institute.
Everything INEbase publishes — prices, jobs, population, housing, tourism — is in a free JSON API that needs no key. Inex covers all of it, 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: charts of figures everyone in Spain has an opinion about, by topic, asked of the INE with Inex and drawn with Apache ECharts. Under each one is the call that fetched it.
{:inex, "~> 0.1"}
Population pyramid
People living in Spain by sex and age, from 0 to 99, on the latest date published.
In plain words. A population pyramid stacks people by age: the youngest at the bottom, the oldest at the top, men on the left and women on the right. The bulge in the middle is the people born in the sixties and seventies, the years of the baby boom, joined since by many immigrants of the same ages.
for sex <- [452, 453] do
Inex.Tables.observations_as_data_frame!(59583,
filters: [sex: sex, age: :all],
last: 1,
language: :en
)
end
Births
Monthly estimate of births in Spain since 2016.
In plain words. An early estimate of how many babies are born in Spain each month. Some months always have more births than others, so it is best to compare a month with the same month in other years.
Inex.Tables.observations_as_data_frame!(46682,
filters: [data_type: 72, national: 16473],
observation_start: ~D[2016-01-01]
)
Life expectancy
Life expectancy at birth of men and women, year by year since 1975.
In plain words. How many years a baby born that year would live on average if the death rates of the time stayed the same all its life. Women live longer than men in every year of the chart.
Inex.Tables.observations_as_data_frame!(48882)