
org.knowm.xchange.binance.Binance Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-binance Show documentation
Show all versions of xchange-binance Show documentation
Development fork. Not for general use.
The newest version!
package org.knowm.xchange.binance;
import java.io.IOException;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.knowm.xchange.binance.dto.BinanceException;
import org.knowm.xchange.binance.dto.marketdata.BinanceAggTrades;
import org.knowm.xchange.binance.dto.marketdata.BinanceOrderbook;
import org.knowm.xchange.binance.dto.marketdata.BinancePrice;
import org.knowm.xchange.binance.dto.marketdata.BinancePriceQuantity;
import org.knowm.xchange.binance.dto.marketdata.BinanceTicker24h;
import org.knowm.xchange.binance.dto.meta.BinanceTime;
import org.knowm.xchange.binance.dto.meta.exchangeinfo.BinanceExchangeInfo;
@Path("")
@Produces(MediaType.APPLICATION_JSON)
public interface Binance {
@GET
@Path("api/v1/ping")
/**
* Test connectivity to the Rest API.
*
* @return
* @throws IOException
*/
Object ping() throws IOException;
@GET
@Path("api/v1/time")
/**
* Test connectivity to the Rest API and get the current server time.
*
* @return
* @throws IOException
*/
BinanceTime time() throws IOException;
@GET
@Path("api/v1/exchangeInfo")
/**
* Current exchange trading rules and symbol information.
*
* @return
* @throws IOException
*/
BinanceExchangeInfo exchangeInfo() throws IOException;
@GET
@Path("api/v1/depth")
/**
* @param symbol
* @param limit optional, default 100; max 100.
* @return
* @throws IOException
* @throws BinanceException
*/
BinanceOrderbook depth(@QueryParam("symbol") String symbol, @QueryParam("limit") Integer limit)
throws IOException, BinanceException;
@GET
@Path("api/v1/aggTrades")
/**
* 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.
*
* @param symbol
* @param fromId optional, ID to get aggregate trades from INCLUSIVE.
* @param startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
* @param endTime optional, Timestamp in ms to get aggregate trades until INCLUSIVE.
* @param limit optional, Default 500; max 500.
* @return
* @throws IOException
* @throws BinanceException
*/
List 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
@Path("api/v1/klines")
/**
* 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.
*
* @param symbol
* @param interval
* @param limit optional, default 500; max 500.
* @param startTime optional
* @param endTime optional
* @return
* @throws IOException
* @throws BinanceException
*/
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy