npm - TypeScript / JavaScript
Node.js SDK
First-class TypeScript types for every product field, Promise-based async API, retry middleware. Works in Node, Bun, Deno, Cloudflare Workers, and any modern runtime.
Quick start
1. Install
npm install chocodata 2. Scrape your first product
import { Client } from "chocodata";
const chocodata = new Client({ apiKey: "cd_live_..." });
const product = await chocodata.products.get("B08N5KWBKK", { domain: "com" });
console.log(product.title, product.price, product.rating); 3. TypeScript autocomplete works out of the box
// product is typed as Product
// product.price is typed as number | null
// product.images is typed as string[]
// IDE shows every field How-to
Run a search
const results = await chocodata.search.run({
site: "google",
query: "wireless earbuds",
pages: 3,
});
for (const r of results) {
console.log(r.position, r.title, r.url);
} Async batch with webhooks
const batch = await chocodata.batch.create({
asins: ["B08N5KWBKK", "B0DZ7871B8" /* up to 1000 */],
domain: "com",
webhookUrl: "https://your.app/webhook",
});
// Or wait inline
const results = await chocodata.batch.wait(batch.id, { timeoutMs: 600000 });
console.log(`got ${results.length} products`); Verify a webhook callback
// Express handler
app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
const valid = chocodata.verifyWebhook(req.headers, req.body);
if (!valid) return res.status(400).send("invalid signature");
const payload = JSON.parse(req.body.toString());
// ... process payload
res.sendStatus(200);
}); Run on Cloudflare Workers
// worker.ts
import { Client } from "chocodata";
export default {
async fetch(req: Request, env: Env) {
const chocodata = new Client({ apiKey: env.CHOCODATA_API_KEY });
const reqUrl = new URL(req.url);
const id = reqUrl.searchParams.get("id");
if (!id) return new Response("missing id", { status: 400 });
const product = await chocodata.products.get(id);
return Response.json(product);
}
}; SDK uses fetch() under the hood, no Node-only APIs. Works on every modern edge runtime.
Why use the SDK over raw fetch?
First-class TypeScript
Generated from the OpenAPI spec. Every product field is typed; refactors and renames stay safe across your codebase.
Retry middleware
Configurable backoff on 429 + 5xx. Never charged for retries since only 2xx responses bill.
Universal runtime
Works in Node 18+, Bun, Deno, Cloudflare Workers, Vercel Edge, and the browser. No Node-only dependencies.
Webhook signature verification
Built-in HMAC verifier so a forged callback cannot trigger your business logic.
Streaming batch results
`for await (const r of chocodata.batch.stream(id))` yields results as they complete instead of waiting for the whole batch.
Tree-shakeable
Import only what you use. Bundle-size impact is <15kb gzipped on the search-only client.
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 product listings
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 (5,000 credits)
- check_circle10 concurrent requests
- check_circleAll 237 targets
- check_circleFull dashboard + analytics
- check_circleTop-up at $0.90 / 1k
- check_circleCommunity support
Vibe
$0.70 / 1k effective
- check_circle27,000 requests / month (135,000 credits)
- check_circle30 concurrent requests
- check_circleAll 237 targets + 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 (410,000 credits)
- check_circle50 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_circle100-500+ 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.