amazonproduct

package module
v0.0.0-...-85a6f8f Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2015 License: MIT Imports: 11 Imported by: 0

README

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

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

Example


package main

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

func main() {
	var api amazonproduct.AmazonProductAPI

	api.AccessKey = ""
	api.SecretKey = ""
	api.Host = "webservices.amazon.com"
	api.AssociateTag = ""

	result,err := api.ItemSearchByKeyword("sgt+frog")
	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
}

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 generaing 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) 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 containg keywords and returns the search results

func (AmazonProductAPI) ItemSearchByKeywordWithResponseGroup

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

func (AmazonProductAPI) ItemSearchByKeywordWithResponseGroupAndPage

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

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