Download the PHP package carpenstar/bybitapi-sdk-core without Composer
On this page you can find all versions of the php package carpenstar/bybitapi-sdk-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bybitapi-sdk-core
Bybit SDK
NOTICE: This is an unofficial SDK, from an independent developer.
Any questions you are interested in regarding the settings, information about the bugs found, you can leave in Issues, by writing to [email protected] (ru, en) or in telegram: @novisad0189
And yes - the more stars, the more actively this project will develop :-)
Requirements
- PHP >= 7.4 Additional for websockets-package:
- posix - extension
- pcntl - extension
Installation
Market Data - V5 (in developing...)
API key generation
https://testnet.bybit.com/app/user/api-management - testnet
https://www.bybit.com/app/user/api-management - production
Application instance:
REST - queries
All endpoints that can be called are divided into two types - public (not requiring authorization) and private (authorization is required for each request).
Using the Derivatives/TickerInfo endpoint as an example, let’s make a request to the exchange API:
The execute() function always returns an object after completing a request, regardless of whether the request was successful implementing the interface Carpenstar\ByBitAPI\Core\Interfaces\IResponseInterface
To get the main body of the response, call the getResult function, which will return a DTO object containing information about the ticker.
In the case of the TickerInfo endpoint, this DTO will be an object that implements the Carpenstar\ByBitAPI\Derivatives\MarketData\TickerInfo\Interfaces\TickerInfoResponse interface
Next, calling the getTickerInfo() function will allow us to get an object with information about the ticker (the following DTO implements the ITickerInfoResponseItemInterface interface):
To summarize the above, as an example code this query might look like this:
An example of calls to the API, as well as a description of the available request/response objects can be found on the page of each endpoint
List of available REST endpoints
ByBit API V3 - DERIVATIVES:
MARKET DATA | ||||
---|---|---|---|---|
Endpoint | Access type | View in directory | Official documentation | Language |
Funding Rate History | publicEndpoint | go | go | EN, RU |
Index Price Kline | publicEndpoint | go | go | EN, RU |
Instrument Info | publicEndpoint | go | go | EN, RU |
Kline | publicEndpoint | go | go | EN, RU |
Mark Price Kline | publicEndpoint | go | go | EN, RU |
Open Interest | publicEndpoint | go | go | EN, RU |
Order Book | publicEndpoint | go | go | EN, RU |
Public Trading History | publicEndpoint | go | go | EN, RU |
Risk Limit | publicEndpoint | go | go | EN, RU |
Ticker Info | publicEndpoint | go | go | EN, RU |
CONTRACT - ACCOUNT | ||||
Endpoint | Access type | View in directory | Official documentation | |
Get Trading Fee Rate | privateEndpoint | go | go | EN, RU |
Wallet Balance | privateEndpoint | go | go | EN, RU |
CONTRACT - ORDER | ||||
Endpoint | Access type | View in directory | Official documentation | |
Cancel All Order | privateEndpoint | go | go | EN, RU |
Cancel Order | privateEndpoint | go | go | EN, RU |
Get Open Orders | privateEndpoint | go | go | EN, RU |
Get Order List | privateEndpoint | go | go | EN, RU |
Place Order | privateEndpoint | go | go | EN, RU |
Replace Order | privateEndpoint | go | go | EN, RU |
CONTRACT - POSITION | ||||
Endpoint | Access type | View in directory | Official documentation | Language |
Get Closed PnL | privateEndpoint | go | go | EN, RU |
Get Execution List | privateEndpoint | go | go | EN, RU |
My Position | privateEndpoint | go | go | EN, RU |
Set Auto Add Margin | privateEndpoint | go | go | EN, RU |
Set Leverage | privateEndpoint | go | go | EN, RU |
Set Risk Limit | privateEndpoint | go | go | EN, RU |
Set Trading Stop | privateEndpoint | go | go | EN, RU |
Switch Cross Isolated Margin | privateEndpoint | go | go | EN, RU |
Switch Position Mode | privateEndpoint | go | go | EN, RU |
Switch TpSl Mode | privateEndpoint | go | go | EN, RU |
ByBit API V3 - SPOT:
MARKET DATA | ||||
---|---|---|---|---|
Endpoint | Access type | View in directory | Official documentation | Language |
Best Bid Ask Price | publicEndpoint | go | go | EN, RU |
Instrument Info | publicEndpoint | go | go | EN, RU |
Kline | publicEndpoint | go | go | EN, RU |
Last Traded Price | publicEndpoint | go | go | EN, RU |
Merged Order Book | publicEndpoint | go | go | EN, RU |
Public Trading Records | publicEndpoint | go | go | EN, RU |
Tickers | publicEndpoint | go | go | EN, RU |
Order Book | publicEndpoint | go | go | EN, RU |
TRADE | ||||
Endpoint | Access type | View in directory | Official documentation | |
Place Order | privateEndpoint | go | go | EN, RU |
Get Order | privateEndpoint | go | go | EN, RU |
Cancel Order | privateEndpoint | go | go | EN, RU |
Batch Cancel Order | privateEndpoint | go | go | EN, RU |
Batch Cancel Order By Id | privateEndpoint | go | go | EN, RU |
Open Orders | privateEndpoint | go | go | EN, RU |
Order History | privateEndpoint | go | go | EN, RU |
Trade History | privateEndpoint | go | go | EN, RU |
LEVERAGE TOKEN | ||||
Endpoint | Access type | View in directory | Official documentation | |
All Asset Info | publicEndpoint | go | go | EN |
Market Info | publicEndpoint | go | go | EN |
Purchase | publicEndpoint | go | go | EN |
Purchase Redeem History | publicEndpoint | go | go | EN |
Redeem | publicEndpoint | go | go | EN |
ACCOUNT | ||||
Endpoint | Access type | View in directory | Official documentation | |
Wallet Balance | privateEndpoint | go | go | EN |