PHPackages                             maxsky/qq-openapi - 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. maxsky/qq-openapi

ActiveLibrary[API Development](/categories/api)

maxsky/qq-openapi
=================

QQ Open API PHP SDK.

v3.1.2(4y ago)0541MITPHPPHP &gt;=7.1

Since Apr 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/maxsky/QQ-OpenAPI)[ Packagist](https://packagist.org/packages/maxsky/qq-openapi)[ RSS](/packages/maxsky-qq-openapi/feed)WikiDiscussions master Synced 2mo ago

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

QQ Open API SDK
===============

[](#qq-open-api-sdk)

[![](https://camo.githubusercontent.com/ac8f294a80f65338db545230f1a881b9a382204a1f187c6ff40ee679d42d40ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e6b2d3939362e6963752d7265642e737667)](https://996.icu)

QQ 开放平台 Open API，修改自官方 SDK v3.0.9\[2013-05-30\]

安装
--

[](#安装)

`composer require maxsky/qq-openapi`

说明
--

[](#说明)

通过 **Composer** 安装后，通过如下代码实例化调用：

```
// Server Name 默认为正式，测试时使用 https://openapi.sparta.html5.qq.com
$openApi = (new OpenAPIv3('AppID', 'AppKey'))->setServerName('https://openapi.tencentyun.com');
```

其中，`AppID` 及 `AppKey` 需在 [腾讯应用开放平台 - 我的应用](https://app.open.qq.com/p/app/list) 添加应用后获取。

### 例子：获取用户信息

[](#例子获取用户信息)

```
// 请求的接口路由地址一定是左斜杠 '/' 开头
$route = '/v3/user/get_info';

try {
    $result = $openApi->api($route, 'POST', $params);
} catch (Throwable $e) {
    print_r('Error Message: ' . $e->getMessage());
    print_r('Error Code: ' . $e->getCode());

    if ($e instanceof ClientException) {
        print_r($e->getResponse());
    } elseif ($e instanceof BadResponseException) {
        print_r(json_decode($e->getResponse()->getBody(), true));
    }

    die;
}

/** @var string $result */
print_r($result);
```

解释一下：`openkey` 为客户端（App 等）唤起 QQ，用户点击允许登录后返回的 **Access Token**，**OpenID** 也是，`pf` 一般来说填写 `qzone` 即可。

返回值参考：[v3/user/get\_info - 腾讯开放平台帮助文档](https://wikinew.open.qq.com/index.html#/iwiki/931122987)

请求头
---

[](#请求头)

参考 GuzzleHttp 的 `options` 参数设置：

```
$result = $openApi->api('/route/path', 'POST', [
    'param1' => 'value1',
    'param2' => 'value2'
], [
    'Accept' => 'application/json',
    'Content-Type' => 'application/x-www-form-urlencoded'
]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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 ~358 days

Total

4

Last Release

1519d ago

### Community

Maintainers

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

---

Top Contributors

[![maxsky](https://avatars.githubusercontent.com/u/7405522?v=4)](https://github.com/maxsky "maxsky (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maxsky-qq-openapi/health.svg)

```
[![Health](https://phpackages.com/badges/maxsky-qq-openapi/health.svg)](https://phpackages.com/packages/maxsky-qq-openapi)
```

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