SDK quick-starts
Install and first-request snippets for the official Node, Python, Go, and CLI SDKs. All four handle auth, request building and errors for you.
SDK quick-starts
We publish three official SDKs plus a CLI and an MCP server. Each wraps the HTTP API: it sends your key, builds the request, and raises a typed error carrying the HTTP status and response body when a call fails. The SDKs do not retry on their own, so wrap calls in the backoff described in Error codes. 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) | amazon-scraper-api-cli | npm install -g amazon-scraper-api-cli |
| MCP server (AI agents) | amazon-scraper-api-mcp | npx -y amazon-scraper-api-mcp |
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);
Includes search, createBatch / getBatch, and webhook-signature verification for 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+. Responses are plain dicts. Also includes search, create_batch / get_batch, and verify_webhook_signature.
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 amazon-scraper-api-cli
export ASA_API_KEY=asa_live_YOUR_KEY # or put api_key=... in ~/.asa/credentials
# Single product
asa product B09HN3Q81F --domain com
# Search, then the next page
asa search "laptop" --domain com
asa search "laptop" --domain com --page 2
# A list of ASINs from a file, as NDJSON (one product per line)
while read asin; do asa product "$asin" --domain com | jq -c .; done < asins.txt > out.ndjson
The CLI prints JSON to stdout and errors to stderr with exit code 1, so it pipes into jq, awk, or a warehouse loader. asa batch <file.json> and asa batch-status <id> wrap the async batch endpoint.
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 your key in the ?api_key= query parameter. Every endpoint page has a cURL snippet you can port. Examples:
What the SDKs do that raw HTTP doesn’t
- Auth and request building - your key and query parameters are set for you.
- Typed errors - a failed call raises an error carrying the HTTP status and the JSON body, so you can branch on the
errorcode. - Webhook-signature verification (Batch endpoint) in one line.
- Sensible defaults - a
User-Agentidentifying the SDK and version, and a 60s request timeout you can override.
The SDKs do not retry or rate-limit on your behalf. Add the retry loop from Error codes around your calls, and keep concurrency within your plan’s limits.
Related
- Authentication - API key format and rotation
- Rate limits & concurrency - per-plan ceilings to stay within
- Error codes - error codes and the retry backoff we recommend