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

amazon-scraper-api-cli

v0.1.3

Published

Command-line interface for Amazon Scraper API - scrape products directly from your terminal

Downloads

515

Readme

amazon-scraper-api-cli

npm npm downloads license

Command-line interface for Amazon Scraper API. Scrape Amazon products, searches, and submit async batches straight from your terminal. Structured JSON to stdout, errors to stderr, pipes cleanly into jq / shell scripts / ndjson pipelines.

Benchmark (live production, 2026-04)

| Metric | Value | |---|---| | Median latency (product, US) | ~2.6 s | | P95 latency | ~6 s | | Price / 1,000 Amazon products | $0.50 flat | | Marketplaces supported | 20+ | | Billing unit | per successful (2xx) response |


Install

# global
npm install -g amazon-scraper-api-cli

# or zero-install:
npx amazon-scraper-api-cli product B09HN3Q81F

Requires Node >= 18.

Auth

Set your API key via either:

# preferred (per-shell)
export ASA_API_KEY=asa_live_...

# or persistent file
mkdir -p ~/.asa
echo "api_key=asa_live_..." > ~/.asa/credentials

Get a key at https://app.amazonscraperapi.com. 1,000 free requests on signup, no credit card required.

Quick tour

# Single product (ASIN)
asa product B09HN3Q81F

# Specific marketplace + language
asa product B000ALVUM6 --domain de --language de_DE

# Keyword search with sort
asa search "cast iron skillet" --domain com --sort avg_customer_review

# Batch submit (up to 1,000 items)
cat <<EOF > batch.json
[
  {"query": "B09HN3Q81F", "domain": "com"},
  {"query": "B000ALVUM6", "domain": "de", "language": "de_DE"}
]
EOF
asa batch batch.json --webhook https://your.server/webhooks/asa

# Poll a batch
asa batch-status <BATCH_ID>

Example output

{
  "asin": "B09HN3Q81F",
  "title": "Apple AirPods Pro (2nd Generation)...",
  "price": { "current": 199.00, "currency": "USD", "was": 249.00 },
  "rating": { "average": 4.7, "count": 58214 },
  "availability": "In Stock",
  "buybox": { "seller": "Amazon.com", "prime": true },
  "images": ["https://m.media-amazon.com/images/I/...jpg"],
  "bullets": ["Active Noise Cancellation...", "Adaptive Audio..."],
  "_meta": { "tier": "direct", "duration_ms": 2634 }
}

Piping to jq (one-liners)

# Just the price
asa product B09HN3Q81F | jq -r '.price.current'

# Title + rating
asa product B09HN3Q81F | jq -r '"\(.title) - \(.rating.average) stars (\(.rating.count) reviews)"'

# Top 10 ASINs for a search
asa search "wireless keyboard" --domain com | jq -r '.results[].asin'

# Bulk fetch a list of ASINs
while read asin; do asa product "$asin" --domain com; done < asins.txt > products.ndjson

Flags

| Flag | Commands | Description | |---|---|---| | --domain | product, search | Marketplace TLD (com, co.uk, de, fr, co.jp, com.br, etc.) | | --language | product | Content-language header (e.g. en_US, de_DE) | | --sort | search | best_match | price_asc | price_desc | avg_customer_review | newest | | --endpoint | batch | amazon.product (default) or amazon.search | | --webhook | batch | HTTPS URL to POST batch results to when complete |

Exit codes

| Code | Meaning | |---|---| | 0 | Success; JSON written to stdout | | 1 | Error (network, auth, invalid params, Amazon unreachable). Error shape written to stderr |

Stdout is always machine-readable JSON on success. Errors on stderr. Safe to pipe into any script.

What the CLI handles for you

| Pain | Solved | |---|---| | Amazon CAPTCHA/robot pages | Auto-retried through residential tier | | Stale selector maintenance | Server-side extractors updated as Amazon layouts change | | Setting up proxies locally | None needed. It's just an API call. | | Parsing Amazon HTML manually | Structured JSON output | | 20+ marketplaces | Same CLI, different --domain |

Time saved: a one-off local Amazon scraper in shell/Python typically takes a half-day (install deps, find a proxy, write selectors, handle blocks, parse). This CLI is one command.

Error handling

Errors are JSON to stderr with a stable error.code:

$ asa product INVALID_ASIN --domain com
error: INVALID_PARAMS
{"error":{"code":"INVALID_PARAMS","message":"query must be a 10-character ASIN or an Amazon URL","hint":"Pass ?query=B09HN3Q81F or https://www.amazon.com/dp/B09HN3Q81F"}}
$ echo $?
1

Common codes: INVALID_API_KEY, INSUFFICIENT_CREDITS, RATE_LIMITED, target_unreachable, amazon-robot-or-human, extraction_failed. Non-2xx responses are not charged. X-Request-Id header is surfaced in error output for support tickets.

Get an API key

app.amazonscraperapi.com. 1,000 free requests on signup, no credit card required.

Links

License

MIT