Giter VIP home page Giter VIP logo

xchange's Introduction

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.7</version>
</dependency>
<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-examples</artifactId>
  <version>4.3.7</version>
</dependency>
<dependency>
  <groupId>org.knowm.xchange</groupId>
  <artifactId>xchange-XYZ</artifactId>
  <version>4.3.7</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.8-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.

xchange's People

Contributors

achterhoeker avatar andre77 avatar baffo32 avatar bryan4887 avatar bryantharris avatar cacofish avatar cymp avatar douggie avatar drawfun avatar ericanderson1000 avatar gary-rowe avatar jheusser avatar jpe42 avatar kpysniak avatar matthewdowney avatar mikelle avatar mmazi avatar npomfret avatar obsessiveorange avatar odrotleff avatar panchen avatar rafalkrupinski avatar ryanfox avatar stachon avatar sutra avatar theo1985 avatar timmolter avatar veken0m avatar ww3456 avatar zholmes1 avatar

Watchers

 avatar  avatar

Forkers

gear273

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.