[英]Live currency rate using Yahoo Finance API
Live currency rate using Yahoo Finance API works perfectly in India, but not working in UAE.使用 Yahoo Finance API 的实时货币汇率在印度运行良好,但在阿联酋不起作用。 Is their any IP checking for getting this value using Yahoo Finance API?他们是否有任何 IP 检查以使用 Yahoo Finance API 获取此值?
We have done this using Yahoo Finance API using JavaScript and PHP.我们使用 JavaScript 和 PHP 使用 Yahoo Finance API 完成了这项工作。 The code is given below.代码如下。
function currencyConverter(currency_from,currency_to,currency_input){
var yql_base_url = "https://query.yahooapis.com/v1/public/yql";
var yql_query = 'select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20("'+currency_from+currency_to+'")';
var yql_query_url = yql_base_url + "?q=" + yql_query + "&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys";
var http_response = httpGet(yql_query_url);
var http_response_json = JSON.parse(http_response);
return http_response_json.query.results.rate.Rate;
}
Can any one suggest any other free API for getting live currency rates without having any IP address checking using JavaScript/jQuery and PHP?任何人都可以建议任何其他免费 API 来获取实时货币汇率,而无需使用 JavaScript/jQuery 和 PHP 检查任何 IP 地址?
Google has a currency conversion tool, which can be used easily .谷歌有货币换算工具,使用起来很方便。 You can see the code sample here : http://www.stepblogging.com/how-to-convert-currency-using-google-api-and-php/您可以在此处查看代码示例: http : //www.stepblogging.com/how-to-convert-currency-using-google-api-and-php/
For the past couple of years I've been using a currency widget based on yahoo currency API, and it has suddenly stopped working.在过去的几年里,我一直在使用基于雅虎货币 API 的货币小部件,但它突然停止工作。 As the code above is different, I wonder if yahoo changed the code or is simply having problems.由于上面的代码不同,我想知道是yahoo更改了代码还是只是有问题。 I used to be able to access it directly by putting the following url in the address bar but it no longer works either.我曾经可以通过将以下网址放在地址栏中直接访问它,但它也不再起作用。
http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ( "EURAED","EURARS","EURAUD","EURAWG","EURBAM","EURBBD","EURBDT","EURBGN","EURBHD","EURBMD","EURBOB", "EURBRL","EURBSD","EURCAD","EURCHF","EURCLP","EURCNY","EURCOP","EURCYP","EURCZK","EURDKK","EURDOP", "EUREGP","EUREUR","EURFJD","EURGBP","EURGHS","EURGMD","EURGTQ","EURHKD","EURHRK","EURHUF","EURIDR", "EURILS","EURINR","EURIRR","EURISK","EURJMD","EURJOD","EURJPY","EURKES","EURKHR","EURKRW","EURKWD", "EURLAK","EURLBP","EURLKR","EURLTL","EURLVL","EURMAD","EURMDL","EURMGA","EURMKD","EURMUR","EURMVR", "EURMXN","EURMYR","EURNAD","EURNGN","EURNOK","EURNPR","EURNZD","EUROMR","EURPAB","EURPEN","EURPHP", "EURPKR","EURPLN","EURPYG","EURQAR","EURRON","EURRSD","EURRUB","EURSAR","EURSCR","EURSEK","EURSGD", "EURSYP","EURTHB","EURTND","EURTRY","EURTWD","EURUAH","EURUGX","EURUSD","EURUYU","EURVEF","EURVND", "EURXAF","EURXCD","EURXOF","EURXPF","EURZAR")&env=store://datatables.org/alltableswithkeys http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("EURAED","EURARS","EURAUD","EURAWG","EURBAM", “EURBBD”、“EURBDT”、“EURBGN”、“EURBHD”、“EURBMD”、“EURBOB”、“EURBRL”、“EURBSD”、“EURCAD”、“EURCHF”、“EURCLP”、“EURCNY”、“EURCOP” ","EURCYP","EURCZK","EURDKK","EURDOP","EUREGP","EUREUR","EURFJD","EURGBP","EURGHS","EURGMD","EURGTQ","EURHKD", “EURHRK”、“EURHUF”、“EURIDR”、“EURILS”、“EURINR”、“EURIRR”、“EURISK”、“EURJMD”、“EURJOD”、“EURJPY”、“EURKES”、“EURKHR”、“EURKRW” ","EURKWD", "EURLAK","EURLBP","EURLKR","EURLTL","EURLVL","EURMAD","EURMDL","EURMGA","EURMKD","EURMUR","EURMVR", “EURMXN”、“EURMYR”、“EURNAD”、“EURNGN”、“EURNOK”、“EURNPR”、“EURNZD”、“EUROMR”、“EURPAB”、“EURPEN”、“EURPHP”、“EURPKR”、“EURPLN” ","EURPYG","EURQAR","EURRON","EURRSD","EURRUB","EURSAR","EURSCR","EURSEK","EURSGD","EURSYP","EURTHB","EURTND", “EURTRY”、“EURTWD”、“EURUAH”、“EURUGX”、“EURUSD”、“EURUYU”、“EURVEF”、“EURVND”、“EURXAF”、“EURXCD”、“EURXOF”、“EURXPF”、“EURZAR” ")&env=store://datatables.org/alltableswithkeys
Here is simple currency conversion at这里是简单的货币换算
https://calculatorexpress.com/currency-free-api/ https://calculatorexpress.com/currency-free-api/
https://calculatorexpress.com/FOREX/EXCHANGE/?API=YOUR_API_KEY&from=BASE_CURRENCY&to=COMPACT_CURRENCY //Replace YOUR_API_KEY with free API from the site // Replace 'from' with your base currency (usd,aud etc.) // Replace 'to' with your 2nd currency // ------------- Example --------------- https://calculatorexpress.com/FOREX/EXCHANGE/?API=YOUR_API_KEY&from=usd&to=aud //you can call the coversion rate with ajax request!
calculatorexpress.com is currently providing free ssl encryption in their free plan which is quit impressive ! calculatorexpress.com 目前在他们的免费计划中提供免费的 ssl 加密,这令人印象深刻!
You can try SWOP currency exchange rate API , an easy to use, fast, reliable and transparent foreign exchange rate API made from Developers for Developers.您可以尝试SWOP 货币汇率 API ,这是一个由 Developers for Developers 制作的易于使用、快速、可靠和透明的外汇汇率 API。
Full disclaimer: I'm one of the developers of SWOP完全免责声明:我是 SWOP 的开发人员之一
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.