gmusicapi is an unofficial Python API for Google Play Music. It allows you to control Google Music from Python scripts. It is not supported nor endorsed by Google.

If you have any questions or comments about it, you can visit #gmusicapi on or ask thebigmunch in the Whatbox IRC channel.


Connect to your server through SSH.


The avconv tool used by gmusicapi to transcode non-mp3 files is not installed on Whatbox. You will have to download a static binary and add it to your PATH to use.

  1. Download the avconv static binary and give it executable permissions.

     mkdir -p ~/bin && wget -O ~/bin/avconv && chmod +x ~/bin/avconv
  2. Add the bin directory to your PATH (if you've done this previously, you do not need to do it again)

     echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc


Follow the instructions in the virtualenv article to install and activate a Python virtual environment. If you have previously set up virtualenv, you may choose to re-use it or create a new one with a different name.


With your virtualenv activated, install gmusicapi and its dependencies with the pip package installer.

pip install gmusicapi


Scripts for uploading with gmusicapi can be found here.

  • With your virtualenv activated, install docopt with the pip package installer.

      pip install docopt
  • Clone the repository

      git clone ~/gmusicapi-scripts


To clean up the files no longer needed from this process, use the following command.

rm -rf virtualenv-*



  1. Activate your virtualenv

  2. Run the following command

     pip install --upgrade gmusicapi


  1. Navigate to your gmusicapi-scripts directory

     cd ~/gmusicapi-scripts
  2. Pull in any changes with git. If you get a message about having modified files, run git reset --hard beforehand.

     git pull


  • Activate your virtualenv
  • For options and instructions, see the gmusicapi-scripts wiki
  • You will need to use the full path to the scripts like ~/gmusicapi-scripts/ unless you add the directory to your PATH or create an alias.

Creating Scripts

The documentation for the API can be found here. The API itself is hosted on Github where you'll find more information about its capabilities.