Skip to main content

Official Python client for Amazon Scraper API (https://amazonscraperapi.com)

Project description

amazonscraperapi — Python SDK

Official Python client for Amazon Scraper API.

pip install amazonscraperapi

Usage

from amazonscraperapi import AmazonScraperAPI

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

# Single product
product = client.product(query="B09HN3Q81F", domain="com")
print(product["title"], product["price"])

# Search
results = client.search(query="wireless headphones", domain="co.uk", sort_by="avg_customer_review")

# Async batch with webhook
batch = client.create_batch(
    endpoint="amazon.product",
    items=[
        {"query": "B09HN3Q81F", "domain": "com"},
        {"query": "B000ALVUM6", "domain": "de", "language": "de_DE"},
    ],
    webhook_url="https://your.server/webhooks/asa",
)
print("batch id:", batch["id"])
# Save this — only returned once:
print("webhook secret:", batch["webhook_signature_secret"])

Verifying webhooks

from amazonscraperapi import verify_webhook_signature
from flask import request

@app.route("/webhooks/asa", methods=["POST"])
def webhook():
    sig = request.headers.get("X-ASA-Signature")
    if not verify_webhook_signature(sig, request.get_data(), WEBHOOK_SECRET):
        return "invalid signature", 401
    payload = request.get_json()
    # ... process payload

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amazonscraperapi_sdk-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file amazonscraperapi_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for amazonscraperapi_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65f4a522c093ca899557ed476025f8131fe87f8e146973bd343eff95bd73ff36
MD5 b12ba7026438fbaf3230b46f81d7543e
BLAKE2b-256 1524c3609785e1d16fa985a1f63db3cde3d4900e11423b68cc0d1d6a87883fab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page