Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Latest commit

 

History

History
46 lines (33 loc) · 1.12 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.12 KB

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"
	"encoding/xml"
	"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)


	//Parse result
	if err == nil {
		aws := new(amazonproduct.ItemLookupResponse)
		xml.Unmarshal([]byte(result), aws)
		//TODO: Use "aws" freely :-)
	}
}