返回顶部
a

amazon-orders亚马逊订单查询

Download and query your Amazon order history via an unofficial Python API and CLI.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,166
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

amazon-orders

amazon-orders 技能

使用非官方的 amazon-orders Python 包和 CLI 与您的 Amazon.com 订单历史进行交互。

注意:amazon-orders 通过抓取/解析亚马逊消费者网站来工作,因此如果亚马逊更改其页面,它可能会失效。仅官方支持英文亚马逊 .com 网站。

设置

安装/升级

bash python3 -m pip install --upgrade amazon-orders

(安装详情和版本锁定指南请参阅项目 README。)

身份验证选项

amazon-orders 可以从以下位置获取凭据(优先级从高到低):环境变量、传递给 AmazonSession 的参数或本地配置。

环境变量:
bash
export AMAZON_USERNAME=you@example.com
export AMAZON_PASSWORD=your-password

可选:对于启用了 OTP/TOTP 的账户


export AMAZONOTPSECRETKEY=BASE32TOTP_SECRET

(OTP 密钥的使用方法由项目文档说明。)

使用方法

您可以将 amazon-orders 作为 Python 库 或从 命令行 使用。

Python:基本用法

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

amazonsession = AmazonSession(EMAIL>, )
amazon_session.login()

amazonorders = AmazonOrders(amazonsession)

获取特定年份的订单

orders = amazonorders.getorder_history(year=2023)

或使用时间过滤器获取近期订单

orders = amazonorders.getorderhistory(timefilter=last30) # 最近30天 orders = amazonorders.getorderhistory(timefilter=months-3) # 过去3个月

for order in orders:
print(f{order.ordernumber} - {order.grandtotal})

完整详情(较慢,更多字段)

某些订单字段仅在请求完整详情时才会填充;当您需要更丰富的订单数据时启用它:
  • - Python:full_details=True
  • CLI:在 history 命令中使用 --full-details

CLI:常用命令

bash

身份验证(交互式/如果已设置则使用环境变量)


amazon-orders login

订单历史

amazon-orders history --year 2023 amazon-orders history --last-30-days amazon-orders history --last-3-months

提示

  • - 如果您的账户启用了 MFA,建议在自动化运行时设置 AMAZONOTPSECRET_KEY。
  • 自动化时,避免将凭据保存在 shell 历史中:使用环境变量和密钥管理器(1Password、Vault、GitHub Actions secrets 等)。

示例

将年度历史导出为 JSON

bash amazon-orders history --year 2023 --full-details > orders_2023.json

快速总额检查(需要 jq)

bash amazon-orders history --last-30-days --full-details | jq -r .[] | [.ordernumber, .grandtotal] | @tsv

说明

  • - 这是一个非官方的基于抓取的工具(没有官方的亚马逊 API)。
  • 官方文档托管在 Read the Docs 上,提供高级用法和 API(订单、交易等)。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 amazon-orders-1776329309 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 amazon-orders-1776329309 技能

通过命令行安装

skillhub install amazon-orders-1776329309

下载

⬇ 下载 amazon-orders v1.0.0(免费)

文件大小: 2.07 KB | 发布时间: 2026-4-17 15:49

v1.0.0 最新 2026-4-17 15:49
- Initial release of the amazon-orders skill.
- Enables downloading and querying Amazon order history via an unofficial Python API and CLI.
- Supports authentication using environment variables, interactive login, or config files.
- Provides filtering for orders by year or time period (e.g., last 30 days, past 3 months).
- Includes both Python library and CLI usage examples.
- Adds guidance for handling MFA and exporting order data.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部