Socket
Socket
Sign inDemoInstall

apa-api

Package Overview
Dependencies
79
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    apa-api

Amazon Product Advertising API client


Version published
Weekly downloads
26
increased by13.04%
Maintainers
1
Install size
13.4 MB
Created
Weekly downloads
 

Readme

Source

node-apa-api

Amazon Product Advertising API client

Goals

Module provides easy access to the Amazon Product Advertising API:

  • REST Request Anatomy
  • Request Signatures

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)

Keywords

FAQs

Last updated on 06 Mar 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc