PHPackages                             hsioe/quant-okx-api - 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. hsioe/quant-okx-api

ActiveLibrary[API Development](/categories/api)

hsioe/quant-okx-api
===================

Webman plugin hsioe/quant-okx-api

1.0.7(5mo ago)134MITPHPPHP &gt;=8.1

Since Jan 8Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/dhsioe/hsioe-okx-engine)[ Packagist](https://packagist.org/packages/hsioe/quant-okx-api)[ RSS](/packages/hsioe-quant-okx-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

HSIOE-OKX-SDK(欧易API组件)
======================

[](#hsioe-okx-sdk欧易api组件)

概述
--

[](#概述)

基于 `Workman` 重新把之前量化系统的[欧易](https://www.okx.com/docs-v5/zh/#overview)的API做成SDK方便后续扩展

目前已经完成

- RestApi V5版本接口
- Websocket 长链接

安装
--

[](#安装)

1. 通过 `composer`安装

```
composre require hsioe/quant-okx-api
```

快速开始
----

[](#快速开始)

- RestApi

```
use Hsioe\QuantOkxApi\OkxApi;
use Hsioe\QuantOkxApi\Rest\OkxApiRequest;

//初始化链接

$apiRequest = new OkxApiRequest([
    'apiKey' => 'You Okx ApiKey',
    'apiSecret' => 'You Okx ApiSecret',
    'passphrase' => 'You Okx Passphrase'
]);

$accountApi = OkxApi::account($apiRequest);
// 获取账户余额
$accountApi->getBalance();
// 获取账户配置
$accountApi->getAccountConfig();
...
```

- Websocket

主要用到 `Hsioe\QuantOkxApi\OkxWebsocket` 类代理访问

- PrivateWebsocket
- PublicWebsocket

并通过 `WebsocketFactory`实现socket的链接管理

```
use Hsioe\QuantOkxApi\OkxWebsocket;
// 公共频道链接
$publicClient = OkxWebsocket::public('test01','public',[
    'wss_url' => 'ws://ws.okx.com/v5/public',
    'ping_interval' => 20
]);
// 启动websocket
$publicClient->start();

// 私有频道
$privateClient = OkxWebsocket::private('test02','private',[
    'wss_url' => 'ws://ws.okx.com/v5/private',
    'ping_interval' => 20
]);
$privateClient->start();
```

更新日志
----

[](#更新日志)

- 08/14 完善API接口和单元测试

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance71

Regular maintenance activity

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~47 days

Recently: every ~76 days

Total

8

Last Release

164d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71caf92c5a7c07b2ca1728cdbc637cd38c2b484356644744e44f3fe1a1b490d7?d=identicon)[dhsioe](/maintainers/dhsioe)

---

Top Contributors

[![dawei0937](https://avatars.githubusercontent.com/u/9084597?v=4)](https://github.com/dawei0937 "dawei0937 (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hsioe-quant-okx-api/health.svg)

```
[![Health](https://phpackages.com/badges/hsioe-quant-okx-api/health.svg)](https://phpackages.com/packages/hsioe-quant-okx-api)
```

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