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
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
etc remove some random, reformat Apr 4, 2018
xchange-abucoins [abucoins] moved the oddly placed time method into the base service (… Apr 10, 2018
xchange-acx [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-anx [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-bibox gdax merge oddities Apr 3, 2018
xchange-binance [Binance] Add support for placing limit order with TimeInForce flags. Apr 5, 2018
xchange-bitbay [bitbayv3] added the trade id to user trades, and added some comments… Apr 10, 2018
xchange-bitcoinaverage [bitcoinavereage] test resources in package Apr 8, 2018
xchange-bitcoincharts find -iname *.java|xargs touch Apr 3, 2018
xchange-bitcoincore [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-bitcoinde Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-bitcoinium gdax merge oddities Apr 3, 2018
xchange-bitcointoyou gdax merge oddities Apr 3, 2018
xchange-bitfinex gdax merge oddities Apr 3, 2018
xchange-bitflyer gdax merge oddities Apr 3, 2018
xchange-bitmarket gdax merge oddities Apr 3, 2018
xchange-bitmex gdax merge oddities Apr 3, 2018
xchange-bitso [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-bitstamp gdax merge oddities Apr 3, 2018
xchange-bittrex Removed param not supported by Bittrex any more Apr 7, 2018
xchange-bitz Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-bleutrade gdax merge oddities Apr 3, 2018
xchange-blockchain Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-btcc Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-btcmarkets Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-btctrade [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-btcturk Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-campbx Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-ccex Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-cexio gdax merge oddities Apr 3, 2018
xchange-coinbase [coinbase] started refactoring the coinbase v2 implementation so that… Apr 9, 2018
xchange-coinegg gdax merge oddities Apr 3, 2018
xchange-coinfloor Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-coinmarketcap gdax merge oddities Apr 3, 2018
xchange-coinmate Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-core first endpoint from new Bitbay API Apr 9, 2018
xchange-cryptofacilities gdax merge oddities Apr 3, 2018
xchange-cryptonit Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-cryptopia Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-dsx gdax merge oddities Apr 3, 2018
xchange-empoex [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-examples examples fix Apr 7, 2018
xchange-gatecoin [gatecoin] Fixed placement of orders Apr 9, 2018
xchange-gateio gdax merge oddities Apr 3, 2018
xchange-gdax [GDAX] Adds before param to getFills Apr 8, 2018
xchange-gemini gdax merge oddities Apr 3, 2018
xchange-hitbtc Added supporting of new methods and params regarding trades and trans… Apr 6, 2018
xchange-huobi [Huobi] Fix wrong order type conversion Apr 4, 2018
xchange-independentreserve [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-itbit remove some random, reformat Apr 4, 2018
xchange-koineks Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-koinim Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-kraken remove some random, reformat Apr 4, 2018
xchange-kucoin Accidently removed instance type check Apr 7, 2018
xchange-kuna gdax merge oddities Apr 3, 2018
xchange-lakebtc gdax merge oddities Apr 3, 2018
xchange-liqui Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-livecoin [livecoin] fixed price on UserTrade Apr 9, 2018
xchange-luno [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-mercadobitcoin gdax merge oddities Apr 3, 2018
xchange-okcoin gdax merge oddities Apr 3, 2018
xchange-openexchangerates Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-paribu Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-paymium Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-poloniex Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-quadrigacx [quadrigacx] fixed orderType on UserTrade (for very small fills) Apr 9, 2018
xchange-quoine Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-ripple remove some random, reformat Apr 4, 2018
xchange-taurus gdax merge oddities Apr 3, 2018
xchange-therock Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-truefx [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-vaultoro [maven-release-plugin] prepare for next development iteration Apr 3, 2018
xchange-vircurex Merge remote-tracking branch 'origin/develop-le' into tidy Apr 3, 2018
xchange-wex [Zaif] properly identify integration test Apr 4, 2018
xchange-yobit remove some random, reformat Apr 4, 2018
xchange-zaif [Zaif] properly identify integration test Apr 4, 2018
.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 Move settings.xml for travis-ci to the main branch Feb 15, 2018
CONTRIBUTORS update contributors Apr 6, 2018
LICENSE update copyright Apr 6, 2018
README.md update timmolter ==> knowm URLs Apr 6, 2018
pom.xml update timmolter ==> knowm URLs Apr 6, 2018

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, including support for Bitcoin.

A complete list of implemented exchanges, data providers and brokers can be found on our Exchange Support page.

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.3.5</version>
</dependency>
<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-examples</artifactId>
  <version>4.3.5</version>
</dependency>
<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-XYZ</artifactId>
  <version>4.3.5</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.3.6-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 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.