apa-api
Amazon Product Advertising API client
Last updated 4 years ago by sekko27 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apa-api 
SYNC missed versions from official npm registry.

node-apa-api

Amazon Product Advertising API client

Goals

Module provides easy access to the Amazon Product Advertising API:

Usage

Models

APIMeta properties

Represents API connection details:

{APIMeta} = require 'apa-api'

# Default options, you can skip it
options = {
    protocol: 'http'
    endPoint: 'webservices.amazon.com'
    service: 'AWSECommerceService'
    uri: '/onca/xml'
    method: 'GET'
    version: '2011-08-01'
}
meta = new APIMeta(options)

Credential

Represents API authentication data (AWS access/secret):

{Credential} = require 'apa-api'
options = {
    accessKey: "Your AWS access key",
    secretKey: "Your AWS secret key",
    associateTag: "Associate tag"
}
credential = new Credential(options)

Service

Use this client to the Amazon Product Advertising service.

{Service, ApiMeta, Credential} = require 'apa-api'
connectionDetails = {} # See above
credentialDetails = {} # See above

service = new Service(new ApiMeta(connectionDetails), new Credentials(credentialDetails), [signer], [client])

Service use the following optional members:

  • signer - Request signer, default to RequestSigner
  • client - Default to request

Service provides methods (feature enrichment in progress):

  • itemLookup - itemLookup(params) - The method checks parameters: mandatory parameters, type checking, defaults (do not send params equal to defaults).

Usage

Using defaults

async = require 'async'
concat = require 'concat-stream'
{Service, ApiMeta, Credential} = require 'apa-api'

service = new Service(new ApiMeta(), new Credentials())
itemIds = ['0123456789', '1234567890', '2345678901', ...]
async.mapLimit itemIds, 5, (itemId, callback) -> 
    service.itemLookup(itemId: itemId)
        .on 'error', callback
        .pipe concat (response) ->
            # Response can contain error has been described in xml
            # We ignore this validation in this example
            callback(null, response)

Current Tags

  • 0.1.5                                ...           latest (4 years ago)

13 Versions

  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           5 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |