After seeing this post on r/ruby about importing your Amazon order history into SQLite, I thought: I kind of want to know how much I’ve spent on Amazon…but not enough to write a program tonight. While I didn’t find an API for order history, Amazon has a convenient order history report-building tool (login required) that can generate a CSV of every Amazon item you’ve shipped in the past 10 years.

Here’s what the order form looks like:


The form lets you select a date at the beginning of 2006, but the earliest order in my history was in late July 2006, i.e. 10 years ago from today. I used the web inspector to tamper with the form’s POST request but still didn’t receive any data before July 2006 (according to my old GMails, I’ve ordered at least one Simpsons DVD set pre-2006).

Another limitation of this data: again, the Order History Form only includes physically shipped items. So it doesn’t include digital purchases, such as streaming movies and Kindle books.

According to the report I downloaded, since 2006, I’ve ordered roughly 300 different physical items from Amazon. Some items were purchased in quantities greater than 1, but Amazon records a row for every item per order. For example, my dataset includes several entries for this Macbook keyboard cover.

I’m pretty surprised at how low that total number of different items is. I would’ve guessed that I’ve made at least 300 separate orders – each order containing multiple kinds of items – but I’ve actually made 160 orders. I’ve been a long-time Amazon Prime customer partly because I had thought I ordered from Amazon so often, but the data seems to tell a different story.

(note: I order Kindle books frequently, so that’s probably why I think I’ve ordered much more than what my physical order history shows)

Using a pivot table, this is the top 3 categories by number of items and price paid:

Category Count Price
Personal Computers 55 $4,777.44
Electronics 52 $3,565.31
Office Product 18 $788.88

Ouch. Though not surprising…the “Personal Computers” category also consists of hard drives and memory cards, and “Electronics” includes digital cameras and accessories. So that seems about right for 10 years of memory capacity, laptops, monitors, and camera equipment, not including what I’ve spent at the Apple Store.

If you’re curious about the kind of data the report contains, here are the headers and the values for a sample order. The ASIN/ISBN field contains the unique ID that you can append to in order to get the product page URL:

Header Sample value
Order Date 10/05/09
Order ID 555-8675309-8675309
Title Idiocracy
Category DVD
Release Date 01/08/07
Condition new
Seller Credentials  
List Price Per Unit 14.98
Purchase Price Per Unit 8.99
Quantity 1
Payment - Last 4 Digits 9999
Purchase Order Number  
Ordering Customer Email
Shipment Date 10/09/09
Shipping Address Name Dan Haus
Shipping Address Street 1 100 Broadway
Shipping Address Street 2  
Shipping Address City NEW YORK
Shipping Address State NY
Shipping Address Zip 10006-3734
Order Status Shipped
Carrier Name & Tracking Number  
Item Subtotal 8.99
Item Subtotal Tax 0.80
Tax Exemption Applied  
Tax Exemption Type  
Exemption Opt-Out  
Buyer Name DAN HAUS
Currency USD
External Item Number  

Here’s the Create an Order History Report page:

Here’s a help page about how to use that page.

Here’s chrisb’s Github repo for importing your Amazon order history into SQLite/ActiveRecord.