Skip to main content

amazonscraperapi-sdk

PyPI version PyPI downloads license

Official Python SDK for Amazon Scraper API. Pay only for successful (2xx) responses — non-2xx never cost you anything. Pricing starts at $0.90 per 1,000 requests on pay-as-you-go, drops to a flat $0.50 per 1,000 requests on Custom plans. 1,000 free requests on signup, no card. Drop into any Python project to fetch structured Amazon product data, run keyword searches, or queue async batches with webhook callbacks.

Benchmark (live production, 2026-04)

Measured on our own infrastructure against a 30-query mixed international set:

Metric Value
Median latency (product, US) ~2.6 s
P95 latency ~6 s
P99 latency ~10.5 s
Price / 1,000 Amazon products $0.50 flat
Concurrent threads (entry paid plan) 50
Marketplaces supported 20+
Billing unit per successful (2xx) response

Install

pip install amazonscraperapi-sdk

Requires Python >= 3.9. Built on httpx.

Quick start - single product

from amazonscraperapi import AmazonScraperAPI

asa = AmazonScraperAPI(api_key="asa_live_...")

product = asa.product(query="B09HN3Q81F", domain="com")

print(product["title"])
# "LEGEND COOKWARE 5-Ply Stainless Steel Cookware Set, 14-Piece..."
print(product["price"], product["currency"])
# 549.99 USD
print(product["rating"], product["reviews_count"])
# 4.5 865

Example output (trimmed, ~55 fields in total)

{
    "asin": "B09HN3Q81F",
    "title": "LEGEND COOKWARE 5-Ply Stainless Steel Cookware Set, 14-Piece...",
    "brand": "LEGEND COOKWARE",
    "price": 549.99,
    "price_strikethrough": None,
    "currency": "USD",
    "rating": 4.5,
    "reviews_count": 865,
    "stock": "In Stock",
    "is_prime": True,
    "images": ["https://m.media-amazon.com/images/I/71Q3a8JH5NL._AC_SY355_.jpg", "..."],
    "bullet_points": "5-PLY STAINLESS STEEL COOKWARE HEATS EVENLY - Five layers of steel...",
    "sales_rank": [
        {"ladder": [{"name": "Kitchen & Dining", "url": None}], "rank": 36177},
        {"ladder": [{"name": "Kitchen Cookware Sets", "url": None}], "rank": 174},
    ],
}
results = asa.search(
    query="wireless headphones",
    domain="co.uk",
    sort_by="avg_customer_review",
    pages=1,
)

for p in results["products"]:
    # Sponsored cards have sponsored_position instead of organic_position.
    print(p["organic_position"], p["asin"], p["title"], p["price"], p["rating"])

Async batch (up to 1,000 ASINs with webhook callback)

batch = asa.create_batch(
    endpoint="amazon.product",
    items=[
        {"query": "B09HN3Q81F", "domain": "com"},
        {"query": "B000ALVUM6", "domain": "de", "language": "de_DE"},
        # ... up to 1,000
    ],
    webhook_url="https://your.server/webhooks/asa",
)

print("batch id:", batch["id"])
# SAVE THIS. Webhook signing secret is returned only once:
print("webhook secret:", batch["webhook_signature_secret"])

# Alternative: poll
status = asa.get_batch(batch["id"])
print(f"{status['processed_count']}/{status['total_count']}")

Verifying webhook signatures

from amazonscraperapi import verify_webhook_signature
from fastapi import FastAPI, Request, HTTPException
import json, os

app = FastAPI()

@app.post("/webhooks/asa")
async def asa_webhook(request: Request):
    raw = await request.body()
    signature = request.headers.get("X-ASA-Signature")
    if not verify_webhook_signature(signature, raw, secret=os.environ["WEBHOOK_SECRET"]):
        raise HTTPException(401, "invalid signature")
    payload = json.loads(raw)
    # process payload["results"]

What the API solves for you

Building a production-grade Amazon scraper in-house is a 2-4 week engineering project plus permanent maintenance. This SDK wraps Amazon Scraper API, which has already solved:

Pain point What we handle
Amazon CAPTCHAs / robot pages Auto-detected, retried through a heavier proxy tier (datacenter, residential, premium)
Brittle CSS selectors Extractors update as Amazon changes layouts. Your code stays the same.
20+ marketplaces amazon.de, .co.uk, .co.jp, .com.br, and more. Each with marketplace-specific parsing quirks.
Country-matched residential IPs amazon.de auto-routes through German IPs.
Rotating proxies + anti-fingerprinting TLS fingerprints, headers, cookies handled server-side.
Structured JSON output Title, price, rating, reviews, variants, seller, images. Parsed.
Batch/async jobs 1,000 ASINs submitted, webhook-delivered on completion.

Time saved: a greenfield Python Amazon scraper built to this spec takes roughly 80 engineer-hours (including anti-bot handling and marketplace variants). This SDK is 10 minutes.

Error handling

Every failed call raises AmazonScraperAPIError with status_code, code (the API's error code, or None) and body (the parsed JSON body). The SDK does not retry on its own, so match on e.code and decide:

import time
from amazonscraperapi import AmazonScraperAPI, AmazonScraperAPIError

asa = AmazonScraperAPI(api_key="asa_live_...")

try:
    product = asa.product(query="B09HN3Q81F", domain="com")
except AmazonScraperAPIError as e:
    if e.code == "INSUFFICIENT_CREDITS":
        pass  # top up
    elif e.code == "RATE_LIMITED":
        time.sleep(e.body["error"].get("retry_after_ms", 1000) / 1000)
    elif e.code == "target_unreachable":
        time.sleep(60)  # not charged; retry once
    else:
        raise
HTTP code When you see it Recommended action
400 invalid_params Missing query, unsupported domain, bad sort_by Fix request; don't retry
401 INVALID_API_KEY Missing, malformed, revoked Verify ASA_API_KEY; rotate if leaked
402 INSUFFICIENT_CREDITS Balance empty Top up; renews each billing cycle
404 product_not_found ASIN delisted, malformed, or not on this marketplace Don't retry; drop the ASIN
429 RATE_LIMITED Over request-rate budget Wait error.retry_after_ms; retry
429 CONCURRENCY_LIMIT Over plan's parallel cap Reduce parallelism or upgrade. X-Concurrency-* headers guide backoff
502 target_unreachable Amazon blocked every internal retry (last_block_reason says why) Retry after 60s or more. Not charged
502 extraction_failed Layout we can't parse Retry later; report with X-Request-Id if it persists. Not charged
503 SERVICE_OVERLOADED Global circuit breaker Honor Retry-After: 60. Rare
500 INTERNAL_ERROR Our bug Report with X-Request-Id

The default request timeout is 120s (the API's own ceiling); override it with AmazonScraperAPI(api_key=..., timeout=...).

Flat-credit promise: non-2xx responses are free. A basic request costs 5 credits (billing unit; end-customer price is $0.90 per 1,000 basic requests PAYG). Future JS-rendered calls will cost 15 credits. Every response has X-Request-Id for traceability — quote it in any support ticket.

Get an API key

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

License

MIT

Metadata

Release files for amazonscraperapi-sdk 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amazonscraperapi-sdk 0.1.6
File Size Uploaded Provenance
amazonscraperapi_sdk-0.1.6.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for amazonscraperapi-sdk 0.1.6
File Interpreter ABI Platform
amazonscraperapi_sdk-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / amazonscraperapi_sdk-0.1.6.tar.gz

Download URL amazonscraperapi_sdk-0.1.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f9f5b308b3ac5d39ab61eb89eb93e9ff0d32d882882d7bad620a26c0d59aa84
BLAKE2b-256 checksum
How to use checksums
8b0c00d5ebf4a9bd24527c9b8ec57a1615f3e57d8de7605c0399e09d01b94dc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / amazonscraperapi_sdk-0.1.6-py3-none-any.whl

Download URL amazonscraperapi_sdk-0.1.6-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f9cc721da4da1c5da9d97874d2a98fe6fc873bbcc8934c2db2f5801f2d78fbc
BLAKE2b-256 checksum
How to use checksums
4fa0480df875e4943183e555a7fc103ae77893db1a7d5c3f16ad8cc58c37c1b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for amazonscraperapi-sdk 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page