Code Monkey home page Code Monkey logo

exchange-rate's Introduction

exchange-rate

说明:

由于coinmarketcap关闭了他们的免费api,而统计比较公认的权威和完善的汇率数据主要来自于coinmarketcap和非小号,本程序为通过http和爬虫获取汇率数据。

获取加密货币的实时汇率,获取货币的美元、人民币和比特币等102种计价币的价格

当前版本支持非小号上交易排名前100的币种,需要拓展更多币种的价格可以修改源码中的url做翻页等方式。

  • 2019-1-8 正式发布OceanBBBBbb/exchange-rate
  • 2019-8-7 今日进行了更新:coinmarketcap更改了页面,修改了页面解析;非小号修改了api地址。
  • 2019-12-3 更新readme,增加对外接口演示地址

使用方法:

下载后打包引入。 公共仓库maven:

我把这个放线上了,可以直接调用查看效果,
比如查比特币的实时美元价:
https://www.361shipin.com/shipin/others/rate/get?coin=BTC&currency=USD

代码示例:

本地调用示例.

    System.out.println(getCoinPrice("BTC",Currency.EUR));// 获取综合指数价(汇率)

    System.out.println(ReptileCMC.getPriceByCMC("BTC",Currency.CNY));// 获取coinmarketcap的价(汇率)

    System.out.println(ConvertFXH.getPriceByFXH("BTC",CurrencyFXH.USD));// 获取feixiaohao的价(汇率)

问题:

1.只支持查询主流的100个币,但可以自己拓展;

2.已解决.偶尔会有 javax.net.ssl.SSLHandshakeException 于是在创建client的时候,忽略了ssl认证,SslUtil.ignoreSsl

exchange-rate's People

Contributors

oceanbbbbbb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.