{"id":13586816,"url":"https://github.com/phoet/asin","last_synced_at":"2025-04-04T12:07:45.553Z","repository":{"id":961885,"uuid":"750793","full_name":"phoet/asin","owner":"phoet","description":":books: :package: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations","archived":false,"fork":false,"pushed_at":"2022-02-07T11:03:25.000Z","size":446,"stargazers_count":167,"open_issues_count":2,"forks_count":59,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-01T22:35:50.480Z","etag":null,"topics":["amazon","asin","ruby"],"latest_commit_sha":null,"homepage":"http://asin.herokuapp.com/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phoet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-07-01T06:35:01.000Z","updated_at":"2024-04-12T14:22:03.000Z","dependencies_parsed_at":"2022-08-16T11:35:28.723Z","dependency_job_id":null,"html_url":"https://github.com/phoet/asin","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoet%2Fasin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoet%2Fasin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoet%2Fasin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoet%2Fasin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phoet","download_url":"https://codeload.github.com/phoet/asin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174418,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","asin","ruby"],"created_at":"2024-08-01T15:05:49.934Z","updated_at":"2025-04-04T12:07:45.534Z","avatar_url":"https://github.com/phoet.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"## Infos\n\n[![Build Status](https://img.shields.io/travis/phoet/asin/master.svg)](https://travis-ci.org/phoet/asin)\n\n\nASIN 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).\n\nFor more information on the REST calls, have a look at the whole [Amazon E-Commerce-API](http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html).\n\nHave a look at the [RDOC](http://rdoc.info/projects/phoet/asin) for this project, if you like browsing some docs.\n\nThe gem runs smoothly with Rails and is tested against multiple rubies. See *.travis.yml* for details.\n\n\n## Upgrading from Version 1.x\n\nVersion 2 removes all the SimpleXXX classes in favor of [Hashie::Rash](https://github.com/tcocca/rash).\n\nThe old API is available if you require `ASIN::Adapter`:\n\n```ruby\nrequire 'asin'\nrequire 'asin/adapter'\n```\n\nIt's also a good starting point for looking into writing your own asin-adapter.\n\n\n## Installation\n\n```bash\ngem install asin\n```\n\nor in your Gemfile:\n\n```ruby\ngem 'asin'\n```\n\n## Configuration\n\nRails style initializer (`config/initializers/asin.rb`):\n\n```ruby\nASIN::Configuration.configure do |config|\n  config.secret        = 'your-secret'\n  config.key           = 'your-key'\n  config.associate_tag = 'your-tag'\nend\n```\n\nHave a look at `ASIN::Configuration` class for all the details.\n\n## Usage\n\nASIN is designed as a module, so you can include it into any object you like:\n\n```ruby\n# require and include\nrequire 'asin'\ninclude ASIN::Client\n\n# lookup an ASIN\nlookup '1430218150'\n\n# lookup multiple items by ASIN\nlookup ['1430218150','1934356549']\n```\n\nBut you can also use the *instance* method to get a proxy-object:\n\n```ruby\n# just require\nrequire 'asin'\n\n# create an ASIN client\nclient = ASIN::Client.instance\n\n# lookup an item with the amazon standard identification number (asin)\nitems = client.lookup '1430218150'\n\n# have a look at the title of the item\nitems.first.item_attributes.title\n# =\u003e Learn Objective-C on the Mac (Learn Series)\n\n# search for any kind of stuff on amazon with keywords\nitems = client.search_keywords 'Learn', 'Objective-C'\nitems.first.item_attributes.title\n# =\u003e \"Learn Objective-C on the Mac (Learn Series)\"\n\n# search for any kind of stuff on amazon with custom parameters\nitems = client.search :Keywords =\u003e 'Learn Objective-C', :SearchIndex =\u003e :Books\nitems.first.item_attributes.title\n# =\u003e \"Learn Objective-C on the Mac (Learn Series)\"\n\n# search for similar items like the one you already have\nitems = client.similar '1430218150'\nitems.first.item_attributes.title\n# =\u003e \"Beginning iOS 7 Development: Exploring the iOS SDK\"\n```\n\nThere is an additional set of methods to support AWS cart operations:\n\n```ruby\nclient = ASIN::Client.instance\n\n# create a cart with an item\ncart = client.create_cart({:asin =\u003e '1430218150', :quantity =\u003e 1})\ncart.cart_items.cart_item\n# =\u003e [\u003c#Hashie::Rash ASIN=\"1430218150\" CartItemId=\"U3G241HVLLB8N6\" ... \u003e]\n\n# clear everything from the cart\ncart = client.clear_cart(cart)\ncart.cart_items.cart_item\n# =\u003e []\n\n# update items in the cart\ncart = client.update_items(cart, {:cart_item_id =\u003e cart.items.first.CartItemId, :action =\u003e :SaveForLater}, {:cart_item_id # =\u003e cart.items.first.CartItemId, :quantity =\u003e 7})\ncart.saved_for_later_items.saved_for_later_item\n# =\u003e [\u003c#Hashie::Rash ASIN=\"1430218150\" CartItemId=\"U3G241HVLLB8N6\" ... \u003e]\n```\n\nIt's also possible to access browse nodes:\n\n```ruby\nclient = ASIN::Client.instance\n\n# create a cart with an item\nnode = client.browse_node('17', :ResponseGroup =\u003e :TopSellers)\nnode.first.browse_node_id\n# =\u003e '163357'\nnode.first.name\n# =\u003e 'Literature \u0026 Fiction'\n```\n\n## Confiture\n\nASIN uses [Confiture](https://github.com/phoet/confiture) as a Configuration gem.\nSee the Confiture documentation for different configuration styles.\n\n\n## License\n\n\"THE (extended) BEER-WARE LICENSE\" (Revision 42.0815): [phoet](mailto:ps@nofail.de) contributed to this project.\n\nAs long as you retain this notice you can do whatever you want with this stuff.\nIf we meet some day, and you think this stuff is worth it, you can buy me some beers in return.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoet%2Fasin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoet%2Fasin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoet%2Fasin/lists"}