For some people that are looking for a FREE and REAL-TIME currency conversion API.
There are our contribution.
Call API Method:
devel.farebookings.com/api/curconversor/[currency from]/[currency to]/[amount]/[output type (optional)]
Page returns the TOTAL of amount in [currency to] currency.
Some examples of API use:
## We want convert one Euro to pounds.
devel.farebookings.com/api/curconversor/EUR/GBP/1/
## We want convert three Euro to pounds and output in json format.
devel.farebookings.com/api/curconversor/EUR/GBP/3/json
## We want a cross domain ajax API call.
$.ajax({
url: "http://devel.farebookings.com/api/curconversor/EUR/GBP/1/",
dataType: 'jsonp',
success: function (data) {
alert(data.GBP);
}
});
Raul Torrico.
Web developer.
Farebookings.com
Great Post. Thank you very much
ReplyDeleteThanks to provide such real time conversation.
ReplyDeleteOne issue is australian dollar conversation not showing real value .
I checked with google but its show some variance
Hi, Jaywant,
Deletefirst, thanks for your review.
You can see variance over the time of currency conversion here:
http://www.x-rates.com/graph/?from=AUD&to=USD&amount=1.00
The conversion can have littles changes in little time fractions.
if want this api then??
ReplyDeleteHi Nilesh,
Deleteyou can use for free
Hi Raul,
ReplyDeleteThanks for your post.
Is there any chance you will explain how to use it on JAVA
Hi,
DeleteYou can choose many methods to obtain the returned data from the API...for example using curl. You need to include your curl java libraries in your project and send the url request to the API.
Hi Raul,
ReplyDeleteCan you please share the complete list of the currencies supported?
May be a link from where I can pull.
Thanks in advance :)
Hi Zaheer,
Deletehttp://en.wikipedia.org/wiki/ISO_4217
Thanks
Dude I appreciate your help but The conversion rate is not that reliable I compared it with google,Yahoo, Oanda
ReplyDeleteOnda has the best but I cant find any Api neither I could find any free xml file can you help me on this ?
but I found a url which returns array to there website but If I use it return error
http://www.oanda.com/lang/es/currency/converter/update?base_currency_0=CRC"e_currency=USD&end_date=2014-01-10&view=details&id=9&action=C
I would be thank full to you if you could help me out
base_currency_0=CRC
quote_currency=USD
end_date=2014-01-10
view=details
action=C
Hi I am trying this and getting back an error using ajax.
ReplyDeleteSee anything wrong here?
$.ajax({
cache : false,
type : "get",
url : "http://devel.farebookings.com/api/curconversor/EUR/CAD/3/json",
dataType : 'json',
success : function(result){
alert("in success")
var items = $.parseJSON(result);
alert(item.CAD);
},
error : function(xhr){
alert(xhr.status + " " + xhr.statusText + " " + xhr.responseText)
return;
}
});
i always end up in the error with a status f 0 and te status text 0.
Any and all help apprecited
use jsonp instead of json
DeleteAll common Browsers do not allows Javasript Calls to access any Pages with another (sub)Domain because of the Same Origin Policy.
ReplyDeleteThe only way to work around that is to set up some kind of "proxy" on your own server (for example an php curl Script) that runs under the same Domain, gets the Information you want from a third source and prints them out.
Thanks!!!
DeleteThis comment has been removed by a blog administrator.
DeleteNow the API is ready to accept jsonp calls.
DeleteHere an example of use.
$.ajax({
url: "http://devel.farebookings.com/api/curconversor/EUR/GBP/1/",
dataType: 'jsonp',
success: function (data) {
alert(data.GBP);
}
});
Enjoy!!
First of all thanks for the API. Now its showing a Slim Applicaiton Error and not working.
DeleteHi Shiva,
DeleteThanks for the advice. I've fixed and now its working fine.
Best Regards!
That was quick! Great job and once again thanks!
DeleteHi Raul Torrico,
ReplyDeletecan you please tell me how can i access this api's data into andoid..??
You can use java.net or curl-java package.
DeleteHi Raul,
ReplyDeleteWhich API you are using internally?
Hi, ManoJ.
DeleteWe are using Yahoo API
Hi,
ReplyDeleteCan you tell me if there is any limitation on number of calls which can be made?
Thanks
Hi Kate. There are any limitation, but, we will supervise any king of abuse, like too much calls that overtake normal use.
ReplyDeleteHi Raul,
DeleteI am planning to embed this in one of my blog which is having a lot of hits. So expected usage is much high.
I think you missed some word in last statement. Is it there are many restrictions or there are not any restrictions?
Thanks
Hi Kate. Up to 20.000 hits/day....its ok for you??
ReplyDeleteHi,
DeleteYeah for now 20,000 hits per day is more than enough. Thanks for the info.
Hi, you can use this javascript snipet
ReplyDelete// include jquery
var rate = 2; // put here your live rate
var amount = 3;
var curFrom = "EUR";
var curTo = "GBP";
var total = 0;
$.ajax({
url: "http://devel.farebookings.com/api/curconversor/"+curFrom+"/"+curTo+"/"+amount+"/",
dataType: 'jsonp',
success: function (data) {
var conv = parseFloat(data[curTo]);
total = conv + (conv * rate/100);
alert(total);
}
});
Do I have to define `rate` variable? Or is it optionally?
DeleteThanks Raul!
ReplyDeleteIt really helps me
I will use your api wisely
Is there a problem with the API? I get the error timeout 504
ReplyDeleteI tested just now and work fine. Can you show me your code?. Thanks!
DeleteUntil yesterday worked perfectly, I use the API in a Ruby on Rails application for months, thanks for your work. I will try and I will comment.
ReplyDeleteThanks
Your comments will be appreciated! Thanks, again!
DeleteToday it works well again. I modified my code to catch the timeout error:
Deleteclass ExchangeRatesService
def get_conversion (from, to, amount)
begin
result = client.get do | req |
req.url "/api/curconversor/#{from}/#{to}/#{amount}/json"
req.options.timeout = 25
end
JSON.parse(result.body)["#{to}"].to_f.round(5)
rescue
-1
end
end
private
def client
client Faraday.new || = (
"http://devel.farebookings.com/"
)
end
end
Thanks!
Server down? I get "404: File Not Found"
ReplyDeleteYes, we are working on. It'll solved in 1 hour
DeleteNow is working again.
DeleteThanks.
Thanks Raul!
DeleteThis comment has been removed by the author.
ReplyDeleteHow do you use this in ionic with angularjs?
ReplyDeleteDo i need to use $http?
can you give me some example code please
Hi Carl,
Deletebetter ask to angular developers, I can't help you in this kind of mobile/app/web technologies
i am not getting the alert in success or error block ? i dont know what error is in code ?
ReplyDelete$.ajax({
cache : false,
type : "get",
url : "http://devel.farebookings.com/api/curconversor/EUR/GBP/1/",
dataType : 'jsonp',
success : function(result){
alert("in success")
var items = $.parseJSON(result);
alert(item.CAD);
},
error : function(xhr){
alert(xhr.status + " " + xhr.statusText + " " + xhr.responseText)
return;
}
});
Hi Sabarish,
Deletethe response have not any error, but you are getting 'CAD' item that is undefined in ajax call url param. It must be 'GBP' in this case.
The correct url param in this case is:
http://devel.farebookings.com/api/curconversor/EUR/CAD/1/
Cheers!
Hi Raul ,
ReplyDeleteThanks for you reply ....... you are right i coded wrongly.... if i used it as http://devel.farebookings.com/api/curconversor/EUR/CAD/1/ also not even getting an alert "in success"
Hi again,
DeleteYou don't need parse result,
just only get result item in this way:
alert(result.CAD);
$.ajax({
Deletecache : false,
type : "get",
url : "http://devel.farebookings.com/api/curconversor/EUR/CAD/1/",
dataType : 'jsonp',
success : function(result){
alert("in success")
alert(result.CAD)
},
error : function(xhr){
alert(xhr.status + " " + xhr.statusText + " " + xhr.responseText)
return;
}
});
can i get response from https site to this api
ReplyDeleteYes.
Deletewe are you using this api last more then one year but yesterday we found it will not work and give 503 error message .
ReplyDeleteso is it under maintenance or stop giving free support for exchange currency rates ?
if you have any paid plan then also let me know as soon as possible.
send me your paid plan details on puravshah6@gmail.com.
we are ready to buy your paid service so please inform us as soon as possible.
It was a technical issue, It's solved now. Sorry for the inconvenience.
DeleteIs it support cryptocurrencies like bitcoin and ether?
ReplyDeleteDoesn't support bitcoin conversion. Sorry.
Deletehttp://devel.farebookings.com/api/curconversor/INR/BTC/1000
ReplyDeletethe above is not working, getting 404 Page Not Found error
Hi, manda
DeleteFirst, you forget slash at the end of sentence, and by the other side, api doesn't support bitcoin conversion.
Thanks!!
How will I code using Volley api in Android
ReplyDeleteSorry but I haven't knowlegdment about Volley API for Android
DeleteHi, getting Error 404 not found. Please assist, thanks.
ReplyDeleteYes, we are working on
DeleteThis comment has been removed by the author.
ReplyDeleteThis site will no longer be active?
ReplyDelete