Currency Converter
I'm happy to announce to the internet community my project - API for currency convertion.
The initial version (1.0) allows to convert the currencies listed below to date. Passing a few POST variables to the specified URL you get JSON response which you may use wherever you want and do whatever it's needed. Have fun!
If you have any questions related to the API please use the form at the bottom of the page.
Changes Log
Version 1.0
Initial version. Basic functionality: conversion between currencies to day.
Version 1.1
The next version which is under development yet would allow to convert currencies accoding to the given dates.
For instance, convert 100 Russian rubles for July 7, 2014 plus 1000 Euro for June 16, 2012 to US dollars for yesterday.
Example
Limits
Please note there are no any limits on quantity of requests per day and so on.
Supported currencies
Code | Currency |
---|---|
AUD | Australia Dollar |
BGN | Bulgaria Lev |
BRL | Brazil Real |
CAD | Canada Dollar |
CNY | China Yuan Renminbi |
HRK | Croatia Kuna |
CZK | Czech Republic Koruna |
DKK | Denmark Krone |
EUR | Euro Member Countries |
HKD | Hong Kong Dollar |
HUF | Hungary Forint |
INR | India Rupee |
IDR | Indonesia Rupiah |
ILS | Israel Shekel |
JPY | Japan Yen |
KRW | Korea (South) Won |
LTL | Lithuania Litas |
MYR | Malaysia Ringgit |
MXN | Mexico Peso |
NZD | New Zealand Dollar |
NOK | Norway Krone |
PHP | Philippines Peso |
PLN | Poland Zloty |
RON | Romania New Leu |
RUB | Russia Ruble |
SGD | Singapore Dollar |
ZAR | South Africa Rand |
SEK | Sweden Krona |
CHF | Switzerland Franc |
THB | Thailand Baht |
TRY | Turkey Lira |
GBP | United Kingdom Pound |
USD | United States Dollar |
API
The following PHP code converts 1000 rubles and 9 kopecks into US dollars
$data = array(
'amount' => 1000.09,
'from_currency' => 'RUB',
'to_currency' => 'USD',
'version' => '1.0'
);
$ch = curl_init('http://rates.ssk.io/');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
print_r(json_decode($result, true));
API response
Array
(
[result] => 1
[error] =>
[total] => 29.3176
[currency] => USD
)
POST variables
Variable | Explanation |
---|---|
amount | Amount of money to convert. Defaults to 0.0 |
from_currency | Code of currency to convert from - e.g. USD |
to_currency | Code of currency to convert to - e.g EUR |
version | API version. Default value - 1.0 |
JSON Response
Variable | Explanation |
---|---|
result | Whether the request was successful |
error | A message accompanying errors |
total | The converted amount (if applicable) |
currency | Target currency code |