I designed and coded a program that queries the Amazon Product Advertising API. It records the prices and sends an alert if the price meets a certain threshold. This might sound like a pretty simple idea, but there is actually a lot to consider.
- Retrieves the price data for thousands of items as frequently as allowed
- Sends a mobile alert and updates a website when a price match is made
- Allow for easy removal, addition and editing of “watched” products
- Displays graphs of historical price data, as well as sales rank
- Program needs to start up automatically and run for long periods of time without any stability issues.
Additional Challenges (these were “discovered” later)
- Amazon changes their database, by redirecting ASINs, and they do not provide this information via their Amazon Product Advertising API
- The need to ignore certain sellers became apparent, and this also is not available through the Amazon Product Advertising API.
- Text data can take up a lot of space and tables become too large.
A Look at the Program I Developed
Key Design Ideas
- I chose to separate the background worker thread, which looks up the price data, from the user-facing interface.
- I created a visual dashboard that gives feedback as to the program’s current status, most recent matches, and recent error messages
- Exceptions are logged but the program is able to recover from them and continue running.
- I wrote an algorithm that throws away the least important data to save space. I created summary tables that save just the daily low and high prices and I used these for my graphs.
- Green status indicator. This will turn to a red X if the lookup program is not running correctly (for example, no internet connection or MySQL connection error)
- Link to the Status page, which displays errors and information about recent queries
- Input field to lookup an ASIN. If it’s in the database, a price history chart is displayed.
- The user can star a match that they are considering.
- Clicking on the product’s name links to the price history page, which also has a link to Amazon for easy purchasing.
The Amazon Search Portal
The Amazon Search Portal is the part of my program that allows for easy addition, editing, or removal of products from the database. Products that are checkmarked are already in the database. The details badge is a link to a popup that allows for editing the desired price and notes. The update button allows for easy addition or removal of products. I used Boostrap.js for the design elements. It’s a really easy way to make a web app responsive and less ugly!
Thinking about doing something like this? Already did it?
I’d love to hear your experience. You can definitely make money buying low and selling high — that’s not new. But with programming skills and a lot of time, you can certainly write programs that do a lot of the work for you! Automation is definitely one of my favorite programming tasks to take on.