eclipse 适用于 Android 的汇率 API

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15128415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:05:03  来源:igfitidea点击:

Exchange Rate API for Android

javaandroideclipseexchangewebservices

提问by Lemon Juice

I need to create an android app where it gets the live updated currency exchange rates. Is there any android (free) API for this purpose? I did a search and nothing found related to android. Please help.

我需要创建一个 android 应用程序来获取实时更新的货币汇率。是否有任何用于此目的的 android(免费)API?我进行了搜索,没有发现与 android 相关的任何内容。请帮忙。

回答by AndroidEnthusiastic

For posterity here they are along with other possible answers:

对于这里的后代,它们与其他可能的答案一起:

Google exchange rate query (parsed)

谷歌汇率查询(解析)

Request: http://rate-exchange.appspot.com/currency?from=USD&to=EURResponse:

请求:http: //rate-exchange.appspot.com/currency? from=USD& to= EUR响应:

{"to": "EUR", "rate": 0.76911244400000001, "from": "USD"}

Based on this comment.

基于此评论。

Open Exchange Rates API

开放汇率 API

Free for up to 1000 hits per month. Request: http://openexchangerates.org/latest.jsonResponse:

每月最多可免费获得 1000 次点击。请求:http: //openexchangerates.org/latest.json响应:

{

 "disclaimer": "This data is collected from various providers ...",
  "license": "all code open-source under GPL v3 ...",
  "timestamp": 1323115901,
  "base": "USD",
  "rates": {
  "AED": 3.66999725,
  "ALL": 102.09382091,
  "ANG": 1.78992886,
  // 115 more currency rates here ...
 }
}

European Central Bank Feed

欧洲中央银行饲料

Docs: http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html#devRequest: http://www.ecb.int/stats/eurofxref/eurofxref-daily.xmlResponse: In response it will return a xml file with 28 currencies.

文档:http: //www.ecb.int/stats/exchange/eurofxref/html/index.en.html#dev请求:http: //www.ecb.int/stats/eurofxref/eurofxref-daily.xml响应:作为响应,它将返回一个包含 28 种货币的 xml 文件。

Yahoo finance API

雅虎财经API

(UPDATE - November 2017) Discontinued as of 2017-11-06 with message:

更新 - 2017 年 11 月)自2017 年 11 月 6 日起停止使用,消息如下:

It has come to our attenion that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.

我们注意到该服务的使用违反了雅虎服务条款。因此,该服务将停止。所有期货市场和股票数据研究,请参阅finance.yahoo.com。

Request: http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDINR=XIn response it will return a csv file.

请求:http: //finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDINR = X作为响应,它将返回一个 csv 文件。

[update] This CSV is being used by a jQuery plugin called Curry. Might be useful if you need more than just a CSV.

[更新] 一个名为 Curry 的 jQuery 插件正在使用这个 CSV。如果您需要的不仅仅是 CSV,可能会很有用。

回答by The Holy Coder

Google exchange rate query (parsed)

谷歌汇率查询(解析)

Request: http://rate-exchange.appspot.com/currency?from=USD&to=EURResponse:

请求:http: //rate-exchange.appspot.com/currency? from=USD& to= EUR响应:

{"to": "EUR", "rate": 0.76911244400000001, "from": "USD"}

Here is another JSON(P) API

这是另一个 JSON(P) API

http://rate-exchange.appspot.com/currency?from=USD&to=EUR&q=1based on the Google API.

http://rate-exchange.appspot.com/currency?from=USD&to=EUR&q=1基于 Google API。

If you want to work with RSS Feed then use

如果您想使用 RSS Feed,请使用

http://themoneyconverter.com/RSSFeeds.aspx

http://themoneyconverter.com/RSSFeeds.aspx

Try these link to learn JSON easily :

试试这些链接来轻松学习 JSON:

http://www.androidhive.info/2012/01/android-json-parsing-tutorial/

http://www.androidhive.info/2012/01/android-json-parsing-tutorial/

回答by Pragnani

Hi You may be asking about currency exchage rates, right? Try Google finance API:

嗨,您可能会问货币兑换率,对吗?试试谷歌金融 API

Google Finance

谷歌财经



Try Yahoo finance

试试雅虎财经

[UPDATE] Yahoo finance API is discontinued from 2017-11-06

[更新] 雅虎财经 API 于 2017-11-06 停产

In the url

在网址中

http://finance.yahoo.com/d/quotes.csv?e=goog.csv&f=sl1d1t1&s=INRUSD=x

http://finance.yahoo.com/d/quotes.csv?e=goog.csv&f=sl1d1t1&s=INRUSD=x

INR -- is Indian rupee - from USD -- US Dollar - To

INR——是印度卢比——从美元——美元——到

Give any country rupees Name in place.

为任何国家/地区卢比命名。

Example :

例子 :

countrieshash.put("India", "INR");
        countrieshash.put("USA", "USD");
        countrieshash.put("GreatBritain", "GBP");
        countrieshash.put("Japan", "JPY");
        countrieshash.put("Australia", "AUD");
        countrieshash.put("Europe", "EUR");
        countrieshash.put("Canada", "CAD");
        countrieshash.put("France", "CHF");
        countrieshash.put("China", "CNY");
        countrieshash.put("kuwait", "KWD");
        countrieshash.put("UAE", "AED");

Yahoo finance

雅虎财经