Skip to main content
Use AmzDownloader to collect one product’s main and variant images, then save up to 20 unique image files with Python. This tutorial keeps the original media response so you can trace each image to its variant, marketplace and retrieval time.

Prepare the example

Create a key on the API keys page. You need Python 3.9 or newer and permission to use the images you download. The runnable files use Python’s standard library. Clone the public documentation examples and set your key in the shell:
Use a new operation ID for different work. Keep the original ID if you deliberately retry the same URL and settings after losing a response. Do not print or commit your API key.

Read the complete workflow

The example imports the bundled client.py helper. It sends one POST /scrapes with image groups enabled and video groups disabled. HTTP 200 means it already has completed media; HTTP 202 means it must poll the returned job ID. Polls are limited to 20, separated by three seconds. Each network request also has a timeout.
download_images.py
The image download requests are separate from the authenticated API requests. They accept Amazon media hosts, reject redirects and omit your API key. The 20-file and 10 MB per-image limits are safeguards in this example, not service-wide API limits. Existing image files are not overwritten.

Inspect the result

The output directory contains media-result.json and the downloaded image-001.jpg, image-002.png or equivalent files. The suffix follows the response content type. Inspect these response fields: The script downloads each distinct URL once, even when multiple groups reference it. The complete grouped response remains in media-result.json; filenames do not imply a particular variant. If there are no images, inspect the warnings rather than interpreting the empty list as proof that Amazon has none.

Resume safely and understand credits

A successful extraction costs one credit, including a cached result. Downloading the returned image URLs does not make another AmzDownloader API call. Polls, owned job result reads and identical idempotent replays cost no additional credits. If the local polling budget ends, save the job ID printed to stderr and inspect it with GET /scrapes/{jobId} or /scrapes/{jobId}/result. A timeout does not cancel the job. If downloading a file fails after extraction, inspect the saved JSON before starting another charged request. Source URLs can expire; a newly requested cached read is itself a one-credit media retrieval on success. See the image API overview, variant image API, selection guide and errors and retries.