gdax-java
gdax-java copied to clipboard
Pricing API? How do I get buy, sell or spot prices?
I see coinbase has a Pricing API to retrieve all these details, but didn't find anything in the GDAX documentation? Should I use coinbase API for pricing instead?
You have a few choices.
- For the best bid/ask you will need to call the MarketDataService.getMarketData(product, level) which will return a MarketData object with bids/asks. Do with this what you will. Request level 1 data
- For the top 50 I believe you can do a level 2 getMarketData request - this will return something like the top 50 bids/asks in the same way as above.
- Download the entire orderbook as it currently stands - this is a level 3 request for the product Id. This will provide a snapshot in time of all bids/asks.
- to maintain a live orderbook - this is being worked on and will be available as soon as reasonably possible.
Please see the GDAX documentation for more info https://docs.gdax.com/#market-data
Better documentation needed in this lib so people don't get lost in the Gdax Api Docs
Live orderbook is completed now. Just need a few minor tweaks and I can probably create a pull request tomorrow.