PHPackages                             eskrano/bitmex-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. eskrano/bitmex-php

ActiveLibrary[API Development](/categories/api)

eskrano/bitmex-php
==================

Bitmex API Like the official document interface, Support for arbitrary extension.

1.0.12(6y ago)2941MITPHPPHP &gt;=7.0

Since Mar 26Pushed 6y ago2 watchersCompare

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

READMEChangelog (6)Dependencies (1)Versions (11)Used By (0)

### It is recommended that you use the test server first

[](#it-is-recommended-that-you-use-the-test-server-first)

Online interface testing

Address of the test

The official address

All interface methods are initialized the same as those provided by bitmex. See details[src/api](https://github.com/zhouaini528/bitmex-php/tree/master/src/Api)

Many interfaces are not yet complete, and users can continue to extend them based on my design. Feel free to iterate with me.

#### Installation

[](#installation)

```
composer require "eskrano/bitmex-php dev-master"

```

Book Data [More](https://github.com/zhouaini528/bitmex-php/blob/master/tests/position.php)

```
//Get market data
//Book data may be key and secret
try {
    $bitmex=new Bitmex();
    $result=$bitmex->orderBook()->get([
        'symbol'=>'ETHUSD',
        'depth'=>20
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}
```

Order [More](https://github.com/zhouaini528/bitmex-php/blob/master/tests/order.php)

```
//Test API address  default  https://www.bitmex.com
$key='eLB_l505a_cuZL8Cmu5uo7EP';
$secret='wG3ndMquAPl6c-jHUQNhyBQJKGBwdFenIF2QxcgNKE_g8Kz3';
$host='https://testnet.bitmex.com';

$bitmex=new Bitmex($key,$secret,$host);

//bargaining transaction
try {
    $result=$bitmex->order()->post([
        'symbol'=>'XBTUSD',
        'price'=>'100',
        'side'=>'Buy',
        'orderQty'=>'1',
        'ordType'=>'Limit',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}

//track the order
try {
    $result=$bitmex->order()->getOne([
        'symbol'=>'XBTUSD',
        'orderID'=>$result['orderID'],
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}

//update the order
try {
    $result=$bitmex->order()->put([
        'symbol'=>'XBTUSD',
        'orderID'=>$result['orderID'],
        'price'=>'200',
        'orderQty'=>'2',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}

//cancellation of order
try {
    $result=$bitmex->order()->delete([
        'symbol'=>'XBTUSD',
        'orderID'=>$result['orderID'],
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}
```

Postion [More](https://github.com/zhouaini528/bitmex-php/blob/master/tests/position.php)

```
//bargaining transaction
try {
    $bitmex=new Bitmex($key,$secret,$host);
    $result=$bitmex->position()->get([
        'symbol'=>'XBTUSD',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}
```

[More use cases](https://github.com/zhouaini528/bitmex-php/tree/master/tests)

[More API](https://github.com/zhouaini528/bitmex-php/tree/master/src/Api)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~35 days

Recently: every ~75 days

Total

10

Last Release

2282d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a00713eb14ef4690ab52ec5e1cd2871015a03081b9be2d95d1306adf9dbb36b?d=identicon)[eskrano](/maintainers/eskrano)

---

Top Contributors

[![zhouaini528](https://avatars.githubusercontent.com/u/5442664?v=4)](https://github.com/zhouaini528 "zhouaini528 (42 commits)")[![eskrano](https://avatars.githubusercontent.com/u/10223123?v=4)](https://github.com/eskrano "eskrano (6 commits)")

### Embed Badge

![Health badge](/badges/eskrano-bitmex-php/health.svg)

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

###  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)
