amazonproduct

package module
v0.0.0-...-6f84604 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2017 License: MIT Imports: 12 Imported by: 0

README

Simple library to simplify grabbing and posting data from the Amazon Affiliate API

Build Status MIT GODOC

Have a look at the go docs here: http://godoc.org/github.com/DDRBoxman/go-amazon-product-api

Example


package main

import (
	"fmt"
	"net/http"

	"github.com/DDRBoxman/go-amazon-product-api"
)

func main() {
	var api amazonproduct.AmazonProductAPI

	api.AccessKey = ""
	api.SecretKey = ""
	api.Host = "webservices.amazon.com"
	api.AssociateTag = ""
	api.Client = &http.Client{} // optional

	result,err := api.ItemSearchByKeyword("sgt+frog", 0)
	if (err != nil) {
		fmt.Println(err)
	}

	fmt.Println(result)
}

Documentation

Overview

Package amazonproduct provides methods for interacting with the Amazon Product Advertising API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAmazonUrl

func GenerateAmazonUrl(api AmazonProductAPI, Operation string, Parameters map[string]string) (finalUrl *url.URL, err error)

func SetTimestamp

func SetTimestamp(origUrl *url.URL) (err error)

func SignAmazonUrl

func SignAmazonUrl(origUrl *url.URL, api AmazonProductAPI) (signedUrl string, err error)

Types

type AmazonProductAPI

type AmazonProductAPI struct {
	AccessKey    string
	SecretKey    string
	AssociateTag string
	Host         string
	Client       *http.Client
}

func (AmazonProductAPI) BrowseNodeLookup

func (api AmazonProductAPI) BrowseNodeLookup(nodeId string) (string, error)

BrowseNodeLookup takes a BrowseNodeId and returns the result.

func (AmazonProductAPI) BrowseNodeLookupWithResponseGroup

func (api AmazonProductAPI) BrowseNodeLookupWithResponseGroup(nodeId string, responseGroup string) (string, error)

func (AmazonProductAPI) CartAdd

func (api AmazonProductAPI) CartAdd(items map[string]int, cartid, HMAC string) (string, error)

CartAdd takes a map containing ASINs and quantities and adds them to the given cart. Up to 10 items are allowed

func (AmazonProductAPI) CartClear

func (api AmazonProductAPI) CartClear(CartId, HMAC string) (string, error)

CartClear takes a CartId and HMAC that were returned when generating a cart It then removes the contents of the cart

func (AmazonProductAPI) CartCreate

func (api AmazonProductAPI) CartCreate(items map[string]int) (string, error)

CartCreate takes a map containing ASINs and quantities. Up to 10 items are allowed

func (AmazonProductAPI) CartGet

func (api AmazonProductAPI) CartGet(CartId, HMAC string) (string, error)

Cart get takes a CartID and HMAC that were returned when generating a cart Returns the contents of the specified cart

func (AmazonProductAPI) ItemLookup

func (api AmazonProductAPI) ItemLookup(ItemId string) (string, error)

ItemLookup takes a product ID (ASIN) and returns the result

func (AmazonProductAPI) ItemLookupWithParams

func (api AmazonProductAPI) ItemLookupWithParams(params map[string]string) (string, error)

ItemLookupWithParams takes the params for ItemLookup and returns the result

func (AmazonProductAPI) ItemLookupWithResponseGroup

func (api AmazonProductAPI) ItemLookupWithResponseGroup(ItemId string, ResponseGroup string) (string, error)

ItemLookupWithResponseGroup takes a product ID (ASIN) and a ResponseGroup and returns the result

func (AmazonProductAPI) ItemSearch

func (api AmazonProductAPI) ItemSearch(SearchIndex string, Parameters map[string]string) (string, error)

func (AmazonProductAPI) ItemSearchByKeyword

func (api AmazonProductAPI) ItemSearchByKeyword(Keywords string, page int) (string, error)

ItemSearchByKeyword takes a string containing keywords and returns the search results

func (AmazonProductAPI) ItemSearchByKeywordWithResponseGroup

func (api AmazonProductAPI) ItemSearchByKeywordWithResponseGroup(Keywords string, ResponseGroup string, page int) (string, error)

Modifed

func (AmazonProductAPI) ItemSearchByKeywordWithResponseGroupWithSearchIndex

func (api AmazonProductAPI) ItemSearchByKeywordWithResponseGroupWithSearchIndex(Keywords string, ResponseGroup string, SearchIndex string, page int) (string, error)

Added new

func (AmazonProductAPI) MultipleItemLookup

func (api AmazonProductAPI) MultipleItemLookup(ItemIds []string) (string, error)

MultipleItemLookup takes an array of product IDs (ASIN) and returns the result

func (AmazonProductAPI) MultipleItemLookupWithResponseGroup

func (api AmazonProductAPI) MultipleItemLookupWithResponseGroup(ItemIds []string, ResponseGroup string) (string, error)

MultipleItemLookupWithResponseGroup takes an array of product IDs (ASIN) as well as a ResponseGroup and returns the result

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL