Documentation
¶
Overview ¶
Package amazon provides methods for interacting with the Amazon Product Advertising API
types that help with using the Product Advertising API
helpers to transform the XML response to a struct
Index ¶
- Constants
- type Argument
- type Dimension
- type Dimensions
- type EditorialReview
- type EditorialReviews
- type Error
- type Image
- type Item
- type ItemAttributes
- type ItemLookupRequest
- type ItemLookupResponse
- type Offer
- type OfferSummary
- type Offers
- type Price
- type ProductAPI
- func (api ProductAPI) BrowseNodeLookup(nodeId string) ([]byte, error)
- func (api ProductAPI) BrowseNodeLookupWithResponseGroup(nodeId string, responseGroup string) ([]byte, error)
- func (api ProductAPI) CartAdd(items map[string]int, cartid, HMAC string) ([]byte, error)
- func (api ProductAPI) CartClear(CartId, HMAC string) ([]byte, error)
- func (api ProductAPI) CartCreate(items map[string]int) ([]byte, error)
- func (api ProductAPI) CartGet(CartId, HMAC string) ([]byte, error)
- func (api ProductAPI) ItemLookup(ItemId string) ([]byte, error)
- func (api ProductAPI) ItemLookupWithParams(params map[string]string) ([]byte, error)
- func (api ProductAPI) ItemLookupWithResponseGroup(ItemId string, ResponseGroup string) ([]byte, error)
- func (api ProductAPI) ItemSearch(SearchIndex string, Parameters map[string]string) ([]byte, error)
- func (api ProductAPI) ItemSearchByKeyword(Keywords string, page int) ([]byte, error)
- func (api ProductAPI) ItemSearchByKeywordWithResponseGroup(Keywords string, ResponseGroup string) ([]byte, error)
- func (api ProductAPI) MultipleItemLookup(ItemIds []string) ([]byte, error)
- func (api ProductAPI) MultipleItemLookupWithResponseGroup(ItemIds []string, ResponseGroup string) ([]byte, error)
- func (api ProductAPI) MultipleSimilarityLookup(ItemIds []string) ([]byte, error)
- func (api ProductAPI) MultipleSimilarityLookupWithResponseGroup(ItemIds []string, ResponseGroup string) ([]byte, error)
- func (api ProductAPI) SimilarityLookup(ItemId string) ([]byte, error)
- func (api ProductAPI) SimilarityLookupWithResponseGroup(ItemId string, ResponseGroup string) ([]byte, error)
- type Response
- type SimilarProduct
- type SimilarProducts
Constants ¶
const ( MINIMUM_RESPONSE_GROUP string = "ItemAttributes,Small,SalesRank" DEFAULT_RESPONSE_GROUP string = "Images,ItemAttributes,Small,SalesRank" EXTENDED_RESPONSE_GROUP string = "Images,ItemAttributes,Small,SalesRank,EditorialReview" )
const ENDPOINT_URI = "/onca/xml"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dimensions ¶
type EditorialReview ¶
type EditorialReviews ¶
type EditorialReviews struct {
EditorialReviews []EditorialReview `xml:"EditorialReview"`
}
type Item ¶
type Item struct { ASIN string URL string DetailPageURL string SalesRank int SmallImage Image MediumImage Image LargeImage Image ItemAttributes ItemAttributes OfferSummary OfferSummary Offers Offers EditorialReviews EditorialReviews SimilarProducts SimilarProducts }
Item represents a product returned by the API
type ItemAttributes ¶
type ItemAttributes struct { Title string SKU string EAN string Brand string Feature []string ProductGroup string ProductTypeName string IsAdultProduct bool Manufacturer string Model string Publisher string ReleaseDate string Studio string Warranty string Label string PackageDimensions Dimensions PackageQuantity int }
ItemAttributes response group
type ItemLookupRequest ¶
type ItemLookupRequest struct { IDType string `xml:"IdType"` ItemID string `xml:"ItemId"` ResponseGroups []string `xml:"ResponseGroup"` VariationPage string }
ItemLookupRequest is the confirmation of a ItemLookup request
type ItemLookupResponse ¶
type ItemLookupResponse struct { Response Items struct { Request struct { IsValid bool ItemLookupRequest ItemLookupRequest Errors []Error `xml:"Errors>Error"` } TotalResults int TotalPages int Item []Item } }
ItemLookupResponse describes the API response for the ItemLookup operation
func ConvertToItemLookupResponse ¶
func ConvertToItemLookupResponse(response []byte) (*ItemLookupResponse, error)
type Offer ¶
type Offer struct { Condition string `xml:"OfferAttributes>Condition"` ID string `xml:"OfferListing>OfferListingId"` Price Price `xml:"OfferListing>Price"` PercentageSaved uint `xml:"OfferListing>PercentageSaved"` Availability string `xml:"OfferListing>Availability"` }
Offer response attribute
type OfferSummary ¶
type OfferSummary struct { LowestNewPrice Price LowerUsedPrice Price TotalNew int TotalUsed int TotalCollectible int TotalRefurbished int }
OfferSummary response group
type Offers ¶
type Offers struct { TotalOffers int TotalOfferPages int MoreOffersURL string `xml:"MoreOffersUrl"` Offers []Offer `xml:"Offer"` }
Offers response group
type ProductAPI ¶
type ProductAPI struct { AccessKey string SecretKey string AssociateTag string Host string Region string Client *http.Client }
func (ProductAPI) BrowseNodeLookup ¶
func (api ProductAPI) BrowseNodeLookup(nodeId string) ([]byte, error)
BrowseNodeLookup takes a BrowseNodeId and returns the result.
func (ProductAPI) BrowseNodeLookupWithResponseGroup ¶
func (api ProductAPI) BrowseNodeLookupWithResponseGroup(nodeId string, responseGroup string) ([]byte, error)
func (ProductAPI) CartAdd ¶
CartAdd takes a map containing ASINs and quantities and adds them to the given cart. Up to 10 items are allowed
func (ProductAPI) CartClear ¶
func (api ProductAPI) CartClear(CartId, HMAC string) ([]byte, error)
CartClear takes a CartId and HMAC that were returned when generating a cart It then removes the contents of the cart
func (ProductAPI) CartCreate ¶
func (api ProductAPI) CartCreate(items map[string]int) ([]byte, error)
CartCreate takes a map containing ASINs and quantities. Up to 10 items are allowed
func (ProductAPI) CartGet ¶
func (api ProductAPI) CartGet(CartId, HMAC string) ([]byte, error)
Cart get takes a CartID and HMAC that were returned when generating a cart Returns the contents of the specified cart
func (ProductAPI) ItemLookup ¶
func (api ProductAPI) ItemLookup(ItemId string) ([]byte, error)
ItemLookup takes a product ID (ASIN) and returns the result
func (ProductAPI) ItemLookupWithParams ¶
func (api ProductAPI) ItemLookupWithParams(params map[string]string) ([]byte, error)
ItemLookupWithParams takes the params for ItemLookup and returns the result
func (ProductAPI) ItemLookupWithResponseGroup ¶
func (api ProductAPI) ItemLookupWithResponseGroup(ItemId string, ResponseGroup string) ([]byte, error)
func (ProductAPI) ItemSearch ¶
func (ProductAPI) ItemSearchByKeyword ¶
func (api ProductAPI) ItemSearchByKeyword(Keywords string, page int) ([]byte, error)
ItemSearchByKeyword takes a string containing keywords and returns the search results
func (ProductAPI) ItemSearchByKeywordWithResponseGroup ¶
func (api ProductAPI) ItemSearchByKeywordWithResponseGroup(Keywords string, ResponseGroup string) ([]byte, error)
func (ProductAPI) MultipleItemLookup ¶
func (api ProductAPI) MultipleItemLookup(ItemIds []string) ([]byte, error)
func (ProductAPI) MultipleItemLookupWithResponseGroup ¶
func (api ProductAPI) MultipleItemLookupWithResponseGroup(ItemIds []string, ResponseGroup string) ([]byte, error)
func (ProductAPI) MultipleSimilarityLookup ¶
func (api ProductAPI) MultipleSimilarityLookup(ItemIds []string) ([]byte, error)
func (ProductAPI) MultipleSimilarityLookupWithResponseGroup ¶
func (api ProductAPI) MultipleSimilarityLookupWithResponseGroup(ItemIds []string, ResponseGroup string) ([]byte, error)
func (ProductAPI) SimilarityLookup ¶
func (api ProductAPI) SimilarityLookup(ItemId string) ([]byte, error)
The SimilarityLookup operation returns up to ten products per page that are similar to one or more items specified in the request
func (ProductAPI) SimilarityLookupWithResponseGroup ¶
func (api ProductAPI) SimilarityLookupWithResponseGroup(ItemId string, ResponseGroup string) ([]byte, error)
type SimilarProduct ¶
type SimilarProducts ¶
type SimilarProducts struct {
SimilarProducts []SimilarProduct `xml:"SimilarProduct"`
}