Python Amazon Simple Product API

class amazon.api.AmazonCart(parsed_response)[source]

Wrapper around Amazon shopping cart. Allows iterating over Items in the cart.

exception amazon.api.AmazonException[source]

Base Class for Amazon Api Exceptions.

class amazon.api.AmazonProduct(item, aws_associate_tag, api, *args, **kwargs)[source]

A wrapper class for an Amazon product.

actors[source]

Movie Actors.

Returns:A list of actors names.
asin[source]

ASIN (Amazon ID)

Returns:ASIN (string).
author[source]

Author. Depricated, please use authors.

Returns:Author (string).
authors[source]

Authors.

Returns:Returns of list of authors
availability[source]

Availability

Returns:Availability (string).
availability_max_hours[source]

AvailabilityAttributes.MaximumHours

Returns:MaximumHours (string).
availability_min_hours[source]

AvailabilityAttributes.MinimumHours

Returns:MinimumHours (string).
availability_type[source]

AvailabilityAttributes.AvailabilityType

Returns:AvailabilityType (string).
binding[source]

Binding.

Returns:Binding (string)
brand[source]

Brand.

Returns:Brand (string)
browse_nodes[source]

Browse Nodes.

Returns:A list of AmazonBrowseNode objects.
color[source]

Color.

Returns:Color (string)
creators[source]

Creators.

Creators are not the authors. These are usually editors, translators, narrators, etc.

Returns:Returns a list of creators where each is a tuple containing:
  1. The creators name (string).
  2. The creators role (string).
detail_page_url[source]

DetailPageURL.

Returns:DetailPageURL (string)
directors[source]

Movie Directors.

Returns:A list of directors for a movie.
ean[source]

EAN.

Returns:EAN (string)
edition[source]

Edition.

Returns:Edition (string)
editorial_review[source]

Editorial Review.

Returns an editorial review text.

Returns:Editorial Review (string)
editorial_reviews[source]

Editorial Review.

Returns a list of all editorial reviews.

Returns:A list containing:
Editorial Review (string)
eisbn[source]

EISBN (The ISBN of eBooks).

Returns:EISBN (string)
features[source]

Features.

Returns a list of feature descriptions.

Returns:Returns a list of ‘ItemAttributes.Feature’ elements (strings).
formatted_price[source]

FormattedPrice.

Returns:FormattedPrice (string)
genre[source]

Movie Genre.

Returns:The genre of a movie.
get_attribute(name)[source]

Get Attribute

Get an attribute (child elements of ‘ItemAttributes’) value.

Parameters:name – Attribute name (string)
Returns:Attribute value (string) or None if not found.
get_attribute_details(name)[source]

Get Attribute Details

Gets XML attributes of the product attribute. These usually contain details about the product attributes such as units.

Parameters:name – Attribute name (string)
Returns:A name/value dictionary.
get_attributes(name_list)[source]

Get Attributes

Get a list of attributes as a name/value dictionary.

Parameters:name_list – A list of attribute names (strings).
Returns:A name/value dictionary (both names and values are strings).
get_parent()[source]

Get Parent.

Fetch parent product if it exists. Use parent_asin to check if a parent exist before fetching.

Returns:An instance of AmazonProduct representing the parent product.
images[source]

List of images for a response. When using lookup with RespnoseGroup ‘Images’, you’ll get a list of images. Parse them so they are returned in an easily used list format.

Returns:A list of ObjectifiedElement images
is_adult[source]

IsAdultProduct.

Returns:IsAdultProduct (string)
is_preorder[source]

IsPreorder (Is Preorder)

Returns:IsPreorder (string).
isbn[source]

ISBN.

Returns:ISBN (string)
label[source]

Label.

Returns:Label (string)
languages[source]

Languages.

Returns a set of languages in lower-case.

Returns:Returns a set of languages in lower-case (strings).
large_image_url[source]

Large Image URL.

Returns:Large image url (string)
list_price[source]

List Price.

Returns:A tuple containing:
  1. Decimal representation of price.
  2. ISO Currency code (string).
manufacturer[source]

Manufacturer.

Returns:Manufacturer (string)
medium_image_url[source]

Medium Image URL.

Returns:Medium image url (string)
model[source]

Model Name.

Returns:Model (string)
mpn[source]

MPN.

Returns:MPN (string)
offer_id[source]

Offer ID

Returns:Offer ID (string).
offer_url[source]

Offer URL

Returns:Offer URL (string).
pages[source]

Pages.

Returns:Pages (string)
parent_asin[source]

Parent ASIN.

Can be used to test if product has a parent.

Returns:Parent ASIN if product has a parent.
part_number[source]

Part Number.

Returns:Part Number (string)
price_and_currency[source]

Get Offer Price and Currency.

Return price according to the following process:

  • If product has a sale return Sales Price, otherwise,
  • Return Price, otherwise,
  • Return lowest offer price, otherwise,
  • Return None.
Returns:A tuple containing:
  1. Decimal representation of price.
  2. ISO Currency code (string).
product_group[source]

ProductGroup.

Returns:ProductGroup (string)
product_type_name[source]

ProductTypeName.

Returns:ProductTypeName (string)
publication_date[source]

Pubdate.

Returns:Pubdate (datetime.date)
publisher[source]

Publisher.

Returns:Publisher (string)
release_date[source]

Release date .

Returns:Release date (datetime.date)
reviews[source]

Customer Reviews.

Get a iframe URL for customer reviews.

Returns:A tuple of: has_reviews (bool), reviews url (string)
running_time[source]

RunningTime.

Returns:RunningTime (string)
sales_rank[source]

Sales Rank

Returns:Sales Rank (integer).
sku[source]

SKU.

Returns:SKU (string)
small_image_url[source]

Small Image URL.

Returns:Small image url (string)
studio[source]

Studio.

Returns:Studio (string)
tiny_image_url[source]

Tiny Image URL.

Returns:Tiny image url (string)
title[source]

Title.

Returns:Title (string)
upc[source]

UPC.

Returns:UPC (string)
class amazon.api.AmazonSearch(api, aws_associate_tag, **kwargs)[source]

Amazon Search.

A class providing an iterable over amazon search results.

iterate_pages()[source]

Iterate Pages.

A generator which iterates over all pages. Keep in mind that Amazon limits the number of pages it makes available.

Returns:Yields lxml root elements.
exception amazon.api.AsinNotFound[source]

ASIN Not Found Exception.

exception amazon.api.BrowseNodeLookupException[source]

Browse Node Lookup Exception.

exception amazon.api.CartException[source]

Cart related Exception

exception amazon.api.CartInfoMismatchException[source]

HMAC, CartId and AssociateTag did not match

exception amazon.api.LookupException[source]

Lookup Exception.

exception amazon.api.NoMorePages[source]

No More Pages Exception.

exception amazon.api.RequestThrottled[source]

Exception for when Amazon has throttled a request, per: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ErrorNumbers.html

exception amazon.api.SearchException[source]

Search Exception.

exception amazon.api.SimilartyLookupException[source]

Similarty Lookup Exception.

Previous topic

Welcome to Python Amazon Simple Product API’s documentation!

This Page