Xchangeonline

How to use our currency API

Basic usage

It is very easy to get exchange rates and do currency conversions with our service. All you need is the ability to request a URL of the following form:

http://www.xchangeonline.com/convert/AMOUNT/FROM/TO/APIKEY/

Or if want the result to be round to the appropriate number of digits:

http://www.xchangeonline.com/round/AMOUNT/FROM/TO/APIKEY/

Example
Say you want to convert 2 US dollars to British pounds.
You've subscribed to our service and your API key is abcde12345.

You would then use the following request to get the converted amount:

http://www.xchangeonline.com/convert/2/USD/GBP/abcde12345/

This returns the following result:

0.0000

Example - conversion with rounding
Say you want to display conversion results to your customer, but you don't know how many digits to round a currency to. We'll gladly take care of that for you!

Say you want to convert 65.90 US dollars to JPY and round the result.
You've subscribed to our service and your API key is abcde12345.

You would then use the following request to get the rounded result:

http://www.xchangeonline.com/round/65.90/USD/JPY/abcde12345/

Which returns the following result:

0

Error codes

In certain situations our service will return a number, which is not positive. If that's the case you will know something went wrong.

This is a result of one of the following situations:

Result:

-1: The amount is invalid.
-2: The API key is invalid OR you have run out of calls for the month.
-3: One of the currencies is invalid.

Amounts should be valid numbers and that means the digits are behind a . and not behind a , - this is a mistake frequently made by our European users in the beginning.

Valid vs invalid numbers
1.25: valid
1,25: invalid

Please contact us if you want to extend your quota for the month. We can be flexible for one-off situations, e.g. when you're testing the service or temporarily migrating or something else.