The TrendEconomy RESTful web service offers programmatic access to the statistical data and metadata disseminated via the TrendEconomy Statistical Data Warehouse.
It offers two modes of operation:
The web service complies with the SDMX 2.1 RESTful web service specification.
In order to make sense of statistical data, we need to know the concepts associated with them. For example, on its own the figure 4,007,360 is pretty meaningless, but if we know that this is an trade value of total exports from Ontario, Canada to Washington DC, United States in April 2018, it starts making more sense.
Some of the concepts can be free text (such as a comment about a particular observation value) but others take their values from a controlled vocabulary list (such as, for example, a list of countries). These are known as code lists.
There are two types of concepts: dimensions and attributes. Dimensions, when combined, allow to uniquely identify statistical data. Attributes on the other hand do not help identifying statistical data, but they add useful information (like the number of decimals). Dimensions and attributes are known as components.
All the concepts that describe a particular domain (such as exchange rates or inflation) are grouped in a data structure definition (DSD).
The measurement of some phenomenon (e.g. the figure 4,007,360 mentioned above) is known as an observation in SDMX. Observations are grouped together into a data set. However, there can also be an intermediate grouping. For example, all exchange rates for the US dollar against the euro can be measured on a daily basis and these measures can then be grouped together, in a so-called time series. Similarly, you can group a collection of observations made at the same point in time, in a cross-section (for example, the values of the US dollar, the Japanese yen and the Swiss franc against the euro at a particular date). Of course, these intermediate groupings are entirely optional and you may simply decide to have a flat list of observations.
Dataflows represent the data that covers a particular domain (such as, for example, balance of payments). A dataflow provides a reference to the data structure definition that applies for a particular domain, thereby indicating how the data for that domain will look like.
The SDMX information model is much richer than this limited introduction, however the above should be sufficient to understand the basics of this web service. For additional information, please refer to the SDMX documentation.
All metadata can be retrieved using the query string described below.
protocol://wsEntryPoint/resource/agencyID/resourceID/version?detail=value&references=value&lang=value&format=value
protocol | The web service is available over |
---|---|
wsEntryPoint | The web service entry point is available at the following location: |
resource | The following resources are supported by the web service, but please note that not all of them are used at the moment:
|
agencyID | Organisations defining metadata are known as agencies in SDMX. In order to retrieve an artefact, you should know the identifier of its maintainer. TrendEconomy defines metadata for datastructures that are not defined by the provider (e.g. Canadian Customs Trade Statistics or World Bank WDI). For such metadata objects agencyID is TrendEconomy, for others - the identifier of the data & metadata provider. |
resourceID | The identifier of the resource, such as CL_FREQ for the frequency codelist maintained by the ECB. |
version | The version of the artefact to be returned. When the version number is not supplied, the latest version of the resource is returned. |
detail | This attribute specifies the desired amount of information to be returned. For example, it is possible to instruct the web service to return only basic information about the maintainable artefact (i.e.: id, agency id, version and name). Most notably, items of item schemes will not be returned (for example, it will not return the codes in a code list query). Possible values are:
Если для заданных параметров agencyID, resourceID, version в хранилище находится более одного объекта resource, то заданное значение параметра игнорируется и считается равным If there is more than one object of resource type in the warehouse (for given agencyID , resourceID , version) then the specified detail value is ignored and is considered equal to allstubs. |
references | Using the
If there is more than one object of resource type in the warehouse (for given agencyID , resourceID , version ) then the specified references value is ignored and is considered equal to |
lang | Using the Possible values are:
|
format | Using the Possible values are:
|
All the data stored in the TrendEconomy Data Warehouse can be retrieved using the query string described below.
protocol://wsEntryPoint/resource/flowRef/key?parameters
where parameters are defined as such:
startPeriod=value&endPeriod=value&format=value
protocol | The web service is available over |
---|---|
wsEntryPoint | The web service entry point is available at the following location: http://trendeconomy.com/rest |
resource | The resource for data queries is |
flowRef | A string identifying the dataflow. The syntax is agency id, artefact id, version, separated by a “,”. For example: AGENCY_ID,FLOW_ID,VERSION In order to see the dataflows available in the TrendEconomy statistical data warehouse, a metadata query for all dataflows can be performed: |
key | A string compliant with the KeyType defined in the SDMX WADL. The key of the artefact to be returned. Wildcarding is supported by omitting the dimension code for the dimension to be wildcarded. For example, if the following series key identifies the bilateral exchange rates for the daily US dollar exchange rate against the euro, D.USD.EUR.SP00.A, then the following series key can be used to retrieve the data for all currencies against the euro: D..EUR.SP00.A. The OR operator is supported using the + character. For example, the following series key can be used to retrieve the exchange rates against the euro for both the US dollar and the Japanese Yen: D.USD+JPY.EUR.SP00.A. |
startPeriod endPeriod | It is possible to define a date range for which observations should be returned by using the
|
format | Using the Possible values are:
|