Go Client Library for Amazon's Product Advertising API 5.0

gopaapi5

Build Status Go Report Card GoDoc Coverage Status

gopaapi5 is a Go client library for accessing the Amazon Product Advertising API 5.0.

Usage

Install package:

go get -u github.com/utekaravinash/gopaapi5

Here's an example for GetBrowseNodes operation:

package main

import (
	"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(), &params)
	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):

Use SetHttpClient() method of Client struct to set a custom HTTP client.

Author

Avinash Utekar

License

BSD 3-Clause

Similar Resources

A Wrapper Client for Google Spreadsheet API (Sheets API)

Senmai A Wrapper Client for Google Spreadsheet API (Sheets API) PREPARATION Service Account and Key File Create a service account on Google Cloud Plat

Nov 5, 2021

A Go client library for the Twitter 1.1 API

Anaconda Anaconda is a simple, transparent Go package for accessing version 1.1 of the Twitter API. Successful API queries return native Go structs th

Jan 1, 2023

Go client library for interacting with Coinpaprika's API

Coinpaprika API Go Client Usage This library provides convenient way to use coinpaprika.com API in Go. Coinpaprika delivers full market data to the wo

Dec 8, 2022

Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://developer.github.com/v4/).

githubv4 Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql). If you're looking for a client

Dec 26, 2022

This project implements a Go client library for the Hipchat API.

Hipchat This project implements a Go client library for the Hipchat API (API version 2 is not supported). Pull requests are welcome as the API is limi

Jan 3, 2023

Client library for UptimeRobot v2 API

uptimerobot uptimerobot is a Go library and command-line client for the Uptime Robot website monitoring service. It allows you to search for existing

Jan 8, 2023

go-github is a Go client library for accessing the GitHub API v3.

Go library for accessing the GitHub API

May 25, 2021

NotionGo is a Go client library for accessing the Notion API v1.

NotionGo (WIP) NotionGo is a Go client library for accessing the Notion API v1. Installation NotionGo is compatible with modern Go releases in module

May 22, 2021

go-ftx go-ftx is a Go client library for accessing the FTX API

go-ftx go-ftx is a Go client library for accessing the FTX API

Nov 14, 2022
Clusterpedia-client - clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Jan 7, 2022
Client-go - Clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Dec 5, 2022
The Bhojpur Ara is a software product used for automated resource assembly within Bhojpur.NET Platform ecosystem to enable delivery of applications and services.

Bhojpur Ara - Automated Resource Assembly The Bhojpur Ara is a service product used for automated resource assembly within the Bhojpur.NET Platform ec

Apr 28, 2022
The Bhojpur PEE is a software-as-a-service product used as a Provider's Edge Equipment based on Bhojpur.NET Platform for application delivery.

Bhojpur PEE - Provider's Edge Equipment The Bhojpur PEE is a software-as-a-service product used as a Provider's Edge Equipment based on Bhojpur.NET Pl

Dec 31, 2021
Zms - The Bhojpur ZMS is a software-as-a-service product applied in different risk management areas. It is a containment Zone Management System based on Bhojpur.NET Platform.

Bhojpur ZMS - Zone Management System The Bhojpur ZMS is a software-as-a-service product used as a Zone Management System based on Bhojpur.NET Platform

Sep 26, 2022
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Kinesumer is a Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Jan 5, 2023
Nutanix-client-go - Go client for the Nutanix Prism V3 API

nutanix-client-go This repository contains portions of the Nutanix API client code in nutanix/terraform-provider-nutanix. It has been extracted to red

Jan 6, 2022
Aoe4-client - Client library for aoe4 leaderboards etc

AOE4 Client Overview This is a go client used to query AOE4 data from either the

Jan 18, 2022
Go client for the YNAB API. Unofficial. It covers 100% of the resources made available by the YNAB API.

YNAB API Go Library This is an UNOFFICIAL Go client for the YNAB API. It covers 100% of the resources made available by the YNAB API. Installation go

Oct 6, 2022
An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Dec 30, 2022