Package org.knowm.xchange.binance
Interface Binance
- All Known Subinterfaces:
BinanceAuthenticated
@Path("")
@Produces("application/json")
public interface Binance
-
Method Summary
Modifier and TypeMethodDescriptionGet compressed, aggregate trades.Current exchange trading rules and symbol information.Kline/candlestick bars for a symbol.ping()
Test connectivity to the Rest API.Fetch system status which is normal or system maintenance.24 hour price change statistics for all symbols.24 hour price change statistics.Best price/qty on the order book for all symbols.Latest price for all symbols.tickerPrice
(String symbol) Latest price for a symbol.time()
Test connectivity to the Rest API and get the current server time.
-
Method Details
-
systemStatus
Fetch system status which is normal or system maintenance.- Throws:
IOException
-
ping
Test connectivity to the Rest API.- Returns:
- Throws:
IOException
-
time
Test connectivity to the Rest API and get the current server time.- Returns:
- Throws:
IOException
-
exchangeInfo
Current exchange trading rules and symbol information.- Returns:
- Throws:
IOException
-
depth
@GET @Path("api/v3/depth") BinanceOrderbook depth(@QueryParam("symbol") String symbol, @QueryParam("limit") Integer limit) throws IOException, BinanceException - Parameters:
symbol
-limit
- optional, default 100 max 5000. Valid limits: [5, 10, 20, 50, 100, 500, 1000, 5000]- Returns:
- Throws:
IOException
BinanceException
-
aggTrades
@GET @Path("api/v3/aggTrades") List<BinanceAggTrades> aggTrades(@QueryParam("symbol") String symbol, @QueryParam("fromId") Long fromId, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("limit") Integer limit) throws IOException, BinanceException Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.
If both startTime and endTime are sent, limit should not be sent AND the distance between startTime and endTime must be less than 24 hours.
If frondId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.- Parameters:
symbol
-fromId
- optional, ID to get aggregate trades from INCLUSIVE.startTime
- optional, Timestamp in ms to get aggregate trades from INCLUSIVE.endTime
- optional, Timestamp in ms to get aggregate trades until INCLUSIVE.limit
- optional, Default 500; max 500.- Returns:
- Throws:
IOException
BinanceException
-
klines
@GET @Path("api/v3/klines") List<Object[]> klines(@QueryParam("symbol") String symbol, @QueryParam("interval") String interval, @QueryParam("limit") Integer limit, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime) throws IOException, BinanceException Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
If startTime and endTime are not sent, the most recent klines are returned.- Parameters:
symbol
-interval
-limit
- optional, default 500; max 500.startTime
- optionalendTime
- optional- Returns:
- Throws:
IOException
BinanceException
-
ticker24h
@GET @Path("api/v3/ticker/24hr") List<BinanceTicker24h> ticker24h() throws IOException, BinanceException24 hour price change statistics for all symbols. - bee carreful this api call have a big weight, only about 4 call per minut can be without ban.- Returns:
- Throws:
IOException
BinanceException
-
ticker24h
@GET @Path("api/v3/ticker/24hr") BinanceTicker24h ticker24h(@QueryParam("symbol") String symbol) throws IOException, BinanceException 24 hour price change statistics.- Parameters:
symbol
-- Returns:
- Throws:
IOException
BinanceException
-
tickerPrice
@GET @Path("api/v3/ticker/price") BinancePrice tickerPrice(@QueryParam("symbol") String symbol) throws IOException, BinanceException Latest price for a symbol.- Returns:
- Throws:
IOException
BinanceException
-
tickerAllPrices
@GET @Path("api/v3/ticker/price") List<BinancePrice> tickerAllPrices() throws IOException, BinanceExceptionLatest price for all symbols.- Returns:
- Throws:
IOException
BinanceException
-
tickerAllBookTickers
@GET @Path("api/v3/ticker/bookTicker") List<BinancePriceQuantity> tickerAllBookTickers() throws IOException, BinanceExceptionBest price/qty on the order book for all symbols.- Returns:
- Throws:
IOException
BinanceException
-