{"id":15486758,"url":"https://github.com/chrisns/amazon-invoice-downloader","last_synced_at":"2026-03-04T23:02:37.343Z","repository":{"id":214410473,"uuid":"736378892","full_name":"chrisns/amazon-invoice-downloader","owner":"chrisns","description":"Automatically download Amazon Invoices as PDFs","archived":false,"fork":false,"pushed_at":"2025-08-31T12:48:30.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T14:38:08.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dcwangmit01/amazon-invoice-downloader","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["chrisns"],"custom":["https://www.paypal.me/cns"]}},"created_at":"2023-12-27T18:29:17.000Z","updated_at":"2025-08-31T12:48:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a213ace-94d7-4769-b0b1-431bbd0f8b51","html_url":"https://github.com/chrisns/amazon-invoice-downloader","commit_stats":{"total_commits":19,"total_committers":3,"mean_commits":6.333333333333333,"dds":0.368421052631579,"last_synced_commit":"5c4d513e7194da2b3115a9bd37468eb7f197e100"},"previous_names":["chrisns/amazon-invoice-downloader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrisns/amazon-invoice-downloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisns%2Famazon-invoice-downloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisns%2Famazon-invoice-downloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisns%2Famazon-invoice-downloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisns%2Famazon-invoice-downloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisns","download_url":"https://codeload.github.com/chrisns/amazon-invoice-downloader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisns%2Famazon-invoice-downloader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284304460,"owners_count":26982162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-13T02:00:06.582Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T06:09:35.857Z","updated_at":"2025-11-13T23:03:58.067Z","avatar_url":"https://github.com/chrisns.png","language":"Python","funding_links":["https://github.com/sponsors/chrisns","https://www.paypal.me/cns"],"categories":[],"sub_categories":[],"readme":"\u003e Modified version to presume you've got chrome running already logged in to your amazon account with remote debug enabled at port `9223` and interested in `amazon.co.uk`\n\n# Amazon Invoice Downloader\n\n[![PyPI - Version](https://img.shields.io/pypi/v/amazon-invoice-downloader.svg)](https://pypi.org/project/amazon-invoice-downloader)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/amazon-invoice-downloader.svg)](https://pypi.org/project/amazon-invoice-downloader)\n\n-----\n\n**Table of Contents**\n\n- [Amazon Invoice Downloader](#amazon-invoice-downloader)\n  - [What it does](#what-it-does)\n  - [Usage](#usage)\n  - [License](#license)\n\n## What it does\n\n\nThis program `amazon-invoice-downloader.py` is a utility script that uses the [Playwright](https://playwright.dev/) library to spin up a Chromium instance and automate the process of downloading invoices for Amazon purchases within a specified date range. The script logs into Amazon using the provided email and password, navigates to the \"Returns \u0026 Orders\" section, and retrieves invoices for the specified year or date range.\n\nThe user can provide their Amazon login credentials either through command line arguments (--email=\u003cemail\u003e --password=\u003cpassword\u003e) or as environment variables ($AMAZON_EMAIL and $AMAZON_PASSWORD).\n\nThe script accepts the date range either as a specific year (--year=\u003cYYYY\u003e) or as a date range (--date-range=\u003cYYYYMMDD-YYYYMMDD\u003e). If no date range is provided, the script defaults to the current year.\n\nOnce the invoices are retrieved, they are saved as PDF files in a local \"downloads\" directory. The filename of each PDF is formatted as `YYYYMMDD_\u003ctotal\u003e_amazon_\u003corderid\u003e.pdf`, where YYYYMMDD is the date of the order, total is the total amount of the order (with dollar signs and commas removed), and orderid is the unique Amazon order ID.\n\nThe program has a built-in \"human latency\" function, sleep(), to mimic human behavior by introducing random pauses between certain actions. This can help prevent the script from being detected and blocked as a bot by Amazon.\n\nThe script will skip downloading a file if it already exists in the `./downloads` directory.\n\n\n## Usage\n\n```console\n$ /Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --remote-debugging-port=9223 --remote-debugging-address=0.0.0.0\n$ hatch run pip install -e .\n$ hatch run amazon-invoice-downloader --year 2023\n\n```console\n$ amazon-invoice-downloader -h\nAmazon Invoice Downloader\n\nUsage:\n  amazon-invoice-downloader.py \\\n    [--year=\u003cYYYY\u003e | --date-range=\u003cYYYYMMDD-YYYYMMDD\u003e]\n  amazon-invoice-downloader.py (-h | --help)\n\nDate Range Options:\n  --date-range=\u003cYYYYMMDD-YYYYMMDD\u003e  Start and end date range\n  --year=\u003cYYYY\u003e            Year, formatted as YYYY  [default: \u003cCUR_YEAR\u003e].\n\nOptions:\n  -h --help                Show this screen.\n\nExamples:\n  amazon-invoice-downloader.py --year=2022  # This uses env vars $AMAZON_EMAIL and $AMAZON_PASSWORD\n  amazon-invoice-downloader.py --date-range=20220101-20221231\n  amazon-invoice-downloader.py  # Defaults to current year\n  amazon-invoice-downloader.py --year=2022\n  amazon-invoice-downloader.py --date-range=20220101-20221231\n```\n\n\n## License\n\n`amazon-invoice-downloader` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisns%2Famazon-invoice-downloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisns%2Famazon-invoice-downloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisns%2Famazon-invoice-downloader/lists"}