Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/utekaravinash/gopaapi5
Go Client Library for Amazon's Product Advertising API 5.0
https://github.com/utekaravinash/gopaapi5
amazon-api api-client go paapi5 paapi5-go-sdk paapi5-golang-sdk product-advertising-api
Last synced: 4 months ago
JSON representation
Go Client Library for Amazon's Product Advertising API 5.0
- Host: GitHub
- URL: https://github.com/utekaravinash/gopaapi5
- Owner: utekaravinash
- License: bsd-3-clause
- Created: 2020-02-15T06:21:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-03T18:38:34.000Z (almost 5 years ago)
- Last Synced: 2024-07-31T20:53:21.058Z (6 months ago)
- Topics: amazon-api, api-client, go, paapi5, paapi5-go-sdk, paapi5-golang-sdk, product-advertising-api
- Language: Go
- Homepage: https://www.utekar.com/amazon-product-advertising-api-5-go-client-library-gopaapi/
- Size: 84 KB
- Stars: 16
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - gopaapi5 - Go Client Library for [Amazon Product Advertising API 5.0](https://webservices.amazon.com/paapi5/documentation/). (Third-party APIs / Utility/Miscellaneous)
- awesome-golang-repositories - gopaapi5
- awesome-go-extra - gopaapi5 - 02-15T06:21:31Z|2020-04-03T18:38:34Z| (Third-party APIs / Fail injection)
README
# gopaapi5 #
[![Build Status](https://travis-ci.org/utekaravinash/gopaapi5.svg?branch=master)](https://travis-ci.org/utekaravinash/gopaapi5)
[![Go Report Card](https://goreportcard.com/badge/github.com/utekaravinash/gopaapi5)](https://goreportcard.com/report/github.com/utekaravinash/gopaapi5)
[![GoDoc](https://godoc.org/github.com/utekaravinash/gopaapi5?status.svg)](https://godoc.org/github.com/utekaravinash/gopaapi5)
[![Coverage Status](https://coveralls.io/repos/github/utekaravinash/gopaapi5/badge.svg?branch=master)](https://coveralls.io/github/utekaravinash/gopaapi5?branch=master)gopaapi5 is a Go client library for accessing the [Amazon Product Advertising API 5.0](https://webservices.amazon.com/paapi5/documentation/).
## Usage ##
Install package:
```bash
go get -u github.com/utekaravinash/gopaapi5
```Here's an example for GetBrowseNodes operation:
```go
package mainimport (
"fmt"
"os""github.com/utekaravinash/gopaapi5"
"github.com/utekaravinash/gopaapi5/api"
)const tmpl = `Id: %s
Name: %s
-----------------------------
`func main() {
// Get Access Key, Secret Key and Associate Tag from the environment variables
accessKey := os.Getenv("PA_ACCESS_KEY")
secretKey := os.Getenv("PA_SECRET_KEY")
associateTag := os.Getenv("PA_ASSOCIATE_TAG")// Initiate gopaapi5 Client
client, err := gopaapi5.NewClient(accessKey, secretKey, associateTag, api.UnitedStates)
if err != nil {
panic(err)
}// Construct request parameters for GetBrowseNodes operation
params := api.GetBrowseNodesParams{
BrowseNodeIds: []string{
"6960520011",
"281407",
},
Resources: []api.Resource{
api.BrowseNodesAncestor,
api.BrowseNodesChildren,
},
LanguagesOfPreference: []api.Language{api.EnglishUnitedStates},
}// Call GetBrowseNodes operation
response, err := client.GetBrowseNodes(context.Background(), ¶ms)
if err != nil {
panic(err)
}// Loop over browse nodes in response
for _, node := range response.BrowseNodesResult.BrowseNodes {
fmt.Printf(tmpl, node.Id, node.DisplayName)
}
}
```This client library exposes these operations for Amazon Product Advertising API 5.0 _(click on links for their examples)_:
- [GetBrowseNodes](https://github.com/utekaravinash/gopaapi5/blob/master/_examples/get_browse_nodes/main.go)
- [GetItems](https://github.com/utekaravinash/gopaapi5/blob/master/_examples/get_items/main.go)
- [GetVariations](https://github.com/utekaravinash/gopaapi5/blob/master/_examples/get_variations/main.go)
- [SearchItems](https://github.com/utekaravinash/gopaapi5/blob/master/_examples/search_items/main.go)_Use SetHttpClient() method of Client struct to set a custom HTTP client._
## Author ##
[Avinash Utekar](https://www.utekar.com/author/avinash/)
## License ##
[BSD 3-Clause](https://github.com/utekaravinash/gopaapi5/blob/master/LICENSE)