The exchange rate API from Xavier Finance allows you to retrieve historical exchange rates and graphs for 38 currencies. Supported currencies are so far EUR, USD, JPY, CYP, CZK, DKK, EEK, GBP, HUF, LTL, LVL, MTL, PLN, SEK, SIT, SKK, CHF, ISK, NOK, BGN, HRK, ROL, RON, RUB, TRL, TRY, AUD, CAD, CNY, HKD, IDR, KRW, MYR, NZD, PHP, SGD, THB, ZAR. For some currencies we don’t have data since the start (4th of January 1999) which means that 0.0000 will be returned as exchange rate in some cases.

This API doesn’t require any API key, but we ask you to be nice to our servers and not send too many requests. In case this service is abused we may have to request that users register for API keys, and we may also limit the access to this service.

Since this is a free service we require a text link to http://finance.xaviermedia.com/ if you use any graphs or data:

<a href=”http://finance.xaviermedia.com/”>Currency converter</a>

Accessing historical exchange rates

To access historical exchange rates in the API, you simply just send a request to the API server in the following format:

http://api.finance.xaviermedia.com/api/[year]/[month]/[day].[format]

[year] = The year in 4 digits like 1999
[month] = The month in 2 digits like 01 for January
[day] = The day of the month in 2 digits like 08 for the 8th of January
[format] = Format of the response like xml for an XML file (so far XML is the only supported format)

At the moment we only have rates since 4th of January 1999, all other dates will return a 404 error (see below).

A successful query will result in the following response:

<xavierresponse responsecode=”200″>
<fx_date>1999-01-08</fx_date>
<title>Xavier Finance – Exchange rates for 1999-01-08</title>
<link>http://finance.xaviermedia.com/</link>
<exchange_rates>
<basecurrency>EUR</basecurrency>
<fx_date>1999-01-08</fx_date>
<fx basecurrency=”EUR”>
<currency_code>EUR</currency_code>
<rate>1.0</rate>
</fx>
<fx basecurrency=”EUR”>
<currency_code>USD</currency_code>
<rate>1.165900</rate>
</fx>
<fx basecurrency=”EUR”>
<currency_code>JPY</currency_code>
<rate>130.089996</rate>
</fx>
</exchange_rates>
</xavierresponse>

Exchange rates for today

To access todays exchange rates in the API, you simply just send a request to the API server in the following format:

http://api.finance.xaviermedia.com/api/latest.[format]

[format] = Format of the response like xml for an XML file (so far XML is the only supported format)
Please note that you don’t need to send any dates since the rates returned are the latest available in the API. The exchange rates are updated daily so you don’t have to query more then once per day!

A successful query will result in the following response:

<xavierresponse responsecode=”200″>
<fx_date>1999-01-08</fx_date>
<title>Xavier Finance – Exchange rates for 1999-01-08</title>
<link>http://finance.xaviermedia.com/</link>
<exchange_rates>
<basecurrency>EUR</basecurrency>
<fx_date>1999-01-08</fx_date>
<fx basecurrency=”EUR”>
<currency_code>EUR</currency_code>
<rate>1.0</rate>
</fx>
<fx basecurrency=”EUR”>
<currency_code>USD</currency_code>
<rate>1.165900</rate>
</fx>
<fx basecurrency=”EUR”>
<currency_code>JPY</currency_code>
<rate>130.089996</rate>
</fx>
</exchange_rates>
</xavierresponse>

 

Invalid requests

In case you send an invalid request to the API server you will get a 404 Page Not Found error:

<xavierresponse responsecode=”404″>
<title>Page not found – Please check the documentation for help</title>
<link>http://api.finance.xaviermedia.com/</link>
</xavierresponse>

You will also get this error message if you send dates before 4th of January 1999. If you’re too early (i.e. we haven’t updated the rates yet) you will also get the latest exchange rates available in the 404 message. For an example tryhttp://api.finance.xaviermedia.com/api/2999/01/01.xml.

At the moment we don’t require any API key to get access to our service, but if you should get a 403 Access Denied error in the future it means that we’ve been forced to limit the access to our service due to abuse :( . In that case check out the information provided in the <link></link> tags for more information.