New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

taobao-openapi

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

taobao-openapi

api client for taobao open platform


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created

taobao-openapi

淘宝开放平台SDK,用于node平台

Install

npm install taobao-openapi --save

Examlpe

var Taobao = require("taobao-openapi");

var top = new Taobao({
    app_key: "yourAppKey",
    app_secret: "yourAppSecret"
});

top.get("taobao.shop.get", {
    nick: "nickname",
    fields: "sid,cid,nick,title,desc,shop_score"
}, function(err, body){
    if(err){
        return console.log(err);
    }
    console.log(body);
});

top.post("taobao.shop.get", {
    nick: "nickname",
    fields: "sid,cid,nick,title,desc,shop_score"
}, function(err, body){
    if(err){
        return console.log(err);
    }
    console.log(body);
});

API

get请求:

top.get(method, [config], args, callback)
    method:api接口名称
    config:可选,配置对象,只对当前请求有效
    args:接口参数
    callback:回调函数,包含错误参数err和响应body

post请求:

top.post(method, [config], args, callback)
    method:api接口名称
    config:可选,配置对象,只对当前请求有效
    args:接口参数
    callback:回调函数,包含错误参数err和响应body

Features

1、configure

配置全局参数

top.configure({
    session: "yourSession"
});

目前有效参数:

attributedescriptiondefault
sessionsessionnull
debug是否开启沙箱false
httpshttps请求false

目前只支持json响应格式,不支持xml格式;

目前只支持MD5加密方法;

欢迎fork!

FAQs

Package last updated on 04 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts