PHPackages                             tigusigalpa/bybit-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tigusigalpa/bybit-php

ActiveLibrary[API Development](/categories/api)

tigusigalpa/bybit-php
=====================

Bybit V5 API client for PHP with Laravel 8-13 integration

v1.3.5(2mo ago)1220MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Jan 18Pushed 2mo agoCompare

[ Source](https://github.com/tigusigalpa/bybit-php)[ Packagist](https://packagist.org/packages/tigusigalpa/bybit-php)[ RSS](/packages/tigusigalpa-bybit-php/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

Bybit PHP SDK
=============

[](#bybit-php-sdk)

### V5 API Client for PHP &amp; Laravel

[](#v5-api-client-for-php--laravel)

[![PHP Version](https://camo.githubusercontent.com/f6520188e30d0075b0f149251f03b8bbd6012e6b021a17fea54db0b0c0fbe2a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e34253230253743253230382e30253230253743253230382e31253230253743253230382e322d626c75652e737667)](https://php.net)[![Laravel](https://camo.githubusercontent.com/04bc844aa6de62a7f1e6501a5978ca53d7f91c7b3e5bff402eff710c2359c088/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d382532302537432532303925323025374325323031302532302537432532303131253230253743253230313225323025374325323031332d7265642e737667)](https://laravel.com)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![WebSocket](https://camo.githubusercontent.com/c1297dcc0b6e2ad0b6e97700a1d815a08cf8081e6bfaccb46bf1f5078627ebc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562536f636b65742d537570706f727465642d627269676874677265656e2e737667)](https://bybit-exchange.github.io/docs/v5/ws/connect)

[![ByBit PHP SDK](https://camo.githubusercontent.com/d15a29bfdf0b5817bbcc45fd388a5199b3a60a46a580b8ea62c3a1e812ca8df2/68747470733a2f2f692e706f7374696d672e63632f543350707147796e2f62796269742d7068702d62616e6e65722d76322e6a7067)](https://camo.githubusercontent.com/d15a29bfdf0b5817bbcc45fd388a5199b3a60a46a580b8ea62c3a1e812ca8df2/68747470733a2f2f692e706f7374696d672e63632f543350707147796e2f62796269742d7068702d62616e6e65722d76322e6a7067)

**Language:** English | [Русский](README-ru.md)

> 📖 **[Full documentation available on Wiki](https://github.com/tigusigalpa/bybit-php/wiki)**

A PHP library for working with the Bybit V5 API. Supports REST and WebSockets, and works both standalone and with Laravel.

[Features](#features) • [Installation](#installation) • [Quick Start](#quick-start) • [API Methods](#api-methods) • [TradFi](#tradfi) • [WebSocket](#websocket-streaming) • [Examples](#examples)

---

Features
--------

[](#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
------------

[](#installation)

### Pure PHP (without Laravel)

[](#pure-php-without-laravel)

```
composer require tigusigalpa/bybit-php
```

### Laravel Integration

[](#laravel-integration)

**For local monorepo setup:**

1. Add repository to `composer.json`:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "public_html/packages/bybit-php"
        }
    ]
}
```

2. Install the package:

```
composer require tigusigalpa/bybit-php:* --prefer-source
```

3. Publish configuration:

```
php artisan vendor:publish --tag=bybit-config
```

Laravel auto-discovery регистрирует service provider и facade автоматически.

---

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

Create or update your `.env` file:

```
BYBIT_API_KEY=your_api_key_here
BYBIT_API_SECRET=your_api_secret_here
BYBIT_TESTNET=true
BYBIT_DEMO_TRADING=false
BYBIT_REGION=global
BYBIT_RECV_WINDOW=5000
BYBIT_SIGNATURE=hmac

# For RSA signature (optional):
# BYBIT_SIGNATURE=rsa
# BYBIT_RSA_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
```

### Configuration Options

[](#configuration-options)

ParameterTypeDefaultDescription`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
-----------

[](#quick-start)

### Pure PHP Usage

[](#pure-php-usage)

```
