PHPackages                             kucoin/kumex-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. kucoin/kumex-php-sdk

Abandoned → [kucoin/kumex-php-sdk](/?search=kucoin%2Fkumex-php-sdk)ArchivedLibrary[API Development](/categories/api)

kucoin/kumex-php-sdk
====================

PHP SDK for KuMEX API

1.0.14(5y ago)41.4k10[1 PRs](https://github.com/Kucoin/kumex-php-sdk/pulls)MITPHPPHP &gt;=5.5.0

Since Jul 3Pushed 4y ago4 watchersCompare

[ Source](https://github.com/Kucoin/kumex-php-sdk)[ Packagist](https://packagist.org/packages/kucoin/kumex-php-sdk)[ Docs](https://github.com/Kucoin/kumex-php-sdk)[ RSS](/packages/kucoin-kumex-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

PHP SDK for KuMEX API
=====================

[](#php-sdk-for-kumex-api)

**Note:** This library isn't actively maintained. Please switch to [kucoin-futures-php-sdk](https://github.com/Kucoin/kucoin-futures-php-sdk).

> The detailed document , in order to receive the latest API change notifications, please `Watch` this repository.

[![Latest Version](https://camo.githubusercontent.com/652a87376c61c19a09df6c6aedd8584edaa7a5d7eeb86b9cfc7f70724d39eb95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f4b75636f696e2f6b756d65782d7068702d73646b2e737667)](https://github.com/Kucoin/kumex-php-sdk/releases)[![PHP Version](https://camo.githubusercontent.com/6151e761a4fb64327271e534c52b16381bed544884593fd90887a52077aa111d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b75636f696e2f6b756d65782d7068702d73646b2e7376673f636f6c6f723d677265656e)](https://secure.php.net)[![Build Status](https://camo.githubusercontent.com/8df362253194d15648ce43ee230e244d47584f3a5bf61e92a79ab298ebb0e8f3/68747470733a2f2f7472617669732d63692e6f72672f4b75636f696e2f6b756d65782d7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Kucoin/kumex-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/d59c5c78d8fe9f33eef44259ab218be4f61e6ece4e407c635ff832dc6e7fb6b8/68747470733a2f2f706f7365722e707567782e6f72672f6b75636f696e2f6b756d65782d7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/kucoin/kumex-php-sdk)[![License](https://camo.githubusercontent.com/673a4f190371cafd6fec536ecb507948a778efdff1a83527949e428b1a367793/68747470733a2f2f706f7365722e707567782e6f72672f6b75636f696e2f6b756d65782d7068702d73646b2f6c6963656e7365)](LICENSE)

Requirements
------------

[](#requirements)

DependencyRequirement[PHP](https://secure.php.net/manual/en/install.php)`>=5.5.0` `Recommend PHP7+`[guzzlehttp/guzzle](https://github.com/guzzle/guzzle)`~6.0`Install
-------

[](#install)

> Install package via [Composer](https://getcomposer.org/).

```
composer require "kucoin/kumex-php-sdk:~1.0.0"
```

Usage
-----

[](#usage)

### Choose environment

[](#choose-environment)

EnvironmentBaseUri*Production*`https://api-futures.kucoin.com (DEFAULT)` `https://api-futures.kucoin.io`*Sandbox*`https://api-sandbox-futures.kucoin.com (DEFAULT)` `https://api-sandbox-futures.kucoin.io````
// Switch to the sandbox environment
KuMEXApi::setBaseUri('https://api-sandbox-futures.kucoin.com');
```

### Debug mode &amp; logging

[](#debug-mode--logging)

```
// Debug mode will record the logs of API and WebSocket to files in the directory "KuMEXApi::getLogPath()" according to the minimum log level "KuMEXApi::getLogLevel()".
KuMEXApi::setDebugMode(true);

// Logging in your code
// KuMEXApi::setLogPath('/tmp');
// KuMEXApi::setLogLevel(Monolog\Logger::DEBUG);
KuMEXApi::getLogger()->debug("I'am a debug message");
```

### Examples

[](#examples)

> See the [test case](tests) for more examples.

#### Example of API `without` authentication

[](#example-of-api-without-authentication)

```
use KuMEX\SDK\PublicApi\Time;

$api = new Time();
$timestamp = $api->timestamp();
var_dump($timestamp);
```

#### Example of API `with` authentication

[](#example-of-api-with-authentication)

```
use KuMEX\SDK\Auth;
use KuMEX\SDK\PrivateApi\Account;
use KuMEX\SDK\Exceptions\HttpException;
use KuMEX\SDK\Exceptions\BusinessException;

$auth = new Auth('key', 'secret', 'passphrase');
$api = new Account($auth);

try {
    $result = $api->getOverview();
    var_dump($result);
} catch (HttpException $e) {
    var_dump($e->getMessage());
} catch (BusinessException $e) {
    var_dump($e->getMessage());
}
```

#### Example of WebSocket feed

[](#example-of-websocket-feed)

```
use KuMEX\SDK\Auth;
use KuMEX\SDK\KuMEXApi;
use KuMEX\SDK\PrivateApi\WebSocketFeed;
use Ratchet\Client\WebSocket;
use React\EventLoop\Factory;
use React\EventLoop\LoopInterface;

$auth = null;
// Need to pass the Auth parameter when subscribing to a private channel($api->subscribePrivateChannel()).
// $auth = new Auth('key', 'secret', 'passphrase');
$api = new WebSocketFeed($auth);

// Use a custom event loop instance if you like
//$loop = Factory::create();
//$loop->addPeriodicTimer(1, function () {
//    var_dump(date('Y-m-d H:i:s'));
//});
//$api->setLoop($loop);

$query = ['connectId' => uniqid('', true)];
$channels = [
    ['topic' => '/market/ticker:KCS-BTC'], // Subscribe multiple channels
    ['topic' => '/market/ticker:ETH-BTC'],
];

$api->subscribePublicChannels($query, $channels, function (array $message, WebSocket $ws, LoopInterface $loop) use ($api) {
    var_dump($message);

    // Unsubscribe the channel
    // $ws->send(json_encode($api->createUnsubscribeMessage('/market/ticker:ETH-BTC')));

    // Stop loop
    // $loop->stop();
}, function ($code, $reason) {
    echo "OnClose: {$code} {$reason}\n";
});
```

#### ⚡️Coroutine HTTP client for asynchronous IO

[](#️coroutine-http-client-for-asynchronous-io)

> See the [benchmark](examples/BenchmarkCoroutine.php), almost `20x` faster than `curl`.

```
pecl install swoole
composer require swlib/saber
```

```
use KuMEX\SDK\Auth;
use KuMEX\SDK\Http\SwooleHttp;
use KuMEX\SDK\KuMEXApi;
use KuMEX\SDK\PrivateApi\Order;
use KuMEX\SDK\PublicApi\Time;

// Require PHP 7.1+ and Swoole 2.1.2+
// Require running in cli mode

go(function () {
    $api = new Time(null, new SwooleHttp));
    $timestamp = $api->timestamp();
    var_dump($timestamp);
});

go(function () {
    $auth = new Auth('key', 'secret', 'passphrase');
    $api = new Order($auth, new SwooleHttp);
    // Create 50 orders CONCURRENTLY in 1 second
    for ($i = 0; $i < 50; $i++) {
        go(function () use ($api, $i) {
            $order = [
                'clientOid' => uniqid(),
                'price'     => '1',
                'size'      => '1',
                'symbol'    => 'BTC-USDT',
                'type'      => 'limit',
                'side'      => 'buy',
                'remark'    => 'ORDER#' . $i,
            ];
            try {
                $result = $api->create($order);
                var_dump($result);
            } catch (\Throwable $e) {
                var_dump($e->getMessage());
            }
        });
    }
});
```

### API list

[](#api-list)

KuMEX\\SDK\\PrivateApi\\AccountAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\Account::getOverview()YESKuMEX\\SDK\\PrivateApi\\Account::getTransactionHistory()YESKuMEX\\SDK\\PrivateApi\\Account::transferIn()YESKuMEX\\SDK\\PrivateApi\\Account::transferOut()YESKuMEX\\SDK\\PrivateApi\\Account::transferOutV2()YESKuMEX\\SDK\\PrivateApi\\Account::cancelTransferOut()YESKuMEX\\SDK\\PrivateApi\\Account::getTransferList()YESKuMEX\\SDK\\PrivateApi\\DepositAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\Deposit::getAddress()YESKuMEX\\SDK\\PrivateApi\\Deposit::getDeposits()YESKuMEX\\SDK\\PrivateApi\\FillAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\Fill::getFills()YESKuMEX\\SDK\\PrivateApi\\Fill::getRecentList()YESKuMEX\\SDK\\PrivateApi\\OrderAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\Order::create()YESKuMEX\\SDK\\PrivateApi\\Order::cancel()YESKuMEX\\SDK\\PrivateApi\\Order::batchCancel()YESKuMEX\\SDK\\PrivateApi\\Order::stopOrders()YESKuMEX\\SDK\\PrivateApi\\Order::getList()YESKuMEX\\SDK\\PrivateApi\\Order::getStopOrders()YESKuMEX\\SDK\\PrivateApi\\Order::getRecentDoneOrders()YESKuMEX\\SDK\\PrivateApi\\Order::getDetail()YESKuMEX\\SDK\\PrivateApi\\Order::getOpenOrderStatistics()YESKuMEX\\SDK\\PrivateApi\\PositionAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\Position::getList()YESKuMEX\\SDK\\PrivateApi\\Position::getDetail()YESKuMEX\\SDK\\PrivateApi\\Position::changeAutoAppendStatus()YESKuMEX\\SDK\\PrivateApi\\Position::marginAppend()YESKuMEX\\SDK\\PrivateApi\\WebSocketFeedAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\WebSocketFeed::getPublicServer()NOKuMEX\\SDK\\PrivateApi\\WebSocketFeed::getPrivateServer()YESKuMEX\\SDK\\PrivateApi\\WebSocketFeed::subscribePublicChannel()NOKuMEX\\SDK\\PrivateApi\\WebSocketFeed::subscribePublicChannels()NOKuMEX\\SDK\\PrivateApi\\WebSocketFeed::subscribePrivateChannel()YESKuMEX\\SDK\\PrivateApi\\WebSocketFeed::subscribePrivateChannels()YESKuMEX\\SDK\\PrivateApi\\WithdrawalAPIAuthenticationDescriptionKuMEX\\SDK\\PrivateApi\\Withdrawal::getQuotas()YESKuMEX\\SDK\\PrivateApi\\Withdrawal::getList()YESKuMEX\\SDK\\PrivateApi\\Withdrawal::apply()YESKuMEX\\SDK\\PrivateApi\\Withdrawal::cancel()YESKuMEX\\SDK\\PublicApi\\SymbolAPIAuthenticationDescriptionKuMEX\\SDK\\PublicApi\\Symbol::getTicker()NOKuMEX\\SDK\\PublicApi\\Symbol::getLevel2Snapshot()NOKuMEX\\SDK\\PublicApi\\Symbol::getLevel3Snapshot()NOKuMEX\\SDK\\PublicApi\\Symbol::getV2Level3Snapshot()NOKuMEX\\SDK\\PublicApi\\Symbol::getLevel2Message()NOKuMEX\\SDK\\PublicApi\\Symbol::getLevel3Message()NOKuMEX\\SDK\\PublicApi\\Symbol::getTradeHistory()NOKuMEX\\SDK\\PublicApi\\Symbol::getKLines()NO[https://docs.kucoin.com/futures/?lang=en\_US#get-k-line-data-of-contract](https://docs.kucoin.com/futures/?lang=en_US#get-k-line-data-of-contract)KuMEX\\SDK\\PublicApi\\TimeAPIAuthenticationDescriptionKuMEX\\SDK\\PublicApi\\Time::timestamp()NOKuMEX\\SDK\\PublicApi\\StatusAPIAuthenticationDescriptionKuMEX\\SDK\\PublicApi\\Status::status()NORun tests
---------

[](#run-tests)

> Modify your API key in `phpunit.xml` first.

```
# Add your API configuration items into the environmental variable first
export API_BASE_URI=https://api-futures.kucoin.com
export API_KEY=key
export API_SECRET=secret
export API_PASSPHRASE=passphrase

composer test
```

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 64.3% 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 ~28 days

Recently: every ~23 days

Total

14

Last Release

2134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc09c912d3848b69441bd345a7d13daebe373c1ae63ae20eb6886771264dd834?d=identicon)[kucoin](/maintainers/kucoin)

---

Top Contributors

[![c2s](https://avatars.githubusercontent.com/u/17718352?v=4)](https://github.com/c2s "c2s (45 commits)")[![hhxsv5](https://avatars.githubusercontent.com/u/7278743?v=4)](https://github.com/hhxsv5 "hhxsv5 (20 commits)")[![viaweb3](https://avatars.githubusercontent.com/u/17975348?v=4)](https://github.com/viaweb3 "viaweb3 (3 commits)")[![sh7ning](https://avatars.githubusercontent.com/u/4698385?v=4)](https://github.com/sh7ning "sh7ning (2 commits)")

---

Tags

futureskumexphpsdkapisdkkucoinkumex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kucoin-kumex-php-sdk/health.svg)

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

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[kucoin/kucoin-php-sdk

PHP SDK for KuCoin API

7955.8k](/packages/kucoin-kucoin-php-sdk)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[kucoin/kucoin-futures-php-sdk

PHP SDK for KuCoin Futures API

111.9k](/packages/kucoin-kucoin-futures-php-sdk)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

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