Practical guide

Read exported Amazon JSON in Python

Read a downloaded ASINtoJSON file locally with Python's json module; this is not a public API workflow.

Load the downloaded file

Download JSON after a successful lookup, save it locally, and pass that file to Python's standard json module. No network call or public ASINtoJSON API is involved.

import json

with open("amazon-product.json", encoding="utf-8") as file:
    product = json.load(file)

print(product["asin"])
print(product["marketplace"])

Read optional images and attributes safely

for image_url in product.get("images", []):
    print(image_url)

for group in product.get("product_information", []):
    print(group.get("title", "Product information"))
    for label, value in group.get("attributes", {}).items():
        print(f"{label}: {value}")

Handle missing scalar values

Optional values such as brand, rating, main_image, and bsr can be null. Use .get() and test for None instead of assuming every product has every field.

bsr = product.get("bsr")
if bsr is None:
    print("BSR was not provided in this snapshot")

Results may be cached and optional source fields can be absent. See the data methodology for collection and field boundaries. Read the data methodology.

Frequently asked questions

Does the Python example call a public API?

No. It reads a JSON file already downloaded to the local computer with Python's standard json module.