Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a website which sells Hotels in UK and USA to Clients in Germany. I am looking for a way to automatically convert US$ and UK£ automatically in EURO.

I managed to do this through http://dynamicconverter.com/.

However this only works when you have either UK hotels OR USA hotels on a single page. It does not work when both $ and £ are present on a single page. It simply takes all currency as either $ or £.

Does anyone know of a system which can detect different currencies on the same webpage and convert them?

share|improve this question

3 Answers 3

You want to use one of the APIs that allow currency conversion. Here's a topic from Stack Exchange that gives you a nice set of resources to start with: http://stackoverflow.com/a/8391430/2028547

share|improve this answer

I am the webmaster at coinmill.com. I have various ways for webmasters to show converted prices on their websites. There are examples here: http://coinmill.com/webmaster_options.html

I'm not sure what you mean by "automatically detect", but tools from coinmill.com can be used to convert different currencies within the same page.

share|improve this answer

There's actually an answer on StackOverflow for this question - anyway I'll give you a quick overview about some of the currency conversion APIs out there:

First of all, it really depends on your budget:

$200 - $1200 / month - High Budget
There's a number of "Enterprise-class" data vendors, such as http://xe.com, http://oanda.com and http://xignite.com/forex. Most of them source their data directly from the markets and update it every second, that's why you'll pay between $2000 and $12000 per year.

$0 - $99 / month - Lower Budget
Since I believe you and most other developers/businesses might be looking for more cost-effective alternatives, I'll list two of these below:

currencylayer API (https://currencylayer.com)
They're offering surprisingly accurate exchange rates for around 170 currencies, delivered in JSON format. There's also a Free Plan that lets you make around 1000 monthly API Requests. Paid plans start at $9.99/month.

Since you're looking to convert currencies, I'll give you an idea about how this works with the currencylayer API:

Make an API Request:

https://apilayer.net/convert

    ? access_key = YOUR_ACCESS_KEY
    & from = EUR
    & to = GBP
    & amount = 10

And get the API's JSON result:

{
  "success":true,
  "terms":"https:\/\/currencylayer.com\/terms",
  "privacy":"https:\/\/currencylayer.com\/privacy",
  "query":{
    "from":"EUR",
    "to":"GBP",
    "amount":10
  },
  "info":{
    "timestamp":1432200549,
    "rate":0.712777
  },
  "result":7.12777
}

There's also a bunch of code examples for parsing this response: Documentation

Check also:

Open Exchange Rates (http://openexchangerates.org)
Pretty similar structure, subscription plans starting at $12/month - however, the currency conversion feature is only offered along with their most premium plan (around $90/month).

Hope this helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.