https://github.com/mdinacci/goamzpa
A Go library to use the Amazon Product API.
https://github.com/mdinacci/goamzpa
Last synced: 8 months ago
JSON representation
A Go library to use the Amazon Product API.
- Host: GitHub
- URL: https://github.com/mdinacci/goamzpa
- Owner: mdinacci
- License: bsd-3-clause
- Created: 2012-11-01T17:47:50.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-06-03T05:38:54.000Z (about 11 years ago)
- Last Synced: 2023-03-12T01:31:59.526Z (over 3 years ago)
- Language: Go
- Size: 128 KB
- Stars: 9
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goamzpa
A BSD licensed [Go lang](http://golang.org) library to use the _Amazon Product API_.
Also my first `Go` project.
At the moment it supports only `ItemLookup`. Everything can change, and
probably will, use at your own peril.
## Usage
package main
import (
"fmt"
"github.com/mdinacci/goamzpa/amzpa"
)
func main() {
// Complete these variables with your credentials
accessKey := "ACCESS_KEY"
accessSecret := "ACCESS_SECRET"
associateTag := "ASSOCIATE_TAG"
region := "UK"
request := amzpa.NewRequest(accessKey, accessSecret , associateTag, region)
asins:= []string{"0141033576,0615314465,1470057719"}
responseGroups := "Medium,Accessories"
itemsType := "ASIN"
response,err := request.ItemLookup(asins, responseGroups, itemsType)
if err == nil && response.Request.IsValid {
for _, item := range response.Items {
fmt.Printf("ASIN: %s\n", item.ASIN)
fmt.Printf("DetailPageURL: %s\n", item.DetailPageURL)
fmt.Printf("Author: %s\n", item.Author)
fmt.Printf("Price: %s\n", item.Price)
fmt.Printf("Medium Image URL: %s\n", item.MediumImage.URL)
}
} else {
fmt.Println(err)
}
}
## TODO
* [IN PROGRESS] Map the XML to a struct, so that the response is not just a big string
* Support more than one ResponseGroup
* ItemSearch
* Gzip compression