PHPackages                             hitbtc-com/hitbtc-php-sdk - 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. hitbtc-com/hitbtc-php-sdk

ActiveLibrary[API Development](/categories/api)

hitbtc-com/hitbtc-php-sdk
=========================

HitBTC SDK for PHP

1.1.0(8y ago)3924.3k↓30.8%31[1 PRs](https://github.com/hitbtc-com/hitbtc-php-sdk/pulls)1MITPHP

Since Oct 20Pushed 7y ago6 watchersCompare

[ Source](https://github.com/hitbtc-com/hitbtc-php-sdk)[ Packagist](https://packagist.org/packages/hitbtc-com/hitbtc-php-sdk)[ RSS](/packages/hitbtc-com-hitbtc-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

Hitbtc SDK for PHP
==================

[](#hitbtc-sdk-for-php)

The HitBTC SDK for PHP enables PHP developers to use HitBTC rest trading API in their PHP code, and build robust applications and software.

Features
--------

[](#features)

- Get trading and main balances
- Place new order
- Cancel order
- Return list of orders and trades
- Transfers funds between main and trading accounts
- Returns the last created or create new one incoming cryptocurrency address that can be used to deposit cryptocurrency to your account.
- Withdraws money and creates an outgoing crypotocurrency transaction
- Returns a list of payment transactions

Installing via Composer
-----------------------

[](#installing-via-composer)

The recommended way to install hitbtc-php-sdk is through [Composer](http://getcomposer.org).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, update your project's composer.json file to include hitbtc-php-sdk:

```
{
    "require": {
        "hitbtc-com/hitbtc-php-sdk": "~1.0"
    }
}
```

Getting Started
---------------

[](#getting-started)

Go to  and create your api keys

Quick Examples
--------------

[](#quick-examples)

**New order:**

```
$client = new \Hitbtc\ProtectedClient('API key', 'API secret', $demo = false);

$newOrder = new \Hitbtc\Model\NewOrder();
$newOrder->setSide($newOrder::SIDE_SELL);
$newOrder->setSymbol('BTCUSD');
$newOrder->setTimeInForce($newOrder::TIME_IN_FORCE_GTC);
$newOrder->setType($newOrder::TYPE_LIMIT);
$newOrder->setQuantity(10);
$newOrder->setPrice(800);

try {
    $order = $client->newOrder($newOrder);
    var_dump($order->getOrderId());
    var_dump($order->getStatus()); // new
} catch (\Hitbtc\Exception\RejectException $e) {
    echo $e; // if creating order will rejected
} catch (\Hitbtc\Exception\InvalidRequestException $e) {
    echo $e->getMessage(); // error in request
} catch (\Exception $e) {
    echo $e->getMessage(); // other error like network issue
}
```

**Cancel order:**

```
try {
    $order = $client->cancelOrder($order);
    var_dump($order->getStatus()); // canceled
} catch (\Hitbtc\Exception\RejectException $e) {
    echo $e; // if creating order will rejected
} catch (\Hitbtc\Exception\InvalidRequestException $e) {
    echo $e->getMessage(); // error in request
} catch (\Exception $e) {
    echo $e->getMessage(); // other error like network issue
}
```

**Get trading balance:**

```
try {
    foreach ($client->getBalanceTrading() as $balance) {
        echo $balance->getCurrency() . ' ' . $balance->getAvailable() . ' reserved:' . $balance->getReserved() . "\n";
    }
} catch (\Hitbtc\Exception\InvalidRequestException $e) {
    echo $e;
} catch (\Exception $e) {
    echo $e;
}
//BTC 18.314848971 reserved:0.7004
//DOGE 1122543 reserved:0
```

**Get incoming cryptocurrency address that can be used to deposit cryptocurrency to your account:**

```
try {
    $address = $client->getPaymentAddress('BTC');
} catch (\Hitbtc\Exception\InvalidRequestException $e) {
    echo $e;
} catch (\Exception $e) {
    echo $e;
}
```

**Transfers funds between main and trading accounts:**

```
try {
    $tnxId = $client->transferToMain('BTC', 1.5);
} catch (\Hitbtc\Exception\InvalidRequestException $e) {
    echo $e;
} catch (\Exception $e) {
    echo $e;
}
```

Documentation
-------------

[](#documentation)

See the  for more detail.

License
-------

[](#license)

hitbtc-php-sdk is licensed under the MIT License

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~525 days

Total

3

Last Release

3179d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2384b9ee6973337fe2ab796bff43d61fa03820a917a3bf022538d04c22f82f32?d=identicon)[hitbtc-com](/maintainers/hitbtc-com)

---

Top Contributors

[![toooni](https://avatars.githubusercontent.com/u/241080?v=4)](https://github.com/toooni "toooni (3 commits)")[![hitbtc-com](https://avatars.githubusercontent.com/u/6258220?v=4)](https://github.com/hitbtc-com "hitbtc-com (2 commits)")[![gamebak](https://avatars.githubusercontent.com/u/2984011?v=4)](https://github.com/gamebak "gamebak (1 commits)")

### Embed Badge

![Health badge](/badges/hitbtc-com-hitbtc-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/hitbtc-com-hitbtc-php-sdk/health.svg)](https://phpackages.com/packages/hitbtc-com-hitbtc-php-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
