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:Read the complete workflow
The example imports the bundledclient.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
Inspect the result
The output directory containsmedia-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 withGET /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.