The Google Music API

This is an undocumented, beta API used by the Google Music client for Android. Most of the URIs you see here were extracted from the Android .apk file. Overall, it works just like any other GData API.

A few notes:

The service name for Google Music is "sj", which seems to be short for "SkyJam".

As far as I can tell, this requires ClientLogin for auth, since there's no OAuth permissions for the service. I'd be happy to be wrong on this point.

Authentication

First we need to go through the ClientLogin process to get our auth token. This process is documented fairly thoroughly in Google's API documentation and we can copy their sample requests exactly, aside from the value of the service parameter.

Using cURL, I was able to get an auth token with the following command:

If everything is successful, you should get back a JSON response containing all of the metadata for all of your tracks.

Other requests

These are other API requests that were found in the Android client.

/playlists/magic

/plentries

/plentriesbatch

/plentryfeed

/playlistbatch

/playlists

/playlistfeed

/trackstats

/trackbatch

/tracks

/trackfeed

Requesting the audio stream

Once we have the song ID of a track, we can request that track's audio stream as an MP3 file. This is actually a 2-part request, we need to request the URL of the stream, and then the stream itself.
Unfortunately, you need to have sync'ed your Google account with an Android device in order for this part to work.

Android makes requests to https://android.clients.google.com/music/mplay with the following parameters.

Note: This might return HTTP redirects before eventually giving you the audio stream. Make sure you are prepared to handle redirects!

songid

The UUID of the track that you are requesting. This parameter is required!

pt

The playback type. Valid values are e (requesting for explicit playback) and a.

There is also an important HTTP header that must be sent with this request, in addition to the GoogleLogin header.
You must include X-Device-ID with the value of your Android device's ID. The device must be linked to your Google account. Failure to include this header will result in HTTP status 400. If you don't have an Android device, you can run one in the Android emulator (included with the Android SDK), and set up your Google account to sync. Then you can use the device ID of the emulated device to request your music.

Disclaimer:
I am not associated with Google. This information is the result of my personal investigation into an API that is not yet publicly documented. The API is subject to change without warning as Google sees fit.