# 电商CPS Python SDK整合 **Repository Path**: dragons96/online-mall-cps-sdk-python ## Basic Information - **Project Name**: 电商CPS Python SDK整合 - **Description**: 电商CPS Python SDK整合 包含淘宝CPS,京东CPS,拼多多CPS,唯品会CPS,抖店等 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 13 - **Forks**: 8 - **Created**: 2021-09-18 - **Last Updated**: 2026-02-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Python 电商CPS SDK 整合 #### 目前仅支持: 1. 淘宝CPS 2. 京东CPS 3. 拼多多CPS 4. 唯品会CPS 5. 抖店CPS #### 安装: ``` pip install cps_sdk --upgrade ``` #### 使用示例: ##### 1.淘宝CPS(其他供应商大同小异, 返回response均为requests模块返回的response对象) ```python from third_sdk import TbClient client = TbClient(host='', appkey='', secret='') # 0.0.5版本后支持api名称搜索, 推荐 resp = client.api_invoke('taobao.tbk.dg.optimus.material', **{'pid': ''}) print(resp) ``` ##### 2.京东CPS ```python from third_sdk import JdClient client = JdClient(appkey='', secret='') # 0.0.5版本后支持api名称+version搜索, 推荐 resp = client.api_invoke('jd.union.open.goods.query', version='1.0', **{ 'goodsReqDTO': { 'keyword': "手机" } }) print(resp) ``` ##### 3.拼多多CPS ```python from third_sdk import PddClient client = PddClient(appkey='', secert='') # 0.0.5版本后支持, 推荐 resp = client.api_invoke('pdd.ddk.goods.search', **{ 'keyword': '手机' }) print(resp.text) ``` ##### 4.唯品会CPS ```python from third_sdk import VipClient client = VipClient(appkey='', secret='') # 0.0.5版本后支持, 推荐 resp = client.api_invoke('getByGoodsIdsV2', **{ 'request': { 'goodsIds': ['xxxx'] } }) print(resp.text) ``` ##### 5.抖店CPS ```python from third_sdk import DouDianClient def get_access_token(): """ :return access_token """ # 需要自己实现 pass client = DouDianClient(appkey='', secret='', get_access_token_func=get_access_token) # 0.0.5版本后支持, 推荐 resp = client.api_invoke('buyin.kolMaterialsProductsSearch', **{ 'title': '手机' }) print(resp.text) ```