DEV Community

Alex Laird
Alex Laird

Posted on • Edited on

amazon-orders for Python

amazon-orders - a python library

amazon-orders is an unofficial library that provides a command line interface alongside a programmatic API that can
be used to interact with Amazon.com's consumer-facing website.

This works by parsing website data from Amazon.com. A nightly build validates functionality to ensure its
stability, but as Amazon provides no official API to use, this package may break at any time. This
package only supports the English version of the website.

Installation

amazon-orders is available on PyPI and can be installed using pip:

pip install amazon-orders
Enter fullscreen mode Exit fullscreen mode

That's it! amazon-orders is now available as a Python package is available from the command line.

Basic Usage

Execute amazon-orders from the command line with:

amazon-orders --username <AMAZON_EMAIL> --password <AMAZON_PASSWORD> history
Enter fullscreen mode Exit fullscreen mode

Or use amazon-orders programmatically:

from amazonorders.session import AmazonSession
from amazonorders.orders import AmazonOrders

amazon_session = AmazonSession("<AMAZON_EMAIL>",
                               "<AMAZON_PASSWORD>")
amazon_session.login()

amazon_orders = AmazonOrders(amazon_session)
orders = amazon_orders.get_order_history(year=2023)

for order in orders:
    print("{} - {}".format(order.order_number, order.grand_total))
Enter fullscreen mode Exit fullscreen mode

Documentation

For more advanced usage, amazon-orders's official documentation is available at http://amazon-orders.readthedocs.io.

Contributing

If you would like to get involved, be sure to review the Contribution Guide.

Want to contribute financially? If you've found amazon-orders useful, sponsorship would
also be greatly appreciated!

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay