SDK quick-starts
Install and first-request snippets for the official Node, Python, Go, and CLI SDKs. All four wrap auth, retries, rate limits, and typed responses.
SDK quick-starts
We publish four official SDKs. Each wraps the HTTP API with typed helpers, built-in retry/backoff on 408/429/5xx, and a token-bucket rate limiter that respects your plan’s ceiling. Pick the one that matches your stack and skip the raw fetch code.
| Language | Package | Install |
|---|---|---|
| Node.js / TypeScript | amazon-scraper-api-sdk | npm install amazon-scraper-api-sdk |
| Python | amazonscraperapi-sdk | pip install amazonscraperapi-sdk |
| Go | github.com/ChocoData-com/amazon-scraper-api-sdk-go | go get github.com/ChocoData-com/amazon-scraper-api-sdk-go |
| CLI (any language) | amazonscraperapi-cli | npm install -g amazonscraperapi-cli |
Node / TypeScript
npm install amazon-scraper-api-sdk
import { AmazonScraperAPI } from "amazon-scraper-api-sdk";
const asa = new AmazonScraperAPI("asa_live_YOUR_KEY");
const product = await asa.product({
query: "B09HN3Q81F",
domain: "com",
});
console.log(product.title, product.price);
Typed responses, auto-pagination on Search, webhook-signature verification on Batch. Works in Node 18+ and any ESM/CJS setup. See the npm README for the full reference.
Python
pip install amazonscraperapi-sdk
from amazonscraperapi import AmazonScraperAPI
asa = AmazonScraperAPI(api_key="asa_live_YOUR_KEY")
product = asa.product(query="B09HN3Q81F", domain="com")
print(product["title"], product["price"])
Works on Python 3.9+. Sync and async variants ship side by side (asa.product vs await asa.product_async). Type hints via TypedDict.
Go
go get github.com/ChocoData-com/amazon-scraper-api-sdk-go
package main
import (
"context"
"fmt"
"log"
amz "github.com/ChocoData-com/amazon-scraper-api-sdk-go"
)
func main() {
client := amz.New("asa_live_YOUR_KEY")
data, err := client.Product(context.Background(), amz.ProductParams{
Query: "B09HN3Q81F",
Domain: "com",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(data.Title, data.Price)
}
Context-aware cancellation, idiomatic Go error wrapping, zero external deps beyond net/http.
CLI
The CLI is handy for quick one-off scrapes from a terminal or shell script.
npm install -g amazonscraperapi-cli
asa login asa_live_YOUR_KEY # stored in ~/.asa/config
# Single product
asa amazon product --query B09HN3Q81F --domain com
# Search
asa amazon search --query "laptop" --domain com --pages 2
# Pipe a list of ASINs from a file
cat asins.txt | asa amazon product --domain com --json-per-line > out.ndjson
The CLI outputs JSON by default, or NDJSON (one row per line) with --json-per-line - easy to pipe into jq, awk, or a warehouse loader.
Raw HTTP (no SDK)
For stacks we don’t publish an SDK for yet (Java, Ruby, PHP, C#), the API is a plain GET with a Bearer token. Every endpoint page has a cURL snippet you can port. Examples:
What the SDKs do that raw HTTP doesn’t
- Exponential backoff with jitter on 408 / 429 / 5xx.
- Client-side rate limiter so you don’t have to think about your plan’s ceiling.
- Webhook-signature verification (Batch endpoint) in one line.
- Typed response shapes - autocomplete the ~55 product fields in your editor.
- Sensible defaults -
Accept-Encoding: gzip,User-Agentidentifying the SDK + version, a 30s request timeout you can override per call.
If you ever find the SDK doing something unexpected, pass debug: true at construction and you’ll get every HTTP call printed to stderr with timings.
Related
- Authentication - API key format and rotation
- Rate limits & concurrency - what the built-in limiter is protecting you from
- Error codes - what the SDK’s retry policy is reacting to