Download the PHP package tigusigalpa/bybit-php without Composer
On this page you can find all versions of the php package tigusigalpa/bybit-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tigusigalpa/bybit-php
More information about tigusigalpa/bybit-php
Files in tigusigalpa/bybit-php
Package bybit-php
Short Description Bybit V5 API client for PHP with Laravel 8-13 integration
License MIT
Informations about the package bybit-php
Features
- Full Bybit V5 API coverage (spot, linear, inverse, options)
- TradFi support — gold, silver, forex, stock CFDs, and indices via
BybitTradFi - HMAC-SHA256 and RSA-SHA256 signatures
- WebSocket for real-time data (orderbook, trades, klines, account updates)
- Testnet and demo trading support
- Regional endpoints (NL, TR, KZ, GE, AE)
- Laravel integration (facade, service provider, config publishing)
- Automatic reconnection for WebSocket
Installation
Pure PHP (without Laravel)
Laravel Integration
For local monorepo setup:
-
Add repository to
composer.json: -
Install the package:
- Publish configuration:
Laravel auto-discovery регистрирует service provider и facade автоматически.
Configuration
Environment Variables
Create or update your .env file:
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
BYBIT_API_KEY |
string | - | Your Bybit API public key |
BYBIT_API_SECRET |
string | - | Your Bybit API secret key |
BYBIT_TESTNET |
boolean | false |
Enable testnet environment |
BYBIT_DEMO_TRADING |
boolean | false |
Enable demo trading environment |
BYBIT_REGION |
string | global |
Regional endpoint (global, nl, tr, kz, ge, ae) |
BYBIT_RECV_WINDOW |
integer | 5000 |
Request receive window (ms) |
BYBIT_SIGNATURE |
string | hmac |
Signature type (hmac or rsa) |
BYBIT_RSA_PRIVATE_KEY |
string | null |
RSA private key (PEM format) |
Quick Start
Pure PHP Usage
Laravel Usage
Using Facade:
Using Dependency Injection:
API Methods
Market Data
Order Management
Position Management
Account & Wallet
Demo Trading
Demo trading — тестирование стратегий без риска. Используется домен api-demo.bybit.com.
Laravel Demo Trading:
WebSocket Streaming
Public Streams
Pure PHP WebSocket:
Private Streams
Authenticated WebSocket for account updates:
Laravel Background Command:
Run with: php artisan bybit:listen BTCUSDT
TradFi
The BybitTradFi class provides a dedicated interface for trading traditional financial instruments — gold, silver, forex pairs, stock CFDs, and indices — all available on Bybit as linear perpetuals through the standard V5 API.
Instantiate by passing an existing BybitClient:
Predefined Symbol Lists
Market Data
Trading
Symbol Detection Helper
Note: TradFi instruments follow market hours (unlike 24/7 crypto). Outside trading sessions the API may return empty order books or stale prices. Swap fees apply when holding positions past daily market close — check
getSwapFee()before sizing.
Advanced Usage
Universal Order Placement
Trading Fee Calculation
Regional Endpoints
| Region | Code | Endpoint |
|---|---|---|
| 🌐 Global | global |
https://api.bybit.com |
| 🇳🇱 Netherlands | nl |
https://api.bybit.nl |
| 🇹🇷 Turkey | tr |
https://api.bybit-tr.com |
| 🇰🇿 Kazakhstan | kz |
https://api.bybit.kz |
| 🇬🇪 Georgia | ge |
https://api.bybitgeorgia.ge |
| 🇦🇪 UAE | ae |
https://api.bybit.ae |
| 🧪 Testnet | - | https://api-testnet.bybit.com |
Authentication
Signature Generation
Bybit V5 API uses HMAC-SHA256 or RSA-SHA256 for request signing:
For GET requests:
For POST requests:
HMAC-SHA256: Returns lowercase hex RSA-SHA256: Returns base64
Required Headers
Official docs: https://bybit-exchange.github.io/docs/v5/guide
Examples
Trading Bot Example
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
MIT License
Copyright (c) 2026 Igor Sazonov
- Author: Igor Sazonov (
tigusigalpa) - Email: [email protected]
- GitHub: https://github.com/tigusigalpa/bybit-php
All versions of bybit-php with dependencies
guzzlehttp/guzzle Version ^7.8
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
textalk/websocket Version ^1.6