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

ActiveLibrary[API Development](/categories/api)

startusin/hitbtc-php-sdk
========================

HitBTC SDK for PHP Guzzle 7.2+

00PHP

Since Oct 29Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c16e7b0ceee59a27bee1b803c0cba57997b91c639ec95f4aae7184a458edbf4?d=identicon)[startus](/maintainers/startus)

---

Top Contributors

[![startusin](https://avatars.githubusercontent.com/u/15997367?v=4)](https://github.com/startusin "startusin (12 commits)")[![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/startusin-hitbtc-php-sdk/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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