PHPackages                             zhuger/pinduoduo - 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. zhuger/pinduoduo

ActiveLibrary[API Development](/categories/api)

zhuger/pinduoduo
================

拼多多API SDK【拼多多开放平台】.

01

Since May 6Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

拼多多API SDK【拼多多开放平台】
===================

[](#拼多多api-sdk拼多多开放平台)

[![styleci](https://camo.githubusercontent.com/879c94a7a7cf623c4b06c7871f18f54df694d62365ad4cef3366f73a5be32e4d/68747470733a2f2f7374796c6563692e696f2f7265706f732f3135333231383731352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/153218715)[![PHP from Packagist](https://camo.githubusercontent.com/427300c7e12961e7d7bed832f93ccf34cd1260bd4c588cab92e44606a514bde0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a68756765722f70696e64756f64756f2e737667)](https://packagist.org/packages/zhuger/pinduoduo)[![Total Downloadsn](https://camo.githubusercontent.com/139da0eb67fca6a961b6a23d361222b2f015f49166eacd5c407447c9eaac9b53/68747470733a2f2f706f7365722e707567782e6f72672f7a68756765722f70696e64756f64756f2f646f776e6c6f6164732e737667)](https://packagist.org/packages/zhuger/pinduoduo) [![GitHub stars](https://camo.githubusercontent.com/d945c44efb8f39dea36a0fef8ece86b12db50e4f7785b70296796f2ab7bae818/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7a68756765722f70696e64756f64756f2e7376673f7374796c653d736f6369616c266c6162656c3d5374617273)](https://packagist.org/packages/zhuger/pinduoduo)[![Latest Stable Version](https://camo.githubusercontent.com/3a363f934c84ce53b4f8599e828a7755efa59fc77f7f921c2986386d39fd3f2d/68747470733a2f2f706f7365722e707567782e6f72672f7a68756765722f70696e64756f64756f2f762f737461626c652e737667)](https://packagist.org/packages/zhuger/pinduoduo)[![](https://camo.githubusercontent.com/5fa4424a69aa7afcab3a484e723d28ee58ca1788bc1b4e4deb9d586ba0e50568/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d2532467a687567657225324670696e64756f64756f2e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Fzhuger%2Fpinduoduo?ref=badge_shield) [![License](https://camo.githubusercontent.com/1982c89cdabce3bb2c4cb8d0f9ed1928fe0659f663644d44fbdf6b39ebafe7c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a68756765722f70696e64756f64756f2e737667)](https://packagist.org/packages/zhuger/pinduoduo)

[![](https://camo.githubusercontent.com/eea3435b6bc2e2422e3e77bba3b15f5d5e2ec87600d8534737f3be88f7387f90/68747470733a2f2f736f6369616c6966792e6769742e63692f7a68756765722f70696e64756f64756f2f696d6167653f6465736372697074696f6e3d3126666f6e743d526f6b6b69747426666f726b733d31266973737565733d31266c616e67756167653d31266f776e65723d31267061747465726e3d43697263756974253230426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4461726b)](https://camo.githubusercontent.com/eea3435b6bc2e2422e3e77bba3b15f5d5e2ec87600d8534737f3be88f7387f90/68747470733a2f2f736f6369616c6966792e6769742e63692f7a68756765722f70696e64756f64756f2f696d6167653f6465736372697074696f6e3d3126666f6e743d526f6b6b69747426666f726b733d31266973737565733d31266c616e67756167653d31266f776e65723d31267061747465726e3d43697263756974253230426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4461726b)

### 要求

[](#要求)

1. PHP &gt;= 7.0
2. **[Composer](https://getcomposer.org/)**
3. ext-curl 拓展
4. ext-json 拓展

### 安装

[](#安装)

`composer require zhuger/pinduoduo`

### 使用

[](#使用)

```
use \ZhuGer\PinDuoDuo\PinDuoDuo;

require __DIR__ . '/vendor/autoload.php';
$config = [
    'client_id'    => 'xxxxxx69e3940c6b93xxxxxx',
    'client_secret' => 'c2eda0c398xxxxxxbd63ff57bf22c05xxxxxx',
    'debug'              => true,
    'member_type'        => 'JINBAO',//用户角色 ：MERCHANT(商家授权),H5(移动端),多多进宝推手(JINBAO),快团团团长(KTT),拼多多电子面单用户(LOGISTICS)
    'redirect_uri'       => 'https://test.xxx.com/callback',
    'log'                => [
        'name'       => 'pinduoduo',
        'file'       => __DIR__ . '/pinduoduo.log',
        'level'      => 'debug',
        'permission' => 0777,
    ],
];
$pinduoduo = new PinDuoDuo($config);
```

### 调用示例

[](#调用示例)

> 因目前我只有多多客角色账号，所以示例以多多客接口为例，其他两种角色理论相同，请自行尝试

#### 调用无需授权接口示例

[](#调用无需授权接口示例)

> 多多进宝商品详情查询 pdd.ddk.goods.detail

```
$result = $pinduoduo->api->request('pdd.ddk.goods.detail',['goods_sign'=>'Y9X2o23Pb-lfwWc1wvfZk0N5-QNj-R7b_JlrlXGK3D']);
```

#### 调用需授权接口示例

[](#调用需授权接口示例)

- 获取授权 URL

```
$url = $pinduoduo->pre_auth->authorizationUrl();
```

- 重定向到授权页面

```
$pinduoduo->pre_auth->authorizationRedirect();
```

- 在重定向页面，你可以获取此次授权账号的 token

```
$token = $pinduoduo->pre_auth->getAccessToken();
//也可以通过上面得到的 refresh_token 去刷新令牌
//$token = $pinduoduo->pre_auth->refreshToken($token['refresh_token']);
```

- 创建授权应用

```
$pinduoduo = $pinduoduo->oauth->createAuthorization($token['token']);
```

> 获取当前账号下有多少推广位 pdd.ddk.oauth.goods.pid.query

```
$result   = $pinduoduo->auth_api->request('pdd.ddk.oauth.goods.pid.query');
```

### 以上调用需授权接口示例步骤可改为以下一条语句（推荐）

[](#以上调用需授权接口示例步骤可改为以下一条语句推荐)

```
$result   = $pinduoduo->api->auth()->request('pdd.ddk.goods.pid.query')
```

### 文档

[](#文档)

[拼多多开放平台](http://open.pinduoduo.com/) · [官方文档](http://open.pinduoduo.com/#/apidocument)

Star History
------------

[](#star-history)

[![Star History Chart](https://camo.githubusercontent.com/cfd019ee2fe83c332da27d4317d116cb4bba5478cc48595b4726106ecc3d2e32/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d7a68756765722f70696e64756f64756f26747970653d44617465)](https://star-history.com/#zhuger/pinduoduo&Date)

### 感谢

[](#感谢)

- [hanson/foundation-sdk](https://github.com/Hanson/foundation-sdk)

License
-------

[](#license)

MIT

[![FOSSA Status](https://camo.githubusercontent.com/55315beab4e1c9e454c8b12462c10a20c79282fd2f162ac3a663c49a093410c0/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d2532467a687567657225324670696e64756f64756f2e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Fzhuger%2Fpinduoduo?ref=badge_large)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8719f19d1749d7059f5e2e4620874e099361eafb07d61b6b891c24e09b5cd522?d=identicon)[zhuger](/maintainers/zhuger)

---

Top Contributors

[![zhuger](https://avatars.githubusercontent.com/u/33123383?v=4)](https://github.com/zhuger "zhuger (1 commits)")

### Embed Badge

![Health badge](/badges/zhuger-pinduoduo/health.svg)

```
[![Health](https://phpackages.com/badges/zhuger-pinduoduo/health.svg)](https://phpackages.com/packages/zhuger-pinduoduo)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

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

GitHub API v3 client

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

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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