Instructions

This interface queries AidData's GDP deflator database. Enter a value in each field, then submit the values to the API. Values are returned in the table below, including a URL to the original API link.

See FAQ + Beta below for troubleshooting and contact info.

Fields

Submit Form:

  • Country: Country where the transaction originated. This value is used to determine the deflator.
  • Currency: Currency in which the amount is reported. This value is used to determin the historical exchange rate
  • Year: Year of the transaction.
  • Amount: Either:
    • A. Nominal value of transaction, in the named currency (eg. "74218.67")
    • B. An array of values, separated by commas (eg. "540, 2003.53, 50000000")

Response Table:

  • Year: Year of the transaction.
  • Country: Country where the transaction originated. This value is used to determine the deflator.
  • Currency: Currency in which the amount is reported. This value is used to determin the historical exchange rate
  • Original: Nominal value of transaction, in the named currency.
  • USD-2009: Value of the transaction, in USD-2009.
  • Link to API: URL to "behind the scenes" API query.

Coverage

Current coverage of deflators and Exchange Rates

Broadly defined, coverage in this database includes:

  • OECD DAC donors, 1961 - 2010
  • Arab donors, 60s/70s - 2010
  • Eastern European Donors, mid-90s - 2010
  • China, 1960 - 2011
Exchange rates cover:
  • Domestic currencies for these donor countries (Euro for Eurozone)
  • African Currencies, 1960-2011

Future Coverage

Our goal is to expand coverage for as many countries, currencies, years and targets (beyond USD-2009) as possible. To help us understand which countries, currencies, years and targets are valuable, send us an email at info@aiddata.org. We have also considered allowing registered users to upload their own exchange rate values and annual inflation percentages to expand coverage.

Data Sources

In short, data is sourced from OECD (GDP deflators, for DAC donors) and World Bank (GDP inflation, exchange rates) for countries outside the DAC. Detailed source information is available on request, see email address above.

API Documentation

Request Format

The deflator web service API can be found at oscar.itpir.wm.edu/api.php. The API takes one argument: "val". The "val" variable receives a composite string, consisting of four parts:

  • Amount: A numeric value which may include a decimal but may not include commas. Ex: "45000", "10.50", "9"
  • Currency: ISO3 code for the originating currency, in CAPS. Note that not all currencies are covered by the AidData API database. If you're interested in helping to expand the coverage, contact info@aiddata.org. Ex: "USD", "EUR", "XOF".
  • Year: Year of the transaction or reported amount. Note that not all years are available for all currencies. If you're interested in helping to expand the coverage, contact info@aiddata.org. Ex. "2004", "1969".
  • Country: ISO3 code for the country of origin of the transaction or amount, in CAPS. This is used for deflating the amount according to deflation in the originating country. Note that not all countries have deflators. If you're interested in helping to expand the coverage, contact info@aiddata.org. Ex: "USA", "FRA", "ARE".
  • json: If json=true is sent with the request, then a json response is returned (see below).

The four parts should be joined to one string, then passed to the API as "val", for example, to deflate 1,000 Euros in 2007 from France, the "val" term is:

"1000" + "EUR" + "2007" + "FRA" = 1000EUR2007FRA

And the full API request url is:

oscar.itpir.wm.edu/deflate/api.php?val=1000EUR2007FRA

Response Format

Plain text:The deflator API responds with a numeric value, rounded to two digits after the decimal. Unnecessary zeros are not preserved, so a response will take the format of "500.5" instead of "500.50".

JSON: If json=true is sent with the request, then the response will be a JSON object. For example, /api.php?val=500CNY2005CHN&json=true yields:
{

  • "deflated_amount" : 87.59,
  • "current_amount" : 61.02,
  • "input_amount": 500,
  • "year" : 2005,
  • "original_currency" : "CNY",
  • "exchange_rate": 8.19431666666667,
  • "country": "CHN",
  • "deflator": 0.69665104956371
}
where:
  • deflated_amount is the deflated value
  • current_amount is the amount in USD of the transaction year ("current USD" or "nominal USD")
  • input_amount is the amount in original currency, as parsed by the deflator
  • original_currency is the given currency, as parsed by the deflator
  • exchange_rate is the exchange rate used for the conversion, according to the currency-year and taken from the deflator database
  • country is the country, as parsed by the deflator
  • deflator is the deflator used for the conversion, according to the country-year and taken from the deflator database

If you have other recommendations for how this service could be improved, please contact us at info@aiddata.org

FAQ + Beta

"What is this web service for?"

To perform rigorous analysis on financial data from many countries, currencies and time periods, it is essential to convert financial values to a constant currency. For example, €80,000 from France in 2008 is not immediately comparable to $100,000 from the United States in 2000. However, after both have been converted to USD-2009, they can be compared:

Year Currency Country Original Value USD-2009 Link to API
2008EURFRA80000111989.61URL
2000USDUSA100000123653.38URL

If you need to deflate a small number of values, you can enter the original country, currency, year and amount of a transaction in the fields below, then send the values to the deflator web service, which will respond with the deflated USD-2009 value. If you need to deflate a large number of values, select values for country, currency and year, then paste comma-separated values into the amount field to deflate the whole batch. To integrate this service into your own application, see the "Documentation" tab above for a brief description of the API.

"So it's in Beta, should I still trust it?"

Yes, you should trust it. It runs on the same numbers used to generate the AidData 2.0 Research Release. We're already employing it in another data collection project. That said -- let us know if you do find an error.

"I'm getting an error -- what should I do?"

Make sure you have selected values from the available dropdown menus. They are dynamically generated according to existing selections. These values are case sensitive. Also, this API includes only the deflators used to generate the AidData 2.0 Research Release. If you would like to expand coverage to new years, countries or currencies, contact info@aiddata.org

"What can I do to improve this service?"

Please write us an email to let us know how you use this web service, or how you would use it if it had more features or wider coverage. Please let us know: What features are/would be valuable for you and What areas of coverage (countries, currencies, years, targets) would be useful for you. We'd love to hear from you.


Application

Country: Currency: Year: Amount:
For "Amount", enter a single value or many comma-separated values (eg. " 526.80, 43021.54, 300 ").
Year Currency Country Original Value USD-2009 Link to API