All Projects → phoet → Asin

phoet / Asin

📚 📦 Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Asin

Awesome Amazon Seller
A curated list of tools and resources for Amazon sellers.
Stars: ✭ 117 (-30.36%)
Mutual labels:  amazon
Amazonbigspider
😱Full Automatic Amazon Distributed Spider | 亚马逊分布式四国际站采集选款产品|账号admin,密码adminadmin
Stars: ✭ 140 (-16.67%)
Mutual labels:  amazon
Nager.amazonproductadvertising
.NET Amazon Product Advertising Client
Stars: ✭ 147 (-12.5%)
Mutual labels:  amazon
Alexa Voice Service.js
Library for interacting with Alexa Voice Service (AVS) in the browser.
Stars: ✭ 123 (-26.79%)
Mutual labels:  amazon
Dash Button
A small Node.js server that reacts to Amazon Dash buttons on your WiFi network
Stars: ✭ 135 (-19.64%)
Mutual labels:  amazon
Django Amazon Price Monitor
Monitors prices of Amazon products via Product Advertising API
Stars: ✭ 141 (-16.07%)
Mutual labels:  amazon
S3fs
Amazon S3 filesystem for PyFilesystem2
Stars: ✭ 111 (-33.93%)
Mutual labels:  amazon
Cognito Express
Authenticates API requests on a Node application by verifying the JWT signature of AccessToken or IDToken generated by Amazon Cognito.
Stars: ✭ 165 (-1.79%)
Mutual labels:  amazon
Big Companies Interview Questions
A curated list of previous asked Interview Question at Big Companies and Startups 🤲 🏆
Stars: ✭ 135 (-19.64%)
Mutual labels:  amazon
Machine Learning Using K8s
Train and Deploy Machine Learning Models on Kubernetes using Amazon EKS
Stars: ✭ 145 (-13.69%)
Mutual labels:  amazon
Ecs Exporter
Export AWS ECS cluster metrics to Prometheus
Stars: ✭ 127 (-24.4%)
Mutual labels:  amazon
Voicewp
Create Alexa Skills through WordPress
Stars: ✭ 132 (-21.43%)
Mutual labels:  amazon
Serverless Dynamodb Autoscaling
Serverless Plugin for Amazon DynamoDB Auto Scaling configuration.
Stars: ✭ 142 (-15.48%)
Mutual labels:  amazon
Cash
HTTP response caching for Koa. Supports Redis, in-memory store, and more!
Stars: ✭ 122 (-27.38%)
Mutual labels:  amazon
Aws Sdk Perl
A community AWS SDK for Perl Programmers
Stars: ✭ 153 (-8.93%)
Mutual labels:  amazon
File Storage
File storage abstraction for Yii2
Stars: ✭ 116 (-30.95%)
Mutual labels:  amazon
Dasshio
Hass.io add-on to easily use Amazon Dash Buttons with Home Assistant
Stars: ✭ 140 (-16.67%)
Mutual labels:  amazon
Aws Toolkit Azure Devops
AWS Toolkit for Azure DevOps
Stars: ✭ 165 (-1.79%)
Mutual labels:  amazon
Dynasty
Dynasty - Promise-based, clean DynamoDB API
Stars: ✭ 157 (-6.55%)
Mutual labels:  amazon
Terraform Aws Landing Zone
Terraform Module for AWS Landing Zone
Stars: ✭ 142 (-15.48%)
Mutual labels:  amazon

Infos

Build Status

ASIN is a simple, extensible wrapper for parts of the REST-API of Amazon Product Advertising API (aka Associates Web Service aka Amazon E-Commerce Service).

For more information on the REST calls, have a look at the whole Amazon E-Commerce-API.

Have a look at the RDOC for this project, if you like browsing some docs.

The gem runs smoothly with Rails and is tested against multiple rubies. See .travis.yml for details.

Upgrading from Version 1.x

Version 2 removes all the SimpleXXX classes in favor of Hashie::Rash.

The old API is available if you require ASIN::Adapter:

require 'asin'
require 'asin/adapter'

It's also a good starting point for looking into writing your own asin-adapter.

Installation

gem install asin

or in your Gemfile:

gem 'asin'

Configuration

Rails style initializer (config/initializers/asin.rb):

ASIN::Configuration.configure do |config|
  config.secret        = 'your-secret'
  config.key           = 'your-key'
  config.associate_tag = 'your-tag'
end

Have a look at ASIN::Configuration class for all the details.

Usage

ASIN is designed as a module, so you can include it into any object you like:

# require and include
require 'asin'
include ASIN::Client

# lookup an ASIN
lookup '1430218150'

# lookup multiple items by ASIN
lookup ['1430218150','1934356549']

But you can also use the instance method to get a proxy-object:

# just require
require 'asin'

# create an ASIN client
client = ASIN::Client.instance

# lookup an item with the amazon standard identification number (asin)
items = client.lookup '1430218150'

# have a look at the title of the item
items.first.item_attributes.title
# => Learn Objective-C on the Mac (Learn Series)

# search for any kind of stuff on amazon with keywords
items = client.search_keywords 'Learn', 'Objective-C'
items.first.item_attributes.title
# => "Learn Objective-C on the Mac (Learn Series)"

# search for any kind of stuff on amazon with custom parameters
items = client.search :Keywords => 'Learn Objective-C', :SearchIndex => :Books
items.first.item_attributes.title
# => "Learn Objective-C on the Mac (Learn Series)"

# search for similar items like the one you already have
items = client.similar '1430218150'
items.first.item_attributes.title
# => "Beginning iOS 7 Development: Exploring the iOS SDK"

There is an additional set of methods to support AWS cart operations:

client = ASIN::Client.instance

# create a cart with an item
cart = client.create_cart({:asin => '1430218150', :quantity => 1})
cart.cart_items.cart_item
# => [<#Hashie::Rash ASIN="1430218150" CartItemId="U3G241HVLLB8N6" ... >]

# clear everything from the cart
cart = client.clear_cart(cart)
cart.cart_items.cart_item
# => []

# update items in the cart
cart = client.update_items(cart, {:cart_item_id => cart.items.first.CartItemId, :action => :SaveForLater}, {:cart_item_id # => cart.items.first.CartItemId, :quantity => 7})
cart.saved_for_later_items.saved_for_later_item
# => [<#Hashie::Rash ASIN="1430218150" CartItemId="U3G241HVLLB8N6" ... >]

It's also possible to access browse nodes:

client = ASIN::Client.instance

# create a cart with an item
node = client.browse_node('17', :ResponseGroup => :TopSellers)
node.first.browse_node_id
# => '163357'
node.first.name
# => 'Literature & Fiction'

Confiture

ASIN uses Confiture as a Configuration gem. See the Confiture documentation for different configuration styles.

License

"THE (extended) BEER-WARE LICENSE" (Revision 42.0815): phoet contributed to this project.

As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me some beers in return.

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].