Install
openclaw skills install skill-amazon-ads-reporterFetch Amazon Ads Sponsored Products campaign reports asynchronously by requesting and polling separately to avoid API timeouts, with no npm dependencies.
openclaw skills install skill-amazon-ads-reporterFetch Amazon Ads Sponsored Products campaign performance reports using a decoupled async pattern. Avoids timeout issues with the v3 Reporting API (2–10 min generation time) by splitting request and poll into separate steps. Also includes keyword-level winner/dead analysis and a quick bid inspector.
Amazon's Reporting API v3 is async — you request a report, get a reportId, and poll until it's ready. Doing this inline in a cron causes timeouts. The correct pattern:
request → save reportId → (wait 1-2 min) → poll + download
# Step 1: Request report — exits immediately with reportId
node scripts/request-report.js --days 7
# Step 2: Poll + download (run 1-2 min later, or from a separate cron)
node scripts/poll-report.js
node scripts/get-report.js --days 7
node scripts/keyword-report.js
Output: table of all ENABLED keywords with clicks > 0 OR impressions ≥ 50 (winners), plus count of dead keywords (0 clicks, <50 imp).
node scripts/get-bids.js
Output: all ENABLED + PAUSED keywords per campaign with current bids. Reads live data (no report needed).
| Arg | Default | Description |
|---|---|---|
--days N | 7 | Number of days to include in report (campaign and keyword reports) |
Reads credentials from AMAZON_ADS_PATH env var, defaulting to ~/amazon-ads-api.json.
amazon-ads-api.json format{
"refreshToken": "...",
"lwaClientId": "...",
"lwaClientSecret": "...",
"profileId": "...",
"region": "EU"
}
Regions: EU (default, includes UAE), NA (North America), FE (Far East).
~/.openclaw/workspace/tmp/amazon-report-pending.json — created by request-report.js~/.openclaw/workspace/tmp/amazon-report-latest.json — created by poll-report.js after successcampaignName, campaignId, impressions, clicks, spend, purchases7d, sales7d
Paused campaigns are automatically filtered out by cross-referencing GET /sp/campaigns/list.
keywordId, keywordText, matchType, impressions, clicks, cost, purchases7d, sales7d
Node.js built-ins only (https, zlib, fs, path). No npm install required.
GZIP_JSON format is gunzipped automatically by poll-report.jsget-bids.js uses the live v3 keyword list endpoint — no async report needed, instant response