-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Igor Sazonov edited this page Mar 15, 2026
·
1 revision
Welcome to the OKX PHP SDK documentation — a production-ready PHP library for the OKX exchange API v5.
- 335 REST API endpoints — Full coverage across all API categories
- 53 WebSocket channels — Public, private, and business channels
- Laravel 11/12 integration — Service Provider and Facade included
- Framework-agnostic — Works standalone or with any PHP framework
- Strict typing — Typed DTOs for all requests and responses
- Demo mode — Test strategies risk-free against the OKX paper trading environment
- PSR-12 compliant — Clean, maintainable code
- Fully tested — Unit and integration test coverage
- Installation — Install via Composer and configure credentials
- Quick Start — Get up and running in minutes
- Laravel Integration — Using the SDK with Laravel
- REST API — Working with the REST API (335 endpoints)
- WebSocket API — Real-time data via WebSocket (53 channels)
- API Reference — Complete method reference
- Examples — Advanced usage examples
- Error Handling — Working with exceptions
- Testing — Running the test suite
use Tigusigalpa\OKX\Facades\OKX;
// Get account balance
$balance = OKX::account()->getBalance();
// Place an order
$order = OKX::trade()->placeOrder(
instId: 'BTC-USDT',
tdMode: 'cash',
side: 'buy',
ordType: 'market',
sz: '100'
);use Tigusigalpa\OKX\Client;
$client = new Client(
apiKey: 'your-api-key',
secretKey: 'your-secret-key',
passphrase: 'your-passphrase'
);
$ticker = $client->market()->getTicker('BTC-USDT');| Category | Endpoints | Status |
|---|---|---|
| Account | 53 | ✅ |
| Trade | 32 | ✅ |
| TradingBot | 44 | ✅ |
| Finance | 33 | ✅ |
| Asset | 26 | ✅ |
| CopyTrading | 26 | ✅ |
| Market | 24 | ✅ |
| PublicData | 24 | ✅ |
| RFQ | 20 | ✅ |
| Rubik | 15 | ✅ |
| Sprd | 13 | ✅ |
| Fiat | 13 | ✅ |
| Users | 8 | ✅ |
| Support | 2 | ✅ |
| SystemStatus | 1 | ✅ |
| Affiliate | 1 | ✅ |
| Total | 335 | ✅ |
- PHP 8.2 or higher
- Composer
- Laravel 11.x or 12.x (optional)
MIT License — see LICENSE
Igor Sazonov
- Email: sovletig@gmail.com
- GitHub: @tigusigalpa
Next: Installation →