Calculating App Store Spend

I like buying apps. Perhaps it comes from being an app developer myself, but I like to pay for apps that I enjoy and that I get value from. Designing and building an app takes a huge amount of work, and I hope that paying for an app means that it’s more likely to receive updates in the future.

I’ve recently had a couple of conversations with people who have never paid for an app, which made me curious about just how much I’ve spent over the years. Unfortunately Apple provides no easy way to see this information. but they do send out regular receipt emails when you make a purchase. I’ve always archived these emails in my Gmail account, so I put together a small script to parse them and produce some figures. I mentioned it on Twitter and a number of people showed interest in it, so I thought I’d reproduce it here.

The steps below outline how I retrieved my own emails and ran the numbers; of course, everybody’s setup is different but hopefully you’ll be able to adapt them to your needs. I use Gmail as my email provider and OS X as my operating system, so all of the instructions are specific to that setup.

  1. First of all, you’ll need to tag all of your iTunes receipts with a unique tag. I have a filter set up for the following search, which tags all matching emails with iTunesReceipts:

    from:(itunes store) subject:(your receipt no.*)

  2. Next, download all of your iTunes receipts as .eml files. I used Gmvault to download mine. Grab the tool and extract it. I used the following command to fetch the relevant emails:

    gmvault sync --type custom --gmail-req "in:iTunesReceipts" your_email_address@gmail.com --no-compression

    By default, Gmvault will download the emails into a directory named gmvault-db/db in your home directory.

  3. Nowcd into the Gmvault db directory. You can then either manually download my parser script from the [Github Gist] and run it, or download and run automatically in a single command:

ruby -e "$(curl -fsSL https://gist.githubusercontent.com/frosty/b6d1615dab5544fc22b0/raw/e4e3b48b032079e188c8d3f246b2609b83995558/parser.rb)"
  1. The script will first ask for the currency symbol your emails will use; it defaults to ‘£’ if you just press enter. It should then output a count and combined spend for iOS apps and in-app purchases. It’ll also create a tab-separated file named Apps.tsv, which will contain a list of all of your purchases. You can open this in a text editor or a spreadsheet app like Numbers if you want to.

Notes

  • The script could probably be much neater, but I don’t work with Ruby very often and I just threw it together in an evening!
  • I make no guarantees that this script catches everything or that it doesn’t pick up any false positives. The iTunes receipt format is quite awkward and inconsistent and has changed quite a lot throughout the years. Based on my own receipts, however, this seems to do a pretty good job.
  • If you have a suggestion for ways to improve the script, feel free to fork it on Github!

So how much have I spent on apps? Turns out, it’s rather a lot. But when I average my spend out over the life of the App Store, and consider the amount of value and enjoyment I get from the various apps and games I’ve bought over the years… I think it’s a pretty good deal.