Skip to content

API response

Dear user,

Thank you for your query.

Please kindly find some instructions below:

Using the SDMX 2.0 RESTFUL Service as an example, the information below outlines the steps for building a request to get a couple of exchange rate indicators that are available in the IFS dataset:

  1. Use the DataFlow method to get the available datasets in our API.

http://dataservices.imf.org/REST/SDMX_XML.svc/Dataflow

  1. Use the DataStructure method to get the data structure of the desired dataset. The data structure method requires the KeyFamilyID of the dataset, which you can get from the DataFlow. In this particular example, the ID would be IFS.

http://dataservices.imf.org/REST/SDMX_XML.svc/DataStructure/IFS

The structure will include the codelists but you could also get codelists individually using the following query http://dataservices.imf.org/REST/SDMX_XML.svc/CodeList/{Code List ID as specified in the data structure}.

http://dataservices.imf.org/REST/SDMX_XML.svc/CodeList/CL_INDICATOR_IFS 

  1. Use the CompactData method to get the data of interest to you. The requests should be in the following form (omitting what you do not need):

http://dataservices.imf.org/REST/SDMX_XML.svc/CompactData/{database ID}/{item1 from dimension1}+{item2 from dimension1}+{item N from dimension1}.{item1 from dimension2}+{item2 from dimension2}+{item M from dimension2}?startPeriod={start date}&endPeriod={end date}.

The dimensions are separated by “.” and the order of the dimensions are based on the datastructure, but typically it would be FREQ, then REF_AREA, then INDICATOR.

Also, please note that the response to your request should not be more than 3000 series, which is the max result allowed. http://dataservices.imf.org/REST/SDMX_XML.svc/GetMaxSeriesInResult. If the results are larger, you will need to send multiple requests. Please refer to this article on how to query large datasets with dataservices (http://datahelp.imf.org/knowledgebase/articles/937155-how-to-query-large-datasets-with-data-services).

For a specific example, trying to get all available annual data for the following two indicators for all countries: 

  1. Exchange Rates, Domestic Currency per U.S. Dollar, (EDNE_USD_XDC_RATE)
  2. Exchange Rates, Domestic Currency per U.S. Dollar, Period Average, Rate (EDNA_USD_XDC_RATE) 

The query would look like ths:

http://dataservices.imf.org/REST/SDMX_XML.svc/CompactData/IFS/A..ENDE_XDC_USD_RATE+EDNA_USD_XDC_RATE 

Note that the example above omitted any values for REF_AREA, and START and END period since my intent was to get all available annual data for all available countries for the two indicators.

We hope you find this information useful. Should you have any further questions please feel free to contact us.

Sincerely,

Data Dissemination and Client Services Team
Data Operations Division
Statistics Department
International Monetary Fund


Feedback and Knowledge Base