Google Play has a nice Developer console, which displays various information ranging from download stats to crash reports. It provides a great insight how the app is used. I wanted to automate getting the most important information from the apps I have published. I’m mostly interested in download stats and ratings. Tried several tools and even tried to make a simple python script. Because the site uses lots of javascript, there was no luck in creating my own solution. After some googling, I did stumble upon Google Dev scraper. It has been running on my Raspberry Pi for almost 4 months and it is truly working great!

google_play_store_logo

It needs some prerequisites such as Ruby and RubyGems. After these two are installed, clone the latest version from github. Because I want to get these information on a daily basis I’m using a cronjob that runs a bash script. Upon completion it creates a php file that displays the results in a simple manner. To start using the scraper, you need to get your developer Id. Visit the console and copy the numers after “dev_acc=”. Afterwards you need to get the package name for the stats that you want to get. You need to limit the search for the stats, get the publish date and latest displayed date in the statistics displayed in the console. When you have all of this information, issue the following command googleplay_dev_scraper -u [email protected] -p yourPassword -a yourDeveloperID app.package.name 20130227 20140106 >results.zip (replace the last two numbers with the starting and ending date in the same format!).

If you replaced all the data with your own login information, package name and correct dates, you should end up with a zip file. It contains lots and lots of statistics in csv format. Now it’s all upon you to decide which information you need and automate it with a bash script.  In general, my script does the following. Everyday at noon the starting command is issued to get statistics in a zip file. This file is then unpacked and removed.  Then the app.package.name_overall_installs.csv is read for the latest download number and ratings. Afterwards you can simply email them or display them in your website. Truly an amazing tool!