Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Grantimus9/elixir-amazon-product-advertising-client
An Amazon Product Advertising API client for Elixir
https://github.com/Grantimus9/elixir-amazon-product-advertising-client
amazon-product-advertising
Last synced: 7 days ago
JSON representation
An Amazon Product Advertising API client for Elixir
- Host: GitHub
- URL: https://github.com/Grantimus9/elixir-amazon-product-advertising-client
- Owner: Grantimus9
- License: mit
- Created: 2014-11-25T03:08:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-22T15:12:04.000Z (11 months ago)
- Last Synced: 2024-10-29T08:40:27.648Z (10 days ago)
- Topics: amazon-product-advertising
- Language: Elixir
- Homepage: https://hexdocs.pm/amazon_product_advertising_client
- Size: 259 KB
- Stars: 37
- Watchers: 3
- Forks: 23
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Amazon Product Advertising API client for Elixir. (Third Party APIs)
README
Amazon Product Advertising Client
================================https://webservices.amazon.com/paapi5/documentation
## Configure
Add your AWS authentication credentials to `config/config.exs`:Hex: https://hex.pm/packages/amazon_product_advertising_client
```elixir
# in your mix.exs
{:amazon_product_advertising_client, "~> 0.3.0"}
``````elixir
# in your config/config.exs
config :amazon_product_advertising_client,
associate_tag: "YourAssociateTag",
aws_access_key_id: "YourAccessKeyID",
aws_secret_access_key: "YourSecretAccessKey",
marketplace_host: "webservices.amazon.ca" # If not specified the default value is webservices.amazon.com```
## Usage and Examples
### GetItems
```elixiralias AmazonProductAdvertisingClient.GetItems
# Lookup by ASIN
def lookup_by_asin(asin) when is_binary(asin) do
%GetItems{ItemIds: [asin]}
|> GetItems.execute()
end```
### SearchItems
An example of searching by ISBN
```elixiralias AmazonProductAdvertisingClient.SearchItems
# e.g. an ISBN of "9781680502992"
def lookup_book_info(isbn) when is_binary(isbn) do
lookup_struct = %SearchItems{Keywords: isbn}case SearchItems.execute(lookup_struct) do
{:ok, %HTTPoison.Response{body: body}} ->
body |> Jason.decode!()
endend
```