npm - TypeScript / JavaScript
Node.js SDK
A Promise-based client with TypeScript types for every parameter, typed errors and webhook verification. Built on fetch with zero dependencies, so it runs in Node 18+, Bun, Deno and Cloudflare Workers.
Quick start
1. Install
npm install amazon-scraper-api-sdk 2. Scrape your first ASIN
import { AmazonScraperAPI } from "amazon-scraper-api-sdk";
const asa = new AmazonScraperAPI("asa_live_...");
const product = await asa.product({ query: "B09HN3Q81F", domain: "com" });
console.log(product.title, product.price, product.rating);
// LEGEND COOKWARE 5-Ply Stainless Steel Cookware Set... 549.99 4.5 3. Typed parameters
// Parameters are typed: domain autocompletes the 20 marketplaces,
// sort_by the five sort orders. Responses are the API's JSON
// (about 55 fields per product), see the product API reference.
await asa.search({ query: "desk lamp", domain: "co.uk", sort_by: "price_asc" }); How-to
Search Amazon
const results = await asa.search({
query: "wireless earbuds",
domain: "com",
sort_by: "best_match",
start_page: 1,
});
for (const p of results.products) {
// Sponsored cards carry sponsored_position instead of organic_position.
console.log(p.organic_position, p.asin, p.title, p.price);
} Async batch with webhooks
const asins = ["B09HN3Q81F", "B0DFBVB6DD"]; // up to 1,000
const batch = await asa.createBatch({
endpoint: "amazon.product",
items: asins.map((query) => ({ query, domain: "com" })),
webhook_url: "https://your.app/webhook", // optional
});
// Save this now: the webhook signing secret is returned only once.
const secret = batch.webhook_signature_secret;
// Poll until done (or wait for the webhook)
const status = await asa.getBatch(batch.id);
console.log(status.status, `${status.processed_count}/${status.total_count}`); Verify a webhook callback
import { verifyWebhookSignature } from "amazon-scraper-api-sdk";
// Express handler: read the RAW body, not parsed JSON.
app.post("/webhook", express.raw({ type: "application/json" }), async (req, res) => {
const ok = await verifyWebhookSignature(req.header("X-ASA-Signature"), req.body, process.env.WEBHOOK_SECRET!);
if (!ok) return res.status(401).send("invalid signature");
const payload = JSON.parse(req.body.toString());
// ... process payload.results
res.sendStatus(200);
}); Handle errors and retries
import { AmazonScraperAPI, AmazonScraperAPIError } from "amazon-scraper-api-sdk";
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
async function productWithRetry(query: string, attempts = 3) {
for (let i = 0; ; i++) {
try {
return await asa.product({ query, domain: "com" });
} catch (err) {
if (!(err instanceof AmazonScraperAPIError) || i >= attempts - 1) throw err;
if (err.code === "target_unreachable") await sleep(60_000); // not charged
else if (err.code === "RATE_LIMITED") await sleep(1_000);
else throw err; // err.status, err.code and err.body describe the failure
}
}
} The SDK does not retry on its own, so you decide the policy. Failed requests are never charged. See error codes.
Run on Cloudflare Workers
// worker.ts
import { AmazonScraperAPI } from "amazon-scraper-api-sdk";
export default {
async fetch(req: Request, env: Env) {
const asa = new AmazonScraperAPI(env.ASA_KEY);
const asin = new URL(req.url).searchParams.get("asin");
if (!asin) return new Response("missing asin", { status: 400 });
const product = await asa.product({ query: asin, domain: "com" });
return Response.json(product);
}
}; Requests use the standard fetch API, so the client runs on edge runtimes. Webhook verification uses node:crypto; on Workers enable the nodejs_compat flag for it.
Why use the SDK over raw fetch?
Typed parameters
TypeScript types for every parameter (domains, sort orders, batch inputs) and for batch status, so mistakes show up in your editor, not in production.
Clear errors
A failed call throws `AmazonScraperAPIError` with `status`, `code` and the response `body`, so you can branch on `err.code`. Failures are never billed.
Runs on edge runtimes
Built on the standard fetch API: Node 18+, Bun, Deno and Cloudflare Workers. Keep your API key server-side.
Webhook signature verification
`verifyWebhookSignature` checks the HMAC on batch callbacks so a forged request cannot trigger your business logic.
Async batch
`createBatch` queues up to 1,000 products or searches in one call; poll with `getBatch` or receive a webhook when it completes.
Zero dependencies
About 4 KB of JavaScript, no runtime dependencies, and a 120s default timeout that covers the slowest successful scrapes.
Official resources
- npm package - install via npm / yarn / pnpm
- GitHub repo - source + issues + changelog
- Product API reference
- Search API reference
- Async batch API reference
- How to scrape Amazon products
Pricing
Same rate across every integration. Monthly plans from $19 or pay-as-you-go at $0.90 per 1,000 successful requests. 1,000 free on signup.
Free
Forever free on signup
- check_circle1,000 requests / month
- check_circle50 concurrent requests
- check_circleAll 20 marketplaces
- check_circleFull dashboard + analytics
- check_circleTop-up at $0.90 / 1k
- check_circleCommunity support
Vibe
$0.70 / 1k effective
- check_circle27,000 requests / month
- check_circle100 concurrent requests
- check_circleAll endpoints + content-language
- check_circleCountry-matched residential IPs
- check_circlePer-API-key usage tracking
- check_circleTop-up at $0.90 / 1k
- check_circleEmail support (1 business day)
Pro
$0.60 / 1k effective
- check_circle82,000 requests / month
- check_circle200 concurrent requests
- check_circlePriority routing queue
- check_circleCountry-matched residential IPs
- check_circleTeam seats (up to 5)
- check_circleTop-up at $0.90 / 1k
- check_circleEmail + chat support
Custom
Flat $0.50 / 1k effective at every level
- check_circle200k - 4M+ requests / month
- check_circle300-1000+ concurrent requests
- check_circlePriority queue (highest)
- check_circlePremium proxy pool + SLA on request
- check_circleUnlimited team seats
- check_circleWire / invoice / annual PO
- check_circleDedicated Slack channel
Pay-as-you-go top-up
$0.90 / 1,000 successful requests
Available on every plan including Free. Top up any time when included credits run out. Only 2xx responses charged. Balance never expires.
Ship with Node today
1,000 free requests on signup. No credit card required.