XChange Example Code

Wait, there's even more!

In addition to the examples found here, there is a complete demo app for most of XChange’s individual exchange implementations found in a separate module called xchange-examples. The complete source code can be found on Github

Get Bitcoin Ticker Data from Bitstamp

Java

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

/**

* Demonstrate requesting Ticker at Bitstamp. You can access both the raw data from Bitstamp or the XChange generic DTO data format.

*/

publicclassBitstampTickerDemo{

publicstaticvoidmain(String[]args)throwsIOException{

// Use the factory to get Bitstamp exchange API using default settings