1.0.2 • Published 4 years ago

taobaoke_api v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

taobaoke_sdk

淘宝联盟开放平台 淘宝客node sdk,欢迎issue和pr。 淘宝联盟开放平台 淘宝联盟淘宝客API

安装

使用npm:

npm i taobaoke_api -S

或者yarn:

yarn add taobaoke_api

引入文件

const ApiClient = require('taobaoke_api').ApiClient

配置

使用淘宝联盟的appkey,secretkey和api的rul进行初始化:

const client = new ApiClient({
    'appkey':'',
    'appsecret':'',
    'url':'http://gw.api.tbsandbox.com/router/rest'// 默认为http://gw.api.taobao.com/router/rest
});

Demo

例如查询商品

const respone = await client.execute('taobao.tbk.dg.material.optional', {
    'q':Param.q,
    'adzone_id':Param.adzone_id
})

注意调用api返回的都是promise,因此可使用async/await。: