Amazon::PAApi5::Signature - Amazon Product Advertising API(PA-API) 5.0 Helper
This code is an example of US region.
use Amazon::PAApi5::Payload; use Amazon::PAApi5::Signature; use HTTP::Request::Common; use LWP::UserAgent; use Data::Dumper; my $payload = Amazon::PAApi5::Payload->new( 'PARTNER_TAG' ); my $sig = Amazon::PAApi5::Signature->new( 'ACCESS_KEY', 'SECRET_KEY', $payload->to_json({ Keywords => 'Perl', SearchIndex => 'All', ItemCount => 2, Resources => [qw/ ItemInfo.Title /], }), ); my $ua = LWP::UserAgent->new; my $req = POST $sig->req_url, $sig->headers, Content => $sig->payload; my $res = $ua->request($req); warn Dumper($res->status_line, $res->content);
NOTE that Product Advertising API 5.0 has usage limit. Please confirm https://webservices.amazon.com/paapi5/documentation/troubleshooting/api-rates.html or a page for your region.
See example/ directory of this module for more examples.
https://github.com/bayashi/Amazon-PAApi5-Signature/tree/master/example
Amazon::PAApi5::Signature generates a request headers and request body for Amazon Product Advertising API(PA-API) 5.0
https://webservices.amazon.com/paapi5/documentation/quick-start.html
Constructor
Get request URL string
Get signed HTTP headers as hash
Get a hash for HTTP request
Amazon::PAApi5::Signature is hosted on github: http://github.com/bayashi/Amazon-PAApi5-Signature
I appreciate any feedback :D
Dai Okabayashi <bayashi@cpan.org>
Amazon::PAApi5::Signature is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. (Note that, unlike the Artistic License 1.0, version 2.0 is GPL compatible by itself, hence there is no benefit to having an Artistic 2.0 / GPL disjunction.) See the file LICENSE for details.
Amazon::PAApi5::Signature
To install Amazon::PAApi5::Signature, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amazon::PAApi5::Signature
CPAN shell
perl -MCPAN -e shell install Amazon::PAApi5::Signature
For more information on module installation, please visit the detailed CPAN module installation guide.