gmusicapi: an unofficial API for Google Play Music

This library allows control of Google Music with Python.

from gmusicapi import Mobileclient

api = Mobileclient()
# after running api.perform_oauth() once:
api.oauth_login('<a previously-registered device id>')
# => True

library = api.get_all_songs()
sweet_track_ids = [track['id'] for track in library
                   if track['artist'] == 'The Cat Empire']

playlist_id = api.create_playlist('Rad muzak')
api.add_songs_to_playlist(playlist_id, sweet_track_ids)

This project is not supported nor endorsed by Google. Use common sense (protocol compliance, reasonable load, etc) and don’t ruin the fun for everyone else.


All major functionality is supported:

  • Library management: list, create, delete, and modify songs and playlists
  • Streaming and single-song downloading
  • Music Manager uploading/scan-and-match and library downloading
  • Most All Access features

See the changelog for changes by version.

Using gmusicapi

Getting started

The usage section has installation instructions and some simple examples.

Api and data reference

The reference has details for all classes and functions, as well as information on the Google Music data you’ll encounter:

Making gmusicapi better

Contributions are always welcome! The contributing section has more details.

The code might also be useful.

Ports and other languages

The ports section lists known ports and information for making ports.

Getting help

Start by searching for existing issues on GitHub. If you don’t find any describing what you’re seeing, go ahead and open one.

There’s also #gmusicapi on Freenode, though it’s pretty quiet these days.