npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@liuliang520500/pdd-sdk

v1.0.1

Published

拼多多开放平台SDK,支持多多进宝API

Readme

@mcp/pdd-sdk

拼多多开放平台SDK,支持多多进宝API,提供完整的类型定义和示例代码。

功能特点

  • 支持多多进宝主要API
  • 完整的TypeScript类型定义
  • 详细的示例代码
  • 简单易用的接口设计
  • 内置签名算法

安装

npm install @mcp/pdd-sdk

快速开始

const { PddClient } = require('@mcp/pdd-sdk');

// 初始化客户端
const client = new PddClient({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  accessToken: 'YOUR_ACCESS_TOKEN'
});

// 使用API
async function example() {
  try {
    // 搜索商品
    const searchResult = await client.goodsSearch.search({
      keyword: '手机'
    });
    console.log(searchResult);
    
    // 生成推广链接
    const urlResult = await client.goodsPromUrlGenerate.generate({
      p_id: 'YOUR_PID',
      goods_sign_list: ['GOODS_SIGN']
    });
    console.log(urlResult);
  } catch (error) {
    console.error(error);
  }
}

支持的API

  • 商品API

    • pdd.ddk.oauth.goods.detail (商品详情查询)
    • pdd.ddk.oauth.goods.pid.generate (推广位创建)
    • pdd.ddk.oauth.goods.pid.query (推广位查询)
    • pdd.ddk.oauth.goods.prom.url.generate (商品推广链接生成)
    • pdd.ddk.oauth.goods.search (商品搜索)
    • pdd.ddk.oauth.goods.zs.unit.url.generate (转链API)
  • 工具API

    • pdd.ddk.oauth.member.authority.query (会员备案查询)
    • pdd.ddk.oauth.order.detail.get (订单详情查询)
    • pdd.ddk.oauth.resource.url.gen (频道推广)

示例代码

SDK提供了丰富的示例代码,位于examples目录下:

  • goods-detail-test.js - 商品详情查询示例
  • goods-pid-generate-test.js - 推广位创建示例
  • goods-pid-query-test.js - 推广位查询示例
  • goods-prom-url-generate-test.js - 商品推广链接生成示例
  • goods-search-test.js - 商品搜索示例
  • goods-zs-unit-url-generate-test.js - 转链示例
  • member-authority-query-test.js - 会员备案查询示例
  • order-detail-test.js - 订单详情查询示例
  • resource-url-generate-test.js - 频道推广示例

环境变量

在使用示例代码时,需要在项目根目录创建.env文件,并配置以下环境变量:

PDD_CLIENT_ID=your_client_id
PDD_CLIENT_SECRET=your_client_secret
PDD_SESSION_TOKEN=your_access_token
PDD_PID=your_pid

API文档

完整的API文档请参考拼多多开放平台文档

许可证

MIT License

作者

MCP Team ([email protected])

问题反馈

如果您在使用过程中遇到任何问题,欢迎提交 Issue 或 Pull Request。