Skip to content
XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
Java
Branch: develop
Clone or download
walec51 Merge pull request #3236 from makarid/kraken-token
[Kraken]Adding new Kraken endpoint getKrakenWebsocketToken.
Latest commit f285a70 Sep 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
etc remove some random, reformat Apr 4, 2018
xchange-acx [acx] - Updated metadata, implemented getTradeHistory, fixed bug that… Sep 20, 2019
xchange-anx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bankera [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bibox [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-binance [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitbay [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitcoinaverage [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitcoincharts [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitcoincore [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitcoinde [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitcoinium [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitcointoyou [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitfinex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitflyer [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bithumb [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitmex cleanUps Sep 15, 2019
xchange-bitso [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitstamp Fixed bitstamp withdrawal fees Sep 18, 2019
xchange-bittrex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bity [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bitz [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bl3p [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bleutrade [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-blockchain [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-btcc [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-btcmarkets [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-btctrade [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-btcturk [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-bx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-campbx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-ccex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-cexio [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-cobinhood [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinbase [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinbasepro [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinbene [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coindeal [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coindirect [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinegg [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinfloor [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coingi [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinmarketcap [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinmate [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinone [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-coinsuper [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-core Adding exception throw support. Sep 20, 2019
xchange-cryptofacilities [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-cryptonit [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-cryptopia [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-deribit [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-dragonex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-dsx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-dvchain [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-enigma [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-examples [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-exmo [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-exx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-fcoin [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-gateio [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-gemini [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-globitex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-hitbtc [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-huobi [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-idex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-independentreserve [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-itbit [ItBit] Include fill fee rebates Sep 17, 2019
xchange-koineks [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-koinim [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-kraken Adding new Kraken endpoint getKrakenWebsocketToken. This tokens needs… Sep 20, 2019
xchange-kucoin [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-kuna [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-lakebtc [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-lgo [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-liqui [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-livecoin [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-luno [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-lykke [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-mercadobitcoin [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-okcoin Clean install annd running tests Sep 20, 2019
xchange-openexchangerates [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-paribu [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-paymium [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-poloniex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-quadrigacx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-quoine [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-ripple [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-simulated [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-therock [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-tradeogre bump version to 4.4.0-SNAPSHOT Sep 11, 2019
xchange-truefx [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-upbit [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-vaultoro [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-wex [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-yobit [maven-release-plugin] prepare for next development iteration Sep 15, 2019
xchange-zaif [maven-release-plugin] prepare for next development iteration Sep 15, 2019
.gitattributes this will reduce whitespace churn Apr 3, 2018
.gitignore [resolves #1205] Update Coinbase Api to use the new Coinbase Exchange… Dec 27, 2017
.travis.yml attempt to fix timeout issue on Travis CI (2) Aug 15, 2019
CONTRIBUTORS prepare for 4.3.19 release Jun 4, 2019
LICENSE prepare for 4.3.18 release May 7, 2019
README.md prepare for 4.4.0 release Sep 15, 2019
pom.xml [maven-release-plugin] prepare for next development iteration Sep 15, 2019

README.md

XChange XChange

Join the chat at https://gitter.im/Java-XChange/Lobby

XChange is a Java library providing a simple and consistent API for interacting with 60+ Bitcoin and other crypto currency exchanges providing a consistent interface for trading and accessing market data.

Important!

The world of Bitcoin changes quickly and XChange is no exception. For the latest bugfixes and features you should use the [snapshot jars] (https://oss.sonatype.org/content/groups/public/org/knowm/xchange/) or build yourself from the DEVELOP branch. See below for more details about building with Maven. To report bugs and see what issues people are currently working on see the issues page.

Description

XChange is a library providing a simple and consistent API for interacting with a diverse set of crypto currency exchanges.

Usage is very simple: Create an Exchange instance, get the appropriate service, and request data.

Example 1: Public Market Data

Exchange bitstamp = ExchangeFactory.INSTANCE.createExchange(BitstampExchange.class.getName());

MarketDataService marketDataService = bitstamp.getMarketDataService();

Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);

System.out.println(ticker.toString());

Example 2: Private Account Info

To use the private API services, AccountService and TradeService, create an ExchangeSpecification with a unique API key and secret key (in some cases more info is required), which you obtain through the exchange's web interface. For more examples of adding the keys to the ExchangeSpecification including storing them in a configuration file, see Frequently Asked Questions.

ExchangeSpecification exSpec = new BitstampExchange().getDefaultExchangeSpecification();
exSpec.setUserName("34387");
exSpec.setApiKey("a4SDmpl9s6xWJS5fkKRT6yn41vXuY0AM");
exSpec.setSecretKey("sisJixU6Xd0d1yr6w02EHCb9UwYzTNuj");
Exchange bitstamp = ExchangeFactory.INSTANCE.createExchange(exSpec);

// Get the account information
AccountService accountService = bitstamp.getAccountService();
AccountInfo accountInfo = accountService.getAccountInfo();
System.out.println(accountInfo.toString());

All exchange implementations expose the same API, but you can also directly access the underlying "raw" data from the individual exchanges if you need to.

Now go ahead and study some more examples, download the thing and provide feedback.

Features

  • MIT license
  • consistent API across all implemented exchanges
  • active development
  • very minimal 3rd party dependencies
  • modular components

More Info

Project Site: http://knowm.org/open-source/xchange
Example Code: http://knowm.org/open-source/xchange/xchange-example-code
Change Log: http://knowm.org/open-source/xchange/xchange-change-log/
Java Docs: http://knowm.org/javadocs/xchange/index.html

Looking for streaming API? Use library xchange-stream based on XChange.

Wiki

Continuous Integration

Build Status Build History

Getting Started

Non-Maven

Download XChange Release Jars: http://search.maven.org/#search%7Cga%7C1%7Cknowm%20xchange

Download XChange Snapshot Jars: https://oss.sonatype.org/content/groups/public/org/knowm/xchange/

Maven

The XChange release artifacts are hosted on Maven Central.

Add the following dependencies in your pom.xml file. You will need at least xchange-core. Add the additional dependencies for the exchange modules you are interested in (XYZ shown only for a placeholder). There is example code for all the modules in xchange-examples.

<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-core</artifactId>
  <version>4.4.0</version>
</dependency>
<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-examples</artifactId>
  <version>4.4.0</version>
</dependency>
<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-XYZ</artifactId>
  <version>4.4.0</version>
</dependency>

For snapshots, add the following repository to your pom.xml file.

<repository>
  <id>sonatype-oss-snapshot</id>
  <snapshots/>
  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

The current snapshot version is:

4.4.1-SNAPSHOT

Building with Maven

run unit tests: mvn clean test
run unit and integration tests: mvn clean verify -DskipIntegrationTests=false
install in local Maven repo: mvn clean install
create project javadocs: mvn javadoc:aggregate
generate dependency tree: mvn dependency:tree
check for dependency updates: mvn versions:display-dependency-updates
check for plugin updates: mvn versions:display-plugin-updates
code format: mvn com.coveo:fmt-maven-plugin:format

Bugs

Please report any bugs or submit feature requests to XChange's Github issue tracker.

Contributing

If you'd like to submit a new implementation for another exchange, please take a look at New Implementation Best Practices first, as there are lots of time-saving tips!

For more information such as a contributor list and a list of known projects depending on XChange, visit the Main Project Wiki.

You can’t perform that action at this time.