Archive for July, 2009

Wednesday, July 22nd, 2009, 11:45 am | Computer, Hacking, Information, Internet, Programming, Software

Currency Exchange Rates API

There are so many websites out there who can calculate Currency Exchange Rates for you, e.g. Google Search, Bing Search or Yahoo Currency Converter. But what if you just want to have the exchange rate to use in your Desktop or Web Application? It would be kinda troublesome to extract the rate from one of the websites above, especially when they decide to change the layout of their HTML code.

That’s why I decided to create a very simple Currency Exchange Rates API. This API allows you to either get the conversion rate from US Dollar to your desired currency or can directly convert an entered value. The output is plain text, without HTML or XML attributes for easy access from all sources.

How does it work?

Just call the URL of the API with your desired exchange rate as parameter, e.g.

for Euro. This will return the exchange rate from USD to EUR:

currencyapi01

Which currencies are supported?

All in all, 126 different currencies are supported. See a list of all supported currencies on the index page.

Are the values up-to-date?

The API updates itself once an hour, so the values you’re getting may be up to 1h old. This should be good enough since these values are for information purposes only.

How can I use the API on my website?

This example shows how to use the API to display 100$ in € (please replace the & stuff in the URL with a normal &, can’t display it correctly here):

$amount = 100; // amount in your original currency, e.g USD

$oricurr = "USD" // iso code for your original currency

$newcurr = "EUR" // iso code for your new currency

$url = "http://www.multimolti.com/apps/currencyapi/calculator.php?original=".$oricurr."&target=".$newcurr."&value=".$amount;

$result = file_get_contents($url);

echo $result." ".$newcurr;

How does the calculator work?

The calculator works almost the same way as the API itself. Call calculator.php with three parameters: original, target and value. original and target are ISO codes of the currency, and value is the amount of orignal currency to convert. The output is the corresponding amout of target currency.

currencyapi02

How accurate are the values?

The acuracy of the exchange rates can’t be guaranteed. All values are for informational purposes only. See the footer of the index page for more information.

Mirrors (most recent list):

Please use multimolti.com or sann-gmbh.com since they’re the most stable ones!

Websites using the Currency Exchange Rates API:

If there are any questions about the API, bug reports or feature requests, please feel free to comment!

VN:F [1.0.7_345]
Rating: 8.3/10 (12 votes cast)



21 Comments »


ss_blog_claim=c7d0757dcb48491268e39569f229169b ss_blog_claim=c7d0757dcb48491268e39569f229169b