@simonjayhawkins/ubiquitous-winner

A command-line tool to fetch ASIN item attributes using Amazon Marketplace Web Services API


License
MIT
Install
npm install @simonjayhawkins/ubiquitous-winner@1.0.0-alpha.4

Documentation

ubiquitous-winner

npm version JavaScript Style Guide

Installation

install globally using npm so that it may be run from the command line.

npm install -g @simonjayhawkins/ubiquitous-winner

Configuration

create mwsconfig.json in your home directory for Amazon Marketplace credentials

{
    "merchantId": "<Your Merchant Id>",
    "accessKeyId": "<Your AWS Access Key ID>",
    "secretAccessKey": "<Your AWS Secret Key>",
    "endpoint": "<Your Marketplace Endpoint>",
    "marketplaceId": "<Your Default Marketplace Id>"
}

create config.json in the working directory

{
  "GetMatchingProductForId": {
    "dataService": {
      "default": "localFileSystem",
      "services": [
        {
          "name": "localFileSystem",
          "module": "data-service-local-fs",
          "eventSourceFilePrefix": "item-attributes/item-attributes",
          "eventSourceFileExt": "log",
          "snapshotFilePrefix": "item-attributes.snapshot",
          "snapshotFileExt": "txt",
          "responseHistoryPath": "mws-responses/GetMatchingProductForId"
        },
        {
          "name": "localFileSystem+S3",
          "module": "data-service-local+S3",
          "eventSourceFilePrefix": "item-attributes/item-attributes",
          "eventSourceFileExt": "log",
          "snapshotFilePrefix": "item-attributes.snapshot",
          "snapshotFileExt": "txt",
          "responseHistoryBucketName": "<myBucket>",
          "responseHistoryBucketRegion": "eu-west-1",
          "responseHistoryObjectPrefix": "mws-requests/GetMatchingProductForId",
          "responseHistoryObjectStorageClass": "STANDARD | REDUCED_REDUNDANCY | STANDARD_IA"
        },
        {
          "name": "AWS",
          "module": "data-service-aws",
          "eventSourceTableName": "item-attributes",
          "snapshotTableName": "item-attributes.snapshot",
          "responseHistoryBucketName": "<myBucket>",
          "responseHistoryBucketRegion": "eu-west-1",
          "responseHistoryObjectPrefix": "mws-requests/GetMatchingProductForId",
          "responseHistoryObjectStorageClass": "STANDARD | REDUCED_REDUNDANCY | STANDARD_IA"
        }
      ]
    }
  }
}

If using AWS create a credentials file at ~/.aws/credentials on Mac/Linux or C:\Users\USERNAME\.aws\credentials on Windows

[default]

aws_access_key_id = your_access_key

aws_secret_access_key = your_secret_key

Usage

  Usage: getproductdata [options] [file]

  A command-line tool to fetch ASIN item attributes using Amazon Marketplace Web Services API

  Options:

    -h, --help                    output usage information
    -V, --version                 output the version number
    -v, --verbose                 additional output
    -a, --all                     process all ASIN in <file>
    -c, --config <path>           set dataservice config path. defaults to config.json
    -m, --mws-credentials <path>  set MWS credentials path. defaults to /home/user/mwsconfig.json