{"id":45593139,"url":"https://github.com/eshaffer321/amazon-go","last_synced_at":"2026-02-23T13:02:03.694Z","repository":{"id":328744648,"uuid":"1106325706","full_name":"eshaffer321/amazon-go","owner":"eshaffer321","description":"Go client for amazon order history","archived":false,"fork":false,"pushed_at":"2025-12-15T03:10:29.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-17T20:55:19.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eshaffer321.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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}},"created_at":"2025-11-29T03:02:43.000Z","updated_at":"2025-12-15T03:10:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eshaffer321/amazon-go","commit_stats":null,"previous_names":["eshaffer321/amazon-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eshaffer321/amazon-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Famazon-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Famazon-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Famazon-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Famazon-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eshaffer321","download_url":"https://codeload.github.com/eshaffer321/amazon-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Famazon-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29743765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-02-23T13:01:51.012Z","updated_at":"2026-02-23T13:02:03.688Z","avatar_url":"https://github.com/eshaffer321.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amazon-go\n\n\u003e **Project Status: Archived**\n\u003e\n\u003e As of December 2024, Amazon has implemented client-side encryption on their order history pages. Order data is now encrypted in the HTML and decrypted via JavaScript in the browser (`SiegeClientSideDecryption`). This means server-side HTML parsing no longer works - the raw HTML contains encrypted blobs instead of order details.\n\u003e\n\u003e **Alternative approach:** Use a browser extension that can read the DOM after JavaScript has decrypted the content. See [monarchmoney-sync-backend](https://github.com/eshaffer321/monarchmoney-sync-backend) for the project that will handle Amazon order syncing via a different method.\n\n---\n\nGo library for fetching Amazon order history and payment transactions by parsing HTML pages.\n\nAmazon doesn't expose a JSON API for order history - pages are server-side rendered HTML. This library uses goquery to parse the HTML and extract order data.\n\n## Why This Doesn't Work Anymore\n\nAmazon now encrypts order data in the HTML response:\n\n```html\n\u003cdiv class=\"order-card js-order-card\"\u003e\n  \u003cdiv class=\"csd-encrypted-sensitive\" id=\"...\"\u003e\n    \u003cscript\u003e\n      SiegeClientSideDecryption.decryptInElementWithId(elementId, {\n        \"ct\": \"S9XspR+u8Ori3uoQzMMh4k4SiVDD...\", // encrypted order data\n        \"iv\": \"V5t1PF1IfzPo+xrD\",\n        \"kid\": \"c3a22d\"\n      });\n    \u003c/script\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\nThe `.order-card` elements exist, but their contents are encrypted ciphertext that requires JavaScript execution to decrypt. Without running a full browser, you can't access the order IDs, dates, totals, or items.\n\n---\n\n## Original Documentation (for reference)\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand original usage docs\u003c/summary\u003e\n\n### Installation\n\n```bash\ngo get github.com/eshaffer321/amazon-go\n```\n\n### Authentication\n\nThe library uses cookie-based authentication. Extract cookies from your browser:\n\n1. Log into Amazon in your browser\n2. Go to https://www.amazon.com/your-orders/orders\n3. Open DevTools (F12) -\u003e Network tab\n4. Refresh the page\n5. Right-click the main request -\u003e Copy as cURL\n\nThen import the cookies:\n\n```go\nclient, _ := amazon.NewClient()\nclient.ImportCookiesFromCurl(curlCommand)\n// Cookies are saved to ~/.amazon-go/cookies.json\n```\n\n### Usage\n\n```go\nclient, _ := amazon.NewClient()\n\n// Fetch orders with item details\norders, _ := client.FetchOrders(ctx, amazon.FetchOptions{\n    Year:           2025,\n    IncludeDetails: true,\n})\n\nfor _, order := range orders {\n    fmt.Printf(\"Order %s - $%.2f\\n\", order.ID, order.Total)\n    for _, item := range order.Items {\n        fmt.Printf(\"  %s - $%.2f\\n\", item.Name, item.Price)\n    }\n}\n```\n\n### Transactions\n\nAmazon orders can have multiple payment transactions (split shipments, partial charges, etc). This is important for matching bank/credit card transactions to orders.\n\n```go\n// Get transactions for an order\ntransactions, _ := client.FetchTransactions(ctx, \"114-1234567-1234567\")\n\nfor _, tx := range transactions {\n    fmt.Printf(\"%s: $%.2f on %s (card ending %s)\\n\",\n        tx.OrderID, tx.Amount, tx.Date.Format(\"Jan 2\"), tx.LastFour)\n}\n```\n\n### Data structures\n\n```go\ntype Order struct {\n    ID           string\n    Date         time.Time\n    Total        float64\n    Subtotal     float64\n    Tax          float64\n    ShippingFees float64\n    Items        []*OrderItem\n}\n\ntype OrderItem struct {\n    Name      string\n    Price     float64   // line total\n    Quantity  float64\n    UnitPrice float64\n    ASIN      string    // Amazon product ID\n}\n\ntype Transaction struct {\n    OrderID       string    // links to Order.ID\n    Date          time.Time // when charged (may differ from order date)\n    Amount        float64\n    PaymentMethod string    // e.g. \"Prime Visa ****1211\"\n    CardType      string    // Visa, Mastercard, Amex, etc.\n    LastFour      string    // last 4 digits of card\n    Merchant      string    // e.g. \"AMZN Mktp US\"\n    Status        string    // Completed, Pending, etc.\n}\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshaffer321%2Famazon-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feshaffer321%2Famazon-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshaffer321%2Famazon-go/lists"}