npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

amazonads-cli

v0.1.1

Published

CLI for Amazon Ads API

Readme

Amazon Ads CLI

CI npm version License: MIT

A command-line interface for the Amazon Ads API. Unlike bulk-sheet tools that work on exported CSV files, this CLI makes live API calls — query your account, create campaigns, update bids, and pull reports in real time without touching the Amazon Ads console.

Prerequisites

You need an approved Amazon Ads API application to use this tool.

  1. Sign in at advertising.amazon.com and navigate to Tools → API access
  2. Request API access and create an application to obtain a Client ID and Client Secret
  3. See Amazon's API onboarding guide for full details

Installation

git clone https://github.com/cprice70/amazonads-cli.git
cd amazonads-cli
npm install
npm run build
npm link

Or install from npm (once published):

npm install -g amazonads-cli

Authentication

amazonads auth login

Prompts for your Client ID and Client Secret, opens a browser to complete Amazon OAuth, and saves credentials to ~/.config/amazonads-cli/config.json.

You can also create the config file manually if you already have a refresh token:

{
  "clientId": "amzn1.application-oa2-client.xxxxxxxxxxxx",
  "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "refreshToken": "Atzr|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "region": "NA",
  "sandbox": false,
  "defaultProfileId": "1234567890"
}

| Field | Values | Notes | |---|---|---| | clientId | amzn1.application-oa2-client.xxx | From Amazon Ads API console | | clientSecret | string | From Amazon Ads API console | | refreshToken | Atzr\|xxx | Obtained via auth login or existing token | | region | NA, EU, FE | North America, Europe, Far East | | sandbox | true / false | Use the Amazon Ads test endpoint | | defaultProfileId | numeric string | Avoids needing --profile on every command |

Environment variables override the config file: AMAZON_ADS_CLIENT_ID, AMAZON_ADS_CLIENT_SECRET, AMAZON_ADS_REFRESH_TOKEN, AMAZON_ADS_REGION, AMAZON_ADS_SANDBOX, AMAZON_ADS_PROFILE_ID.

Commands

Auth

amazonads auth login      # OAuth login, saves credentials
amazonads auth status     # Show current config (masked)
amazonads auth logout     # Delete config file

Profiles

amazonads profiles
amazonads profiles --json

Lists all advertising profiles on your account. Run this first to find your profile IDs — you'll need one for most other commands.

Campaigns

# List campaigns
amazonads campaigns list --profile <id>
amazonads campaigns list --profile <id> --state enabled
amazonads campaigns list --profile <id> --type sponsoredBrands
amazonads campaigns list --profile <id> --json

# Campaign performance report (async — may return a report ID if still processing)
amazonads campaigns performance --profile <id> --campaign <id> --start 2024-01-01 --end 2024-01-31

# Create a campaign (always created in PAUSED state)
amazonads campaigns create \
  --profile <id> \
  --name "My Campaign" \
  --type sponsoredProducts \
  --targeting MANUAL \
  --budget 10.00 \
  --start 2024-07-01

# Archive a campaign
amazonads campaigns archive --profile <id> --campaign <id> --type sponsoredProducts
amazonads campaigns archive --profile <id> --campaign <id> --type sponsoredProducts --confirm

Campaign types: sponsoredProducts, sponsoredBrands, sponsoredDisplay

Keywords

# List keywords
amazonads keywords list --profile <id>
amazonads keywords list --profile <id> --campaign <campaign-id>
amazonads keywords list --profile <id> --campaign <campaign-id> --ad-group <ad-group-id>

# Update keyword bid
amazonads keywords update-bid --profile <id> --keyword <keyword-id> --bid 1.25

Product Ads

amazonads product-ads list --profile <id>
amazonads product-ads list --profile <id> --campaign <campaign-id>
amazonads product-ads list --profile <id> --campaign <campaign-id> --ad-group <ad-group-id>

Reports

# Check status of / download a report by ID
amazonads reports get --profile <id> --report <report-id>
amazonads reports get --profile <id> --report <report-id> --json

Use this to retrieve a pending report returned by campaigns performance.

Output

All commands support --json to output raw API responses instead of a formatted table, making it easy to pipe results into jq or other tools.

Development

npm run dev         # Run without building (hot-reloads on save)
npm run build       # Compile TypeScript
npm run watch       # Watch mode (compile only)
npm run test        # Run tests

Pass CLI arguments after -- when using dev:

npm run dev -- campaigns list --profile 1234567890

Requires Node.js 18+.

License

MIT