Since I started working freelance, I’ve been planning to get few of my projects that I had to shelve during my fulltime tenure, off the ground. So this month, while my part-time slot was opening up, I started working on them again.
One of the project that I’m most interested in was a price comparison for all of Apple products in different country against the latest currency rate. While I’m buying my MacBook and iPhone, the ringgit was down. Since I was traveling on monthly basis, I’ve been wondering if I can get them anywhere cheaper in the region.
It’s a simple data, but I couldn’t find anywhere helpful except to manually go to each Apple Online Store. True to the way of developer, there’s only one way to solve this issue: build them.
There’s no reliable free API available for it, so I started poking around the Apple product page. Luckily, I found the pages use schema.org metadata for the prices, where you can retrieve them using Google Structured Data Testing Tool. I believe it was indexed by Google Shopping so it should reflect accurate data.
Using the magic of Nokogiri and a belief that Apple rarely redesign their whole product page, I went forth and wrote a highly-customized scraper that goes to each country Online Store. It was a lot of work but seeing that database gets populated without a single hitch was well worth it.
It’s a bit crude to display just the price without any context, not to mention the treachery of using Bootstrap default styling. Sorry designers.
So I added the percentage difference between, current exchange rate, as well as group countries by region, since it make more sense to compare nearby countries you actually willing to travel in order to buy them.
While we’re at it, why not add local prices, and color-coded value for easier scanning. Also, currency exchange movement won’t hurt anyone (except those citizens with devalued currencies).
To sum up the data, I put top three countries to buy Apple products in home page. Not all that surprising for the best countries, but it is safe to say that EMEA countries generally pay more.
I added latest price changes for occasional price update, which also happened while I’m building it. Based on early feedbacks, there’s also VAT refund that I can include in the table.
The whole dev took a little more than 2 weeks, and some sleepless nights. So here’s the result, if you’d like to check them out: themacindex.com