适用于Android的Exchange Rate API

时间:2013-02-28 05:52:31

标签: java android eclipse exchangewebservices

我需要创建一个Android应用,它可以获得实时更新的货币汇率。有没有为此目的的Android(免费)API?我做了一个搜索,没有发现与android有关。请帮忙。

3 个答案:

答案 0 :(得分:5)

对于后人,这里有其他可能的答案:

Google汇率查询(已解析)

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

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

基于此评论。

开放汇率API

每月最多可达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 ...
 }
}

欧洲央行饲料

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

雅虎财务API

更新 - 2017年11月) 自2017-11-06起停止发布消息:

  

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

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

[update]这个CSV由名为Curry的jQuery插件使用。如果您需要的不仅仅是CSV,那么它可能会很有用。

答案 1 :(得分:2)

Google汇率查询(已解析)

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

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

这是另一个JSON(P)API

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

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

http://themoneyconverter.com/RSSFeeds.aspx

尝试使用这些链接轻松学习JSON:

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

答案 2 :(得分:1)

嗨您可能会询问货币兑换率,对吧?试试 Google财经API

Google Finance


尝试 Yahoo finance

[更新]雅虎财务API已于2017-11-06停止

在网址

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

INR - 是印度卢比 - 来自 美元 - 美元 - 至

提供任何国家/地区卢比名称。

示例:

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