Bybit
Simple and easy to use bybit API abstraction defined using the official documentation.
Official API Documentation: https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md
Initialize & Use
Below is a short guide on how to use the client.
Register your APIKEY
testnet
: https://testnet.bybit.com/user/api-managementmainnet
: https://www.bybit.com/app/user/api-management
Configure/Init Client
baseURL.testnet
: https://api-testnet.bybit.combaseURL.mainnet
: https://api.bybit.comkey
: APIKeysecret
: Private Key
const client = baseURL: 'https://api.bybit.com' key: '' secret: ''
Call Something
client
Interface
Methods provided by the client.
listActiveOrders
List your Active orders.
options
- Optional api params
client
getActiveOrder
Get a previously created Active order.
id
- Order ID. The unique order ID returned to you when the corresponding order was created.options
- Optional api params
client
cancelActiveOrder
Canel a previously created Active order.
id
- Order ID. The unique order ID returned to you when the corresponding order was created.
client
createOrder
Create a new order.
client
limitBuy
Create a limit buy order.
price
- Order Priceqty
- Number of Contractsoptions
- Optional api params
client
limitSell
Create a limit sell order.
price
- Order Priceqty
- Number of Contractsoptions
- Optional api params
client
marketBuy
Create a market buy order.
qty
- Number of Contractsoptions
- Optional api params
client
marketSell
Create a market sell order.
qty
- Number of Contractsoptions
- Optional api params
client
createConditionalOrder
Create a new order.
options
- Optional api params
client
listConditionalOrders
List conditional orders.
options
- Optional api params
client
getConditionalOrder
Get a previously created Conditional order.
options
- Optional api params
client
cancelConditionalOrder
Canel a previously created Conditional order.
id
- Order ID. The unique order ID returned to you when the corresponding order was created.
client
listMyLeverage
List symbol leverage settings.
client
setMyLeverage
Set symbol leverage setting.
symbol
- Contract typeleverage
- Leverage value
client
listMyPositions
List your positions.
client
updatePoisitionMargin
Update position margin allocation.
symbol
- Contract typemargin
- margin value
client
getFundingRate
Get the current funding rate. Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC
symbol
- Contract type
client
getMyFundingFee
Get the provious funding fee. Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC
symbol
- Contract type
client
getMyPredictedFunding
Get your predictied funding rate and fee.
symbol
- Contract type
client
listOrderTrades
List trades placed to fill and order.
id
- order id
client
getOrderbookSnapshot
Get the current state of the orderbook.
symbol
- Contract type
client
listTickers
List all available ticker data. ( price, ect... )
client
getTicker
get current ticker data.
symbol
- Contract type
client