CEPALSTAT WEB SERVICES/API
 

In this section, you will find application developer technical information necessary to access all the statistical information available in the databases integrated CEPALSTAT (data and metadata) through the use of application programming interface API (Application Programming Interface).

Thus, ECLAC opens its database BDI-CEPALSTAT, allowing automated access to data under the Open Data approach increasingly used and implemented between agencies production and dissemination of statistical information public.

It is expected that the implementation of this new form of access to statistical information from ECLAC promotes the use of comparable regional statistics in order to foster the development of informed public policy.

About Data

The data model used in BDI-CEPALSTAT indicator identifies as the basic and primary step in the data structure. The model allows each defines its own size indicator and the amount thereof.

From the structural point of view of data, an indicator is simply a multidimensional array, so understanding the data pertains to multidimensional space indicator. This means that each and every one of the data belonging to an indicator always be qualified by a tuple where n is the number of dimensions of the indicator.

The indicators are classified into a tree where nodes multilevel theme "leaves" of the tree correspond to thematic indicators.

In BDI-CEPALSTAT data have metadata, this means that the figures are accompanied by non-essential information number, that defines, describes and supplements. The metadata associated with the data at three levels: structural indicator level and data level.

The structural level metadata defines how many dimensions does the indicator and what these dimensions, that is, what are their breakdowns.

The indicator level metadata (all data associated with a flag) consists of the description text (title) of the indicator, the indicator definition text, unit of measure, the calculation methodology and comments.

The metadata level data refers to the data source, although in most cases all the data of an indicator having the same source. However despite this generality, BDI-CEPALSTAT is possible to define a different font for each data associating each data to its own source. Also at this level metadata associated with each data allow text that qualifies for example a notice specifying preliminary figures. The model is restricted in the first case (each data has only one source) and wide in the second (may have one or more notes).

API documentation

webservices REST:

Access classifying indicators CEPALSTAT
getThematicTree
http://interwp.cepal.org/sisgen/ws/cepalstat/getThematicTree.asp
returns the full thematic classification of all indicators in BDI-CEPALSTAT
There is a parameter incluyeLinks = {"yes", "no"} , which returns the tree theme including links to external statistical content BDI-CEPALSTAT .
Optionally accepts parameter language = {"spanish", "english"} , the default is english.
For example: http://interwp.cepal.org/sisgen/ws/cepalstat/getThematicTree.asp?language=spanish
returns the complete classification of all available indicators in BDI-CEPALSTAT Spanish.
The image highlights the tree structure of the BDI-thematic classification CEPALSTAT eg indicator "Proportion of terrestrial protected areas" whose idIndicator equals 2013 , belongs to the sub-theme "protected areas" that belongs to the sub-theme "Biota" which in turn belongs to the "Environmental Statistics and Indicators".
The attribute IdIndicator identifies the indicator, is this number that should be used in the following webservices for retrieving such dimensions of Display webservice getDimensions and data and / or metadata of Display webservice getDataMeta or getDataWithoutMeta .
Description of codes and breakdowns dimensions of a given indicator
getDimensions
http://interwp.cepal.org/sisgen/ws/cepalstat/getDimensions.asp?idIndicator=1
returns all the codes and descriptions in English of the dimensions and their breakdowns of the measure specified in parameter idIndicator = 1 .
The parameter idIndicator is required!
IdIndicator code can be obtained with the webservice getThematicTree .
Optionally accepts parameter language = {"spanish", "english"} , the default is english.
For example: http://interwp.cepal.org/sisgen/ws/cepalstat/getDimensions.asp?idIndicator=1&language=spanish
returns all the codes and descriptions in Spanish of the dimensions and their breakdowns of the measure specified in parameter idIndicator = 1 .
sdmx_structure
http://interwp.cepal.org/sisgen/ws/cepalstat/sdmx_structure.asp?idIndicator=1
returns structural metadata format indicator SDMX [version 2.1 - 2013] (an initiative to foster standards for the exchange of statistical information. Sponsored by BIS - ECB - EUROSTAT - IMF - OECD - UN - World Bank).
Similar to getDimensions, accepts the same parameters and returns the dimensions and breakdowns indicator, additionally also included here the sources and notes associated indicator.
In BDI_CEPALSTAT indicators have any number of dimensions, in the case of the indicator 1 defines three dimensions: "Sex" identified by the num number "144" , the dimension "Country" identified by the number "208" and dimension "Years" identified by the number "29117 ".
Each dimension has its breakdowns also identified by a number, such as dimension "Sex" has three breakdowns: unbundling "Both sexes" identified by the number "146" , unbundling "Men" identified by the number "265" and unbundling "Woman" identified by the number "266" .
The image shows the ID numbers of the breakdowns of the other dimensions of the indicator.
These ID numbers are used in the following webservices for retrieving data and / or metadata of Display getDataMeta webservices or getDataWithoutMeta .
The result XML has only one main item: dimensions.

The item dimensions has the following subitems:
        dim contains the description and identifier of the dimension. There is one of these subitems dim for each dimension of the indicator.
        des contains the description of unbundling ( attribute name ), the identifier of unbundling ( attribute id ) and a parameter (attribute in )
        disaggregating indicating whether or not the data present in the indicator stored in the database.
        Each subitem dim can contain one or more subitems des that correspond to the size breakdowns.


Access to data and metadata
getDataMeta
http://interwp.cepal.org/sisgen/ws/cepalstat/getDataMeta.asp?
IdIndicator=1&language=spanish&dim_144=146&dim_208=222&dim_29117=29180,29185

returns data with metadata, that is, with the figures this webservice returns information about dimensional structure, calculation methodology, comments, sources and notes.
The parameter idIndicator is required!
IdIndicator code can be obtained with the webservice getThematicTree.
Optionally accepts parameter language = {"spanish", "english"} , the default is english.
This webservice, besides the parameters idIndicator (that identifies the indicator) and language (which specifies the language of the outcome) requires parameters that identify dimensions and their breakdowns.
For example, in the query shown above 3 parameters are used dim_ type [id_dimension] = [id_desagregacion], [id_desagregacion], ...
dim_144=146
dim_208=222
dim_29117=29180,29185
The numbers accompanying the prefix dim_ are the IDs of the dimensions specified in the parameter indicator idIndicator .
dim_144 refers to the dimension "Sex"
dim_208 refers to the dimension "Country"
dim_29117 refers to the dimension "Years"
The numbers are specified after the equals sign identifiers correspond to the breakdowns being requested.
Note that when a dimension is not specified in a query string, it is interpreted by the webservice as if it had specified all the breakdowns of the omitted dimension. Moreover, if you. Do not specify any dimension in the query string all data of this indicator are obtained.
In other words, the previous example query is requesting data indicator whose idIndicator equals 1 that are "Both sexes" (dim_144=146), "Brazil" (dim_208=222) and "2010, 2015" (dim_29117=29180,29185).

The result XML has the following five main items: metadata , data , dimensions , notes and sources .

The item metadata has the following attributes:
        idIndicator contains the ID number of the indicator.
        indicador contains the description of the indicator.
        tema contains the description of the main theme to which the indicator.
        area contains the description of the area to which the indicator.
        nota if any, contains the description of a note associated with the indicator.
        unidad contains the unit of measure of all indicator data.
        definicion contains the definition of the indicator.
        metodologia_calculo contains the methodology used to produce the indicator.
        comentarios contains comments on the indicator.

The item data has many subitems data as the webservice has recovered data.
The item data has the following attributes:
         dim_ [id_dimension] = [id_desagregacion] , there is one of these attributes for each dimension of the indicator,
        id_dimension where is the identifier of a dimension and id_desagregacion indicator is the identifier of the data disaggregation qualifying.
         id_fuente contains the source identifier associated with the data.
         ids_notas contains identifiers associated notes to the data, if the data has more than one note IDs separated by comma .
         ISO3 ISO3 encodes the data, if the data have any breakdown that refers to a country.
         value contains the value.

The item dimensions has the following subitems:
         dim descripcióne contains the identifier of the dimension. There is one of these subitems dim for each dimension of the indicator.
         des contains the description of unbundling ( attribute name ), the identifier of unbundling ( attribute id ) and a parameter (attribute in )
        unbundling indicating whether or not the data present in the current query result.
        Each subitem dim can contain one or more subitems des that correspond to the size breakdowns.

The item notes has many subitems note and notes associated with the data you have retrieved the webservice.
The item note has the following attributes:
         id contains the identifier of the note.
         Description contains the description of the note.

The item sources has many subitems source as the data sources associated with the webservice has recovered.
The item source has the following attributes:
         id contains the identifier of the source.
         Description contains the description of the source.
        if so, url_publicacion contains the Internet address of the direct source.
         nombre_organismo contains the name of the organizacióna which the source belongs.
         sigla_organismo contains the acronym of which belongs organizacióna the source.
        if so, url_organizacion contains the address of the site intenet organizacióna that owns the source.


Data access without metadata
getDataWithoutMeta
http://interwp.cepal.org/sisgen/ws/cepalstat/getDataWithoutMeta.asp?
IdIndicator=1&language=spanish&dim_144=146&dim_208=222&dim_29117=29180,29185

returns numeric data without metadata, that is, without information on the dimensional structure of the display, without calculation methodology, without comment, without sources or notes. Returns description and the unit of measurement of indicator.
The parameter idIndicator is required!
IdIndicator code can be obtained with the webservice getThematicTree .
Optionally accepts parameter language = {"english", "english"} , the default is English.
This webservice, besides the parameters idIndicator (that identifies the indicator) and language (which specifies the language of the outcome) requires parameters that identify dimensions and their breakdowns.
For example, in the query shown above 3 parameters are used dim_ type [id_dimension] = [id_desagregacion], [id_desagregacion], ...
dim_144=146
dim_208=222
dim_29117=29180,29185
The numbers accompanying the prefix dim_ are the IDs of the dimensions specified in the parameter indicator idIndicator .
dim_144 refers to the dimension "Sex"
dim_208 refers to the dimension "Country"
dim_29117 refers to the dimension "Years"
The numbers are specified after the equals sign identifiers correspond to the breakdowns being requested.
Note that when a dimension is not specified in a query string, it is interpreted by the webservice as if it had specified all the breakdowns of the omitted dimension.
In other words, the previous example query is requesting data indicator whose idIndicator equals 1 that are "Both sexes" (dim_144=146) , "Brazil" (dim_208=222) and "2010, 2015" (dim_29117=29180,29185).
sdmx_dataset
http://interwp.cepal.org/sisgen/ws/cepalstat/sdmx_dataset.asp?IdIndicator=1&language=spanish&dim_144=146&dim_208=222&dim_29117=29180,29185
returns indicator data in SDMX format [version 2.1 - 2013] (an initiative to promote standards for the exchange of statistical information Sponsored by BIS. - ECB - Eurostat - IMF - OECD - UN - World Bank).
Similar to getDataWithoutMeta, accepts the same parameters and returns the indicator data, including here identifiers sources and notes associated with each item. Code lists the dimensions, sources and notes are using the webservice sdmx_structure, which already includes an explicit reference in the data file returned.
The result XML has just the item: data .

The item data has many subitems data as the webservice has recovered data.
The item data has the following attributes:
        idIndicator contains the ID number of the indicator.
        indicador contains the description of the indicator.
        unidad contains the unit of measure of all indicator data.
The item dato has the following attributes:
        dim_[id_dimension]=[id_desagregacion], there one of these attributes for each dimension of the indicator,,
        id_dimension where is the identifier of a dimension and id_desagregacion indicator is the identifier of the data disaggregation qualifying.
        iso3 ISO3 encodes the data, if the data have any breakdown that refers to a country.
        valor contains the value.

WEBSERVICES MISCELLANEOUS
getDataAvailability.asp
http://interwp.cepal.org/sisgen/ws/cepalstat/getDataAvailability.asp?
idIndicator=1&dim_208=222&dim_29117=ret&language=spanish

breakdowns returns all data of a dimension, for a given breakdown of another dimension of the indicator. This web service is generally used to know years available (with data) for a given country.
Example: 1 indicator has 3 dimensions (this can be known using the webservice getDimensions explained above) of which the dim_208 corresponds to the dimension of Countries and value 222 was the country code Brazil , on the other hand, dimension dim_29117 corresponds to the dimension of years, so what is being required to webservice getDataAvailability , in this example, is the availability of years data that the country Brazil at the prompt 1 .
Note that the link in the example, the parameter dim_29117 is set "ret" , this indicates the webservice that is the dimension which will return the breakdowns available.

getIndicatorMeta.asp
http://interwp.cepal.org/sisgen/ws/cepalstat/getIndicatorMeta.asp?idIndicator=1&language=spanish
returns metadata, such as calculation methodology, comments, definition, associated with the indicator.

getDataWithSourceAndFootnotes.asp
http://interwp.cepal.org/sisgen/ws/cepalstat/getDataWithoutMeta.asp?idIndicator=1
&language=spanish&dim_144=146&dim_208=222&dim_29117=29180,29185

returns descriptions of data sources and notes associated with the data returned.

getIndicatorSources.asp
http://interwp.cepal.org/sisgen/ws/cepalstat/getIndicatorSources.asp?idIndicator=1&language=spanish
Indicator given identifier, returns the font descriptions.

getSources.asp
http://interwp.cepal.org/sisgen/ws/cepalstat/getSources.asp?ids=1,2,3,4,5,6,7,8,9&language=spanish
given the identifiers of the sources, returns the descriptions of the sources.
getFootnotes.asp
http://interwp.cepal.org/sisgen/ws/cepalstat/getFootnotes.asp?ids=1,2,3,4,5,6,7,8,9&language=spanish
identifiers given notes ("footer"), returns the descriptions of the notes.

Terms and conditions

The use of databases and developments CEPALSTAT API is under the aegis of the Terms and conditions herein.

 
CEPALSTAT
© United Nations, 2000-2017 | Terms & Conditions