All Projects → hakanensari → Vacuum

hakanensari / Vacuum

Licence: mit
Amazon Product Advertising API client

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Vacuum

Awesome Privacy
A curated list of services and alternatives that respect your privacy because PRIVACY MATTERS.
Stars: ✭ 303 (-43.36%)
Mutual labels:  amazon
Bento
Packer templates for building minimal Vagrant baseboxes for multiple platforms
Stars: ✭ 3,779 (+606.36%)
Mutual labels:  amazon
S3 Plugin Webpack
Uploads files to s3 after complete
Stars: ✭ 464 (-13.27%)
Mutual labels:  amazon
Ec2instances.info
Amazon EC2 instance comparison site
Stars: ✭ 3,619 (+576.45%)
Mutual labels:  amazon
Aws Sdk Java
The official AWS SDK for Java.
Stars: ✭ 3,662 (+584.49%)
Mutual labels:  amazon
Termux Archlinux
You can use setupTermuxArch.bash 📲 to install Arch Linux in Termux on Amazon, Android, Chromebook and Windows. https://sdrausty.github.io/termux-archlinux/
Stars: ✭ 384 (-28.22%)
Mutual labels:  amazon
Peddler
Amazon MWS API client
Stars: ✭ 298 (-44.3%)
Mutual labels:  amazon
Aws
A collection of bash shell scripts for automating various tasks with Amazon Web Services using the AWS CLI and jq.
Stars: ✭ 493 (-7.85%)
Mutual labels:  amazon
Amazon Product Api
💳 Amazon Product Advertising API client
Stars: ✭ 353 (-34.02%)
Mutual labels:  amazon
Whole Foods Delivery Slot
Automated script for Whole Foods and Amazon Fresh delivery slot
Stars: ✭ 460 (-14.02%)
Mutual labels:  amazon
Python Amazon Mws
Python wrapper for the Amazon Marketplace Web Service API
Stars: ✭ 324 (-39.44%)
Mutual labels:  amazon
Mastering ros
This repository contains exercise files of the book "Mastering ROS for Robotics Programming"
Stars: ✭ 351 (-34.39%)
Mutual labels:  amazon
S3rver
A fake S3 server written in NodeJs
Stars: ✭ 410 (-23.36%)
Mutual labels:  amazon
Aws.s3
Amazon Simple Storage Service (S3) API Client
Stars: ✭ 302 (-43.55%)
Mutual labels:  amazon
Ansible For Devops
Ansible for DevOps examples.
Stars: ✭ 5,265 (+884.11%)
Mutual labels:  amazon
Ccat
Cloud Container Attack Tool (CCAT) is a tool for testing security of container environments.
Stars: ✭ 300 (-43.93%)
Mutual labels:  amazon
Shep
A framework for building JavaScript Applications with AWS API Gateway and Lambda
Stars: ✭ 376 (-29.72%)
Mutual labels:  amazon
Onesignal Android Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native Android or Amazon app with OneSignal. https://onesignal.com
Stars: ✭ 503 (-5.98%)
Mutual labels:  amazon
Pigeon
iOS and Android push notifications for Elixir
Stars: ✭ 480 (-10.28%)
Mutual labels:  amazon
Aws Google Auth
Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
Stars: ✭ 428 (-20%)
Mutual labels:  amazon

Vacuum

Build Maintainability Test Coverage

Vacuum is a Ruby wrapper to Amazon Product Advertising API 5.0. The API provides programmatic access to query product information on the Amazon marketplaces.

Cart Form functionality is not covered by this gem but is a primary focus on carriage gem

You need to register first to use the API.

vacuum

Usage

Getting Started

Create a request with your marketplace credentials. Set the marketplace by passing its two-letter country code.

request = Vacuum.new(marketplace: 'US',
                     access_key: '<ACCESS_KEY>',
                     secret_key: '<SECRET_KEY>',
                     partner_tag: '<PARTNER_TAG>')

You can now access the API using the available operations.

response = request.search_items(title: 'lean startup')
puts response.to_h

Create a persistent connection to make multiple requests.

request.persistent

Operations

Refer to the API docs for more detailed information.

GetBrowseNodes

Given a BrowseNodeId, the GetBrowseNodes operation returns details about the specified browse node, like name, children and ancestors, depending on the resources specified in the request. The names and browse node IDs of the children and ancestor browse nodes are also returned. GetBrowseNodes enables you to traverse the browse node hierarchy to find a browse node.

request.get_browse_nodes(
  browse_node_ids: ['283155', '3040'],
  resources: ['BrowseNodes.Ancestor', 'BrowseNodes.Children']
)

GetItems

Given an Item identifier, the GetItems operation returns the item attributes, based on the resources specified in the request.

request.get_items(
  item_ids: ['B0199980K4', 'B000HZD168', 'B01180YUXS', 'B00BKQTA4A'],
  resources: ['Images.Primary.Small', 'ItemInfo.Title', 'ItemInfo.Features',
              'Offers.Summaries.HighestPrice' , 'ParentASIN']
)

GetVariations

Given an ASIN, the GetVariations operation returns a set of items that are the same product, but differ according to a consistent theme, for example size and color. These items which differ according to a consistent theme are called variations. A variation is a child ASIN. The parent ASIN is an abstraction of the children items. For example, a shirt is a parent ASIN and parent ASINs cannot be sold. A child ASIN would be a blue shirt, size 16, sold by MyApparelStore. This child ASIN is one of potentially many variations. The ways in which variations differ are called dimensions.

request.get_variations(
  asin: 'B00422MCUS',
  resources: ['ItemInfo.Title', 'VariationSummary.Price.HighestPrice',
              'VariationSummary.Price.LowestPrice',
              'VariationSummary.VariationDimension']
)

SearchItems

The SearchItems operation searches for items on Amazon based on a search query. The API returns up to ten items per search request.

request.search_items(keywords: 'harry potter')

Response

Consume a response by parsing it into a Ruby hash.

response.to_h

You can also #dig into this hash.

response.dig('ItemsResult', 'Items')

Logging

Write requests and reponses to a logger using the logging feature of the HTTP gem under the hood:

require 'logger'

logger = Logger.new(STDOUT)
request.use(logging: {logger: logger})

Bring your parser

You can extend Vacuum with a custom parser. Just swap the original with a class or module that responds to .parse.

response.parser = MyParser
response.parse

If no custom parser is set, Vacuum::Response#parse delegates to #to_h.

VCR

If you are using VCR to test an app that accesses the API, you can use the custom VCR matcher of Vacuum to stub requests.

require 'vacuum/matcher'

# in your test
VCR.insert_cassette('cassette_name',
                    match_requests_on: [Vacuum::Matcher])

In RSpec, use the :paapi metadata.

require 'vacuum/matcher'

# in your test
it 'queries Amazon', :paapi do
end

Development

Clone the repo and install dependencies.

bundle install

Tests and Rubocop should now pass as-is.

bundle exec rake

By default, the tests stub requests. Use the RECORD env var to record new interactions.

RECORD=true bundle exec rake test

You can set the LIVE env var to run all tests against live data.

LIVE=true bundle exec rake test

In either case, add actual API credentials to a locales.yml file under test.

Getting Help

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].