XChange is a Java library providing a simple and consistent API for interacting with 50+ Bitcoin and other crypto currency exchanges providing a consistent interface for trading and accessing market data.
The world of Bitcoin changes quickly and XChange is no exception. The best way to stay updated on important announcements is to follow tweets on Knowm's Twitter page. 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. There are also most likely some open bounties to be had as well.
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.
Exchange bitstamp = ExchangeFactory.INSTANCE.createExchange(BitstampExchange.class.getName());
MarketDataService marketDataService = bitstamp.getMarketDataService();
Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);
System.out.println(ticker.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.
- MIT license
- consistent API across all implemented exchanges
- active development
- very minimal 3rd party dependencies
- modular components
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.
Home: https://github.com/timmolter/XChange/wiki
Design Notes: https://github.com/timmolter/XChange/wiki/Design-Notes
Milestones: https://github.com/timmolter/XChange/wiki/Milestones
Exchange Support: https://github.com/timmolter/XChange/wiki/Exchange-support
New Implementation Best Practices: https://github.com/timmolter/XChange/wiki/New-Implementation-Best-Practices
Installing SSL Certificates into TrustStore: https://github.com/timmolter/XChange/wiki/Installing-SSL-Certificates-into-TrustStore
Getting Started with XChange for Noobies: https://github.com/timmolter/XChange/wiki/Getting-Started-with-XChange-for-Noobies
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/
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.2.0</version>
</dependency>
<dependency>
<groupId>org.knowm.xchange</groupId>
<artifactId>xchange-examples</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.knowm.xchange</groupId>
<artifactId>xchange-XYZ</artifactId>
<version>4.2.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.2.1-SNAPSHOT
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
Please report any bugs or submit feature requests to XChange's Github issue tracker.
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.
Donate with Bitcoin: 1JVyTP9v9z54dALuhDTZDQfS6FUjcKjPgZ
All donations will be used to pay bounties for new features, refactoring, etc. Please consider donating or even posting your own bounties on our Issues Page. Open bounties and bounties paid thus far can be found on knowm's bounties page.