Obtain data from a table
To obtain the data from a table it is necessary to know its identification code (go to Table and series identifier codes).
Once you know the code of the table you are interested in, you can use the function TABLE_DATA to obtain the associated data.
Obtain all data from the table
For example, for the table ational indices: general and ECOICOP group indices (Id 50902):
https://servicios.ine.es/wstempus/js/EN/DATOS_TABLA/50902
Obtain the latest n data
We use the parameter nult. For example nult=5 to get the last 5 data:
https://servicios.ine.es/wstempus/js/EN/DATOS_TABLA/50902?nult=5
How to filter data from a table
When requesting data from a table, it is possible to filter by the variables and values you are interested in using the tv parameter. To do so, we will distinguish the three possible types of table sources (Tempus 3 tables, pc-axis tables and tpx tables).
-
Tempus 3 tables
In order to filter it is necessary to know the numerical identifier codes (Id) of the variables and the values by which we want to filter. We must therefore do the following:
-
To know the groups in the table you are interested in Indices by Autonomous Community: general and ECOICOP groups (Id = 50913):
-
Knowing the values of the groups:
https://servicios.ine.es/wstempus/js/EN/VALORES_GRUPOSTABLA/50913/110924?det=1
https://servicios.ine.es/wstempus/js/EN/VALORES_GRUPOSTABLA/50913/110925?det=1
https://servicios.ine.es/wstempus/js/EN/VALORES_GRUPOSTABLA/50913/110926?det=1
-
Filter by the variables and values we are interested in:
E.g. annual change (id_variable = 3, id_value = 74 and tv=3:74) of the general index (id_variable = 762, id_value = 304092 and tv=762:304092) of Castilla y León (id_variable = 70, id_value = 9003 and tv=70:9003)
If no value is specified, all values of the variable are obtained. For example, with tv=70: all the Autonomous Communities are obtained
https://servicios.ine.es/wstempus/js/EN/DATOS_TABLA/50913?nult=2&tip=A&tv=3:74&tv=762:304092&tv=70:
If we want to filter by several values of the same variable, we have to include as many tv parameters as values. For example, to obtain data for both Castile and Leon and the Principality of Asturias (id_variable = 70, id_value = 9003 and tv=70:8999)
-
-
Tables tpx
In order to filter, it is necessary to know the alphanumeric identifier codes of the variables and the values by which we want to filter. We must therefore do the following:
-
Request the metadata of the series that make up the table you are interested in Extracción nacional por tipo de material y años (Id = 33387)
https://servicios.ine.es/wstempus/js/EN/SERIES_TABLA/33387?tip=M
-
Filter by the variables and values we are interested in:
For example, for biomass (id_variable = material type, id_value = material type, tv= material type: material type
https://servicios.ine.es/wstempus/js/EN/DATOS_TABLA/33387?nult=2&tv=tipodematerial:1biomasa
If no value is specified, all values of the variable are obtained. For example, with tv=sex: the population of men, women and both sexes is obtained
https://servicios.ine.es/wstempus/js/EN/DATOS_TABLA/33387?nult=2&tv=tipodematerial:
If we want to filter by several values of the same variable, we have to include as many tv parameters as values. For example, in order to obtain biomass and metal ores
-
-
Tempus 3 tpx tables with Tempus 3 identifier codes
There are tpx tables containing Tempus 3 identifier codes (Agricultural Census 2020). In this case, in addition to filtering using the alphanumeric codes, as for a normal tpx table, it is also possible to filter using the Tempus 3 numeric codes of the variables and values. To do this, we must do the following:
-
Request the metadata of the series that make up the table we are interested in Family and regular hired labour on the holding, by relationship to the holder, percentage of total unit work-year (UTAT) and sex (Id=52056). We can also apply a filter to the function SERIES_TABLE useful for tables with a large number of series due to a large territorial segmentation), for example national total (tv=NAC:00):
https://servicios.ine.es/wstempus/js/ES/SERIES_TABLA/52056?tip=M&tv=NAC:00
-
To use numeric identifiers we add the alias ~id at the end (tv=id_variable~id:id_value~id). For example for National Total (tv=349~id:16473~id), Total UTAT tranches (tv=916~id:391871~id), No. of farms (tv=942~id:274282~id), Total labour (tv=999~id:391770~id) and Absolute value (tv=3~id:11406~id) we would have:
-
-
Pc-axis tables
In order to filter, we need to know the alphanumeric identifier codes (Code) of the variables and the values by which we want to filter. We must therefore do the following:
-
Ask for the metadata of the series that make up the table we are interested in Population by age (3 age groups), Spaniards/Foreign Nationals, Sex and Year (Id = t20/e245/p08/l0/01001.px)
https://servicios.ine.es/wstempus/js/EN/SERIES_TABLA/t20/e245/p08/l0/01001.px?tip=M
-
Filter by the variables and values we are interested in:
For example, for the population of Spanish (id_variable = sex, id_value = women, tv=sex:women) women (id_variable = Spanishforeignnationals, id_value = Spaniards, tv= Spanishforeignnationals:Spaniards) of all ages (id_variable = age3agegroups, id_value = total ages, tv=age3agegroups:total ages)
If no value is specified, all values of the variable are obtained. For example, with tv=sex: the population of men, women and both sexes is obtained
If we want to filter by several values of the same variable, we have to include as many tv parameters as values. For example, to obtain the population of males and females
-