如何通过诸如谷歌财经的API获取货币汇率? [英] How do I get currency exchange rates via an API such as Google Finance?

查看:383
本文介绍了如何通过诸如谷歌财经的API获取货币汇率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我确实发现了谷歌财经API ,并开始寻找通过,但我发现了很多关于组合,成交,持仓和放大器的信息;其他的东西我一无所知。

Now, I did find the Google Finance API and started looking through that but I found a lot of info about portfolios, transactions, positions & other stuff I know nothing about.

我是不是看错文档?我需要什么做的就是汇率从GF饲料?这甚至可能?

Am I looking at the wrong docs? What do I need to do to get a feed of exchange rates from GF? Is this even possible?

修改

为了让事情更清晰一点。我不感兴趣的技术性的东西我也不希望任何code。

To make things a little clearer. I'm not interested in technical stuff nor do I want any code.

推荐答案

感谢您的答案。

有关后人在这里他们与其他可能的答案一起:

For posterity here they are along with other possible answers:


  1. 雅虎财经API

    请求:<一href=\"http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDINR=X\">http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDINR=X

    这个CSV正被称为一个jQuery插件<一个href=\"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22USDEUR%22,%20%22USDJPY%22,%20%22USDBGN%22,%20%22USDCZK%22,%20%22USDDKK%22,%20%22USDGBP%22,%20%22USDHUF%22,%20%22USDLTL%22,%20%22USDLVL%22,%20%22USDPLN%22,%20%22USDRON%22,%20%22USDSEK%22,%20%22USDCHF%22,%20%22USDNOK%22,%20%22USDHRK%22,%20%22USDRUB%22,%20%22USDTRY%22,%20%22USDAUD%22,%20%22USDBRL%22,%20%22USDCAD%22,%20%22USDCNY%22,%20%22USDHKD%22,%20%22USDIDR%22,%20%22USDILS%22,%20%22USDINR%22,%20%22USDKRW%22,%20%22USDMXN%22,%20%22USDMYR%22,%20%22USDNZD%22,%20%22USDPHP%22,%20%22USDSGD%22,%20%22USDTHB%22,%20%22USDZAR%22,%20%22USDISK%22)&env=store://datatables.org/alltableswithkeys\">Curry.
    如果你需要的不仅仅是一个CSV更可能是有用的。

  1. Yahoo finance API

    Request: http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDINR=X
    This CSV is being used by a jQuery plugin called Curry. Might be useful if you need more than just a CSV.

感谢KEYO 雅虎查询语言让你得到一个整体XML或JSON一堆货币的一次。由第二数据更新(而欧洲央行(ECB)有一天,老数据),并在周末停止。不需要任何形式的报名。

(thanks to Keyo) Yahoo Query Language lets you get a whole bunch of currencies at once in XML or JSON. The data updates by the second (whereas the European Central Bank has day old data), and stops in the weekend. Doesn't require any kind of sign up.

<一个href=\"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22USDEUR%22,%20%22USDJPY%22,%20%22USDBGN%22,%20%22USDCZK%22,%20%22USDDKK%22,%20%22USDGBP%22,%20%22USDHUF%22,%20%22USDLTL%22,%20%22USDLVL%22,%20%22USDPLN%22,%20%22USDRON%22,%20%22USDSEK%22,%20%22USDCHF%22,%20%22USDNOK%22,%20%22USDHRK%22,%20%22USDRUB%22,%20%22USDTRY%22,%20%22USDAUD%22,%20%22USDBRL%22,%20%22USDCAD%22,%20%22USDCNY%22,%20%22USDHKD%22,%20%22USDIDR%22,%20%22USDILS%22,%20%22USDINR%22,%20%22USDKRW%22,%20%22USDMXN%22,%20%22USDMYR%22,%20%22USDNZD%22,%20%22USDPHP%22,%20%22USDSGD%22,%20%22USDTHB%22,%20%22USDZAR%22,%20%22USDISK%22)&env=store://datatables.org/alltableswithkeys\">http://query.yahooapis.com/v1/public/yql?q=select *从yahoo.finance.xchange那里对在(USDEUR,情绪指数,USDBGN,USDCZK,USDDKK,USDGBP,USDHUF,USDLTL,USDLVL,USDPLN USDRON,USDSEK,情绪指数,美元兑挪威克朗,USDHRK,USDRUB,USDTRY,USDAUD,USDBRL,情绪指数,美元兑人民币,USDHKD, USDIDR,USDILS,USDINR,USDKRW,USDMXN,USDMYR,USDNZD,USDPHP,USDSGD,USDTHB,USDZAR,USDISK)及包膜=店://datatables.org/alltableswithkeys

下面是YQL查询生成器,在那里你可以测试查询并复制网址:

Here is the YQL query builder, where you can test a query and copy the url:

<一个href=\"http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22USDMXN%22%2C%20%22USDCHF%22%29\">http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22USDMXN%22%2C%20%22USDCHF%22%29

请求:<一href=\"http://rate-exchange.appspot.com/currency?from=USD&to=EUR\">http://rate-exchange.appspot.com/currency?from=USD&to=EUR

回应:

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

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

结果
这里的基础上,谷歌API(来源另一JSON(P)API:<一href=\"http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22USDMXN%22%2C%20%22USDCHF%22%29\">this评论):结果<一个href=\"http://rate-exchange.appspot.com/currency?from=USD&to=EUR&q=1\">http://rate-exchange.appspot.com/currency?from=USD&to=EUR&q=1

免费供个人使用(每月1000次点击)结果
更改基地(选自USD)是不允许免费帐户结果
需要注册。结果
要求: http://openexchangerates.org/latest.json 结果
回应:

Free for personal use (1000 hits per month)
Changing "base" (from "USD") is not allowed in Free account
Requires registration.
Request: http://openexchangerates.org/latest.json
Response:

{
  "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 ...
  }
}


  • currencylayer API

    免费计划 1,000每月点击搜索
    需要注册。结果
    文档: currencylayer.com/documentation 搜索结果
    JSON响应:

  • currencylayer API

    Free Plan for 1,000 monthly hits
    Requires registration.
    Documentation: currencylayer.com/documentation

    JSON Response:

    {
      [...]
      "timestamp": 1436284516,
      "source": "USD",
      "quotes": {
          "USDAUD": 1.345352401,
          "USDCAD": 1.27373397,
          "USDCHF": 0.947845302,
          "USDEUR": 0.91313905,
          "USDGBP": 0.647603397,
          // 168 world currencies
          }
      }
    


  • 欧洲央行饲料

    文件:<一href=\"http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html#dev\">http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html#dev

    请求:<一href=\"http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml\">http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml


    XML响应:

  • European Central Bank Feed

    Docs: http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html#dev
    Request: http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml

    XML Response:

    <Cube>
      <Cube time="2015-07-07">
      <Cube currency="USD" rate="1.0931"/>
      <Cube currency="JPY" rate="133.88"/>
      <Cube currency="BGN" rate="1.9558"/>
      <Cube currency="CZK" rate="27.100"/>
    </Cube>
    


  • Fixer.io API(欧洲央行的数据)

    网站: http://fixer.io/ 结果
    请求示例:
    http://api.fixer.io/latest?base=USD

    回答瑞安。

    这篇关于如何通过诸如谷歌财经的API获取货币汇率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆