How I bought an IPhone 5 for 90$ using Python

Luis Batalha
3 min readOct 29, 2013

--

After the official release of the IPhone 5C and 5S I decided I wanted to buy an IPhone. However, like many people, I thought there were no groundbreaking changes between the new IPhone and the old IPhone 5, which led me to believe the best option would be buying a cheaper old version of the phone. Unfortunately, Apple had stopped selling the old IPhone 5 just after the new ones came out and so I looked at a couple of websites that were still selling them like Amazon, Ebay and a few more and tried to figure out which one was selling on average the cheapest devices. During my IPhone quest I ended up in a website called OLX (in this case the portuguese version of OLX since I am living in Portugal), which is a place where people can list and sell their items for free. One characteristic that stood out to me immediately in OLX was the easiness in contacting the seller, posing questions and making offers.To do that you just needed to fill out a simple form with your offer, email address, phone number and name and they would send an email to the seller with that information, without forcing you to register in the website. The seller would then have the option to decline or accept your offer via email. The second thing I noticed in OLX was the price variation. Unlike some of the other websites, which had pretty stable prices, OLX was showing a significant swings in the price of the listed IPhones. That was partially due to the fact that new and used IPhones were being sold at the same time, but a more interesting fact was that apparently a lot of sellers were having difficulties trying to figure out a price point to sell their IPhones, particularly after the release of the new ones. The combination of these two factors seemed to be the perfect opportunity to get a good deal. I thought a way to get a cheap IPhone was to approach the confused sellers and make them a few lowball offers with different emails to make them think the price they were asking was to high according to the market. Finally, I would make a not-so-low price offer that they would be inclined to take, thinking it was a good offer when compared to the other ones. Based on this assumption I quickly wrote a scrappy program in Python using Mechanize ( a library for automatic interaction with browsers ), that searched IPhone 5 in OLX, and did that for every potential IPhone found. I ran the program twice a day, searching for new IPhones and saving in a .txt file the ones I had already “contacted”. I was sending 5 emails per IPhone found, the first 4 where offering a price 70% lower than the one listed and the fifth one was offering a price 60% lower. The interval between sending the first and the last email was about 3 hours. Two weeks and almost 160 IPhones later, I found one guy that was originally selling an IPhone 5 for 225$ (with no contract and in perfect condition) and ended up selling me the phone for 90$!

I am not particularly proud about this feat and I also think that it worked out due to a lot of circumstances that converged at the same time, concerning a specific product, but I simply couldn’t resist to see if this would really work . Also it was a good excuse to learn Python :)

If you are interested check out the Python script here

Thank you Joao for reviewing this post.

--

--