Inex

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"}

International tourists

Foreign tourists arriving in Spain each month since 2016. The hole in 2020 is the pandemic.

In plain words. People who live abroad and spend at least one night in Spain, counted as they arrive at airports, ports and roads. The INE counts arrivals, so someone who comes twice counts twice.

Asking the INE…
Inex.Tables.observations_as_data_frame!(10823,
  filters: [data_type: 72, national: 16473],
  observation_start: ~D[2016-01-01]
)

Where they come from

Tourists so far this year by country of residence.

In plain words. The country is where the tourist lives, whatever their passport says: a Briton who lives in France counts as coming from France.

Asking the INE…
Inex.Tables.observations_as_data_frame!(75719,
  filters: [{96, :all}, data_type: 298086],
  last: 1,
  language: :en
)

Data: © INE, published under CC BY 4.0. The page asks the INE for it and keeps it for a few hours, so it always shows the latest figures published.

Map: Natural Earth, in the public domain.

Inex is an independent open source project: it is not developed, endorsed or supported by the INE.